Menu

New Line in an Excel Cell: Alt+Enter and CHAR(10)

Press Alt+Enter while typing in a cell to start a new line in it (Control+Option+Return on a Mac). In a formula, CHAR(10) is the line break: =A2&CHAR(10)&B2 puts B2 on a second line, shown once Wrap Text is on.

Every sheet on this page is live: change a number or a formula and it recalculates.

To start a new line inside a cell, press Alt+Enter while you type. On a Mac, press Control+Option+Return; Microsoft 365 for Mac also accepts Option+Return. In a formula, the line break is CHAR(10): =A2&CHAR(10)&B2 puts the text of B2 on a second line under the text of A2.

Put a line break in a formula
C2
ABC
1StreetCityAddress label
212 Oak RoadLeeds12 Oak Road Leeds
34 Mill LaneYork4 Mill Lane York
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Click C2: the formula joins the street, a line break and the city. The small sheet shows the result on one line. In Excel the cell also shows one line until you turn on Home > Wrap Text for it; then the row grows and the city appears under the street. A line break you type with Alt+Enter turns Wrap Text on by itself. A line break from a formula does not, which is the usual reason for "CHAR(10) is not working".

Pressing Enter alone finishes the cell and moves down. In Google Sheets, a new line in a cell is Ctrl+Enter or Alt+Enter (Cmd+Enter on a Mac), and CHAR(10) works the same way.

The line break is one character

CHAR(10) is the line feed character, code 10. It counts as one character, and FIND and SUBSTITUTE can look for it like any other:

Find the line break
B2
ABCD
1TextLengthBreak atFirst line
2Ana Silva94Ana
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Ana, the break and Silva make 9 characters, and the break is the 4th. D2 takes everything before it. A2 is built with a formula here only so that you can see where the break is; a cell where someone pressed Alt+Enter behaves the same.

Name over title
C2
ABC
1NameTitleBadge
2Ana SilvaManager
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Your turn: In C2, put the name from A2 and the job title from B2 in one cell, the title on a second line.

Join a range with line breaks

To stack a whole list in one cell, use CHAR(10) as the delimiter of TEXTJOIN:

One item per line
C2
ABC
1ItemList
2MilkMilk Bread Eggs
3Bread
4Eggs
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

In Excel 2016 and older, which have no TEXTJOIN, chain the cells with &: =A2&CHAR(10)&A3&CHAR(10)&A4.

Remove line breaks

Data copied from emails, web forms or other programs often brings line breaks with it. Replace each break with a space or a comma using SUBSTITUTE:

Turn line breaks into spaces or commas
B2
ABCD
1ImportedSpacesCommasCLEAN
2Milk Bread EggsMilk Bread EggsMilk, Bread, EggsMilkBreadEggs
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

CLEAN, in D2, also deletes line breaks, but it puts nothing in their place, so the words run together as MilkBreadEggs. Text from Windows files can carry a carriage return, CHAR(13), in front of each line feed; remove both with =SUBSTITUTE(SUBSTITUTE(A2,CHAR(13),""),CHAR(10)," ").

One line, separated by commas
B2
AB
1ImportedOne line
2Ana Ben Chen
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

Your turn: The names in A2 are on separate lines. In B2, return them on one line with a comma and a space in place of each line break.

Split a cell at its line breaks

=TEXTSPLIT(A2,CHAR(10)) puts each line in its own column (Microsoft 365 and Excel 2024):

One column per line
B2
ABCD
1Address
212 Oak Road Leeds LS1 4AB12 Oak RoadLeedsLS1 4AB
Click a cell to see its formula. Change a number or a formula and the sheet recalculates.

In older Excel for Windows, Data > Text to Columns does it: choose Delimited, tick Other, click in its box and press Ctrl+J. The box looks empty, but it now holds the line break.

Remove line breaks with Find and Replace

To clean many cells at once without a formula, in Excel for Windows:

  1. Select the cells and press Ctrl+H.
  2. Click in Find what and press Ctrl+J. Nothing visible appears; the box now holds the line break.
  3. In Replace with, type a space or a comma.
  4. Click Replace All.

On a Mac, use the SUBSTITUTE formula above, then paste its results over the original with Paste Special > Values.

If the cells still look tall afterwards, select the rows and double-click a row border to fit the height again, and turn off Wrap Text if you do not need it.

Frequently Asked Questions

How do I start a new line in an Excel cell?

While typing in the cell, press Alt+Enter on Windows or Control+Option+Return on a Mac (Microsoft 365 for Mac also accepts Option+Return). Enter alone moves to the next cell.

How do I add a line break in an Excel formula?

Join CHAR(10) where the break should go: =A2&CHAR(10)&B2, or =TEXTJOIN(CHAR(10),TRUE,A2:A4) for a range. Turn on Home > Wrap Text for the cell, or the lines show run together.

Why does CHAR(10) not show a new line?

The cell does not have Wrap Text on. Select it and click Home > Wrap Text; the row height then grows to show every line.

How do I remove line breaks in Excel?

=SUBSTITUTE(A2,CHAR(10)," ") replaces each line break with a space. Without a formula, in Excel for Windows: open Find and Replace (Ctrl+H), press Ctrl+J in Find what, type a space in Replace with and click Replace All.

Coddy programming languages illustration

Learn to code with Coddy

GET STARTED