# How to remove line breaks from cells in Excel

Replace CHAR(10), the line break, with a space and trim: =TRIM(SUBSTITUTE(A2,CHAR(10)," ")).

**Excel:** `=TRIM(SUBSTITUTE(A2,CHAR(10)," "))` (Every current version)

**Google Sheets:** the same formula works.

## Example

Sample data (row 1 is the header):

| A | B |
| --- | --- |
| Address (pasted) | One line |
| 1420 Lake St Minneapolis, MN 55401 |  |
| 88 Oak Ave Saint Paul, MN 55102 |  |
| 7 Elm Ct, Madison, WI 53703 |  |
| 305 River Rd Fargo, ND 58102 |  |
| 12 Pine Ln Duluth, MN 55802 |  |

Formula in B2, filled to B6: `=TRIM(SUBSTITUTE(A2,CHAR(10)," "))`

Result: 1420 Lake St Minneapolis, MN 55401; 88 Oak Ave Saint Paul, MN 55102; 7 Elm Ct, Madison, WI 53703; 305 River Rd Fargo, ND 58102; 12 Pine Ln Duluth, MN 55802

## How it works

A line break inside a cell is character 10. SUBSTITUTE replaces each one with a space so the words stay apart, and TRIM collapses the double space left by the empty line in row 5.

## Other ways

- `=CLEAN(A2)`: CLEAN removes line breaks and other control characters, but replaces them with nothing. (Words are joined: "1420 Lake StMinneapolis, MN 55401".)

## Common mistakes

- Text from Windows files can also have CHAR(13) before each break. Remove both: `=TRIM(SUBSTITUTE(SUBSTITUTE(A2,CHAR(13),""),CHAR(10)," "))`.
- To do it in place, use Find and Replace and press Ctrl+J in the Find box to enter a line break.

## Questions

**How do I replace the line breaks with commas?**

Use `=SUBSTITUTE(A2,CHAR(10),", ")`.

**Does this work in Google Sheets?**

Yes. Google Sheets uses CHAR(10) for line breaks too.

Every formula and result on this page was checked by running it in the Spreadsheet Practice formula engine on 2026-10-30.

Source: https://spreadsheetpractice.com/formulas/remove-line-breaks-from-cells
