Remove Line Breaks From Cells

Excel Formulas › Text

All versionsCLEAN

Pasted data often carries hidden line breaks that wreck exports and lookups. SUBSTITUTE swaps the line-break character for a space, and CLEAN strips any other non-printable leftovers.


Quick formula: replace in-cell line breaks with spaces:
=TRIM(SUBSTITUTE(A2, CHAR(10), " "))
CHAR(10) is the line-feed character; SUBSTITUTE swaps it for a space and TRIM tidies the result.

Functions used (tap for the full reference guide):

The example

Multi-line cell collapses to one clean line.

AB
1RawOne line
2123 Main⏎Suite 5123 Main Suite 5

The formula

The formula:

=TRIM(SUBSTITUTE(A2, CHAR(10), " ")) // swap CHAR(10) for a space

How it works

How it works:

  1. CHAR(10) is the line-feed inserted by Alt+Enter; CHAR(13) is a carriage return some imports add.
  2. SUBSTITUTE(A2, CHAR(10), " ") replaces every line break with a space.
  3. Wrap in TRIM to collapse the double spaces that result, and CLEAN to remove other non-printables.
  4. To remove breaks entirely (no space), substitute with "" instead of a space.

CLEAN alone removes line breaks too — =CLEAN(A2) strips the first 32 non-printable characters, including CHAR(10) and CHAR(13). But it deletes them with no replacement, joining words together; use SUBSTITUTE with a space first if you need word separation, then CLEAN for the rest.

Try it: interactive demo

Live demo

Text with line breaks (press Enter inside).

Result:

Variations

Remove entirely

No replacement space:

=SUBSTITUTE(A2, CHAR(10), "")

CLEAN everything

Strip all non-printables:

=CLEAN(A2)

Both breaks

CR and LF:

=SUBSTITUTE(SUBSTITUTE(A2,CHAR(13)," "),CHAR(10)," ")

Pitfalls & errors

Two break characters. Imports may use CHAR(13), CHAR(10), or both — substitute each to be safe.

CLEAN joins words. It deletes breaks with no space; SUBSTITUTE with a space keeps words apart.

TRIM the doubles. Replacing breaks with spaces can leave double spaces — wrap in TRIM.

Practice workbook

📊
Download the free Remove Line Breaks from Text practice workbook
A line-break sheet with the remove-entirely, CLEAN, and both-characters variants, plus 4 challenges with answers. No sign-up required.

Frequently asked questions

How do I remove line breaks from a cell in Excel?
Use =TRIM(SUBSTITUTE(A2, CHAR(10), " ")) to replace in-cell line breaks (Alt+Enter) with spaces and tidy the result.
What's the difference between CLEAN and SUBSTITUTE here?
CLEAN deletes non-printable characters with no replacement, joining words; SUBSTITUTE lets you swap a line break for a space so words stay separated.
My data still has breaks after CHAR(10) — why?
Some imports use CHAR(13) (carriage return). Substitute both: =SUBSTITUTE(SUBSTITUTE(A2,CHAR(13)," "),CHAR(10)," ").

Stop fighting formulas. Learn them in a day.

This recipe is one of hundreds of real-world formulas we teach. Our Excel Formulas & Functions class covers lookups, logic, text, and dynamic arrays hands-on — live in Dallas–Fort Worth, Houston, Austin, Oklahoma City, Denver, or online.

See the Formulas & Functions Class

Related formulas: Clean text · Replace text · Remove specific characters

Function references: SUBSTITUTE · CLEAN