FormulaCraft

How to remove line breaks from a cell in Excel and Google Sheets

Topic:Text manipulation
Excel & Google Sheets
=SUBSTITUTE(A2,CHAR(10),"")

Verified example

Computed by a real spreadsheet engine on the sample data below.

headerheader
data with line breakdata
another data pointmore data

=SUBSTITUTE(A2,CHAR(10),"")data withline break

Try it with your data

Edit the grid or formula, then run it through a real spreadsheet engine — no signup.

Sample data — click any cell to edit

Runs server-side · free · no signup

Step by step

  1. 1Select the cell or range where you want to remove line breaks.
  2. 2Enter the SUBSTITUTE formula in an adjacent cell, replacing A2 with your target cell reference.
  3. 3Press Enter to apply the formula and see the result without line breaks.

Tips

Working on a sheet you inherited? Run the Auditor on the whole file first — it flags every #REF!, #N/A, broken column pattern, and inconsistent formula in seconds, free, no signup.

Frequently asked

What if my line breaks are not being removed?

Check if your line breaks are CHAR(10) or CHAR(13). You might need to use SUBSTITUTE(A2,CHAR(13),"") or both.

Can I remove line breaks directly in the original cell?

No, formulas create new results. To overwrite the original cell, copy the formula result and paste it as values back into the original cell.

Does this work for multiple lines of text?

Yes, but for multiple consecutive line breaks, consider using a combination of SUBSTITUTE functions or other text manipulation techniques.

More on Text manipulation

See all →

Formulas used

Written and reviewed by FormulaCraft Team. Each formula on this page is run through our verification engine before publishing.

Last reviewed: