Excel Find and Replace New Line Character in Cells

How-to basics · Updated November 3, 2026

Excel Find and Replace New Line Character in Cells

To find a line break in Excel for Microsoft 365 on Windows, press Ctrl+H, click the Find what box, and press Ctrl+J; the box may look blank. Enter the replacement in Replace with, then choose Replace All or replace matches one at a time. This searches for the line-feed character commonly used for a new line inside an Excel cell.

What a new line character means in Excel

A line break inside a cell is different from moving to the next worksheet row. It lets a cell display multiple lines while keeping its contents in one cell. For example, a cell might contain a person’s name on the first line and an address on the second. Excel commonly stores this in-cell break as a line-feed character, represented in formulas by CHAR(10).

On Windows, pressing Alt+Enter while editing a cell inserts a line break. The text may then appear on separate lines if Wrap Text is enabled or the row is tall enough. The break remains part of the cell’s text whether or not it is currently visible. Imported text may also contain line breaks copied from another program or downloaded from a website.

That distinction matters when searching: Ctrl+J in the Find what field stands for a control character, not the visible letters C-H-A-R or a blank space. A line break can therefore be present even when the cell looks like ordinary text in the formula bar or when the Find what box seems empty.

Find and replace line breaks step by step

  1. Select the cells you want to clean, or leave the sheet unselected to search the current worksheet.
  2. Press Ctrl+H to open Find and Replace. You can also open the Home tab, choose Find & Select, and select Replace.
  3. Click Find what, then press Ctrl+J. Do not type a space or the text CHAR(10); the key combination enters the line-feed character.
  4. Click Replace with. Type a space if the words on either side should remain separate, or leave this box empty if you intentionally want to remove the break without inserting anything.
  5. Choose Find Next to inspect a match, Replace to change it, or Replace All to change every match in the selected scope.

For instance, if a cell contains “North” followed by a line break and then “Office,” replacing the break with one space produces “North Office.” Replacing it with nothing produces “NorthOffice,” which may not be what you intend. If Excel reports that it found no matches, first confirm that the cursor was in the Find what box when you pressed Ctrl+J and that the selected cells actually contain an in-cell break.

Choose the right replacement and search scope

Use a space when a break separates words, address parts, labels, or sentences that should read continuously. Use an empty replacement when a break separates pieces that are meant to join, such as a word split across lines during copying. Consider the result before applying Replace All: a break between a street name and an apartment number may need a space, while a line break inserted within a product code may need no separator.

Excel’s Find and Replace dialog can search the current selection or a broader area, depending on what is selected and the dialog’s Within setting. Check that setting before a bulk change. If the dialog offers the option, choose Sheet to limit the operation to the current worksheet or Workbook to search across sheets. The Look in setting also matters: a search set to formulas may behave differently from one set to values. For ordinary text cleanup, check the available options and use the setting that searches cell values.

When you are unsure whether every match should change, use Find Next and Replace on a few examples first. If the results are correct, repeat the operation with Replace All. You can also duplicate the worksheet or save a copy of the workbook before a large cleanup; replacing line breaks can change many cells at once, and undo may be inconvenient after other edits.

When a formula is a better choice

Find and Replace is convenient for a one-time edit. A formula is useful when you want to keep the original data unchanged, clean a repeatable import, or inspect the transformed result before replacing source values. With the original text in A2, enter this formula in B2:

With the original text in A2, =SUBSTITUTE(A2,CHAR(10)," ") replaces each line-feed character with a space. If A2 contains North, a line break, and Office, the result is North Office.

Fill the formula down for the remaining rows. To make the cleaned text permanent, copy the formula results and use Paste Special > Values in the destination cells. This replaces formulas with their displayed text while leaving the source column available until you choose to remove it.

To remove line breaks rather than replace them with spaces, use an empty text argument. With the original text in A2, =SUBSTITUTE(A2,CHAR(10),"") removes line-feed characters. This can join words together, so review sample results before using it for an entire column.

Repeated breaks can leave repeated spaces after substitution. With the original text in A2, =TRIM(SUBSTITUTE(A2,CHAR(10)," ")) replaces line feeds with spaces and removes extra ordinary spaces at the beginning and end, as well as reducing repeated ordinary spaces between words to one. TRIM does not remove every unusual whitespace character, such as a nonbreaking space copied from some web pages.

Carriage returns and other imported text

Not every source represents a line ending in exactly the same way. A line-feed character is CHAR(10); a carriage return is CHAR(13). Some imported or copied text can contain carriage returns, line feeds, or both. If Ctrl+J finds nothing, or a formula that targets CHAR(10) leaves a visible break behind, the source may use a carriage return or a combination of characters.

You can test an alternate character in a helper formula. With the source text in A2, =SUBSTITUTE(A2,CHAR(13)," ") replaces carriage returns with spaces. If you want to replace both types, with the source text in A2 use =SUBSTITUTE(SUBSTITUTE(A2,CHAR(13)," "),CHAR(10)," "). The inner substitution handles carriage returns first; the outer one handles line feeds. If you are not sure which character is present, test the formulas on a few rows and compare the outputs before changing the source data.

Do not assume that every visible second line proves a stored line-break character is present. A narrow column can wrap a long string automatically, even though the text has no embedded break. Widen the column or temporarily turn off Wrap Text to help distinguish automatic wrapping from an in-cell line break. If the displayed lines change as the column width changes, they may be wrapping rather than explicit breaks.

Windows, Mac, and Excel for the web

The steps above are for Excel for Microsoft 365 on Windows. In Windows desktop Excel, Ctrl+H opens Replace and Ctrl+J in the Find what box is the standard way to enter a line feed. If keyboard shortcuts are inconvenient, use Home > Find & Select > Replace to open the dialog.

Excel for Mac has a different keyboard layout and some shortcuts vary with the keyboard and macOS settings. Use the Home tab’s Find & Select > Replace command to open the dialog, then try Control+J in the Find what field. If that key combination does not enter the character in your setup, use a formula with CHAR(10) in a helper column instead. That approach avoids relying on an invisible keystroke.

Excel for the web has a more limited interface than desktop Excel, and keyboard handling for control characters can differ. If the Find and Replace dialog does not accept a line break reliably, use the SUBSTITUTE formula in a helper column, then copy and paste the results as values if you need a permanent cleanup. The formula method also makes the transformation visible and easier to review.

Common problems and how to fix them

  • The Find what box looks empty: This is expected after Ctrl+J. The line-feed character is not displayed as a readable symbol.
  • No matches are found: Check that the cursor was in Find what when you pressed Ctrl+J. Check the selected range and search scope, and confirm the content has an embedded break rather than automatic wrapping.
  • Words run together: The replacement was probably empty. Replace the break with a space instead, or use a formula that inserts one.
  • There are double spaces: Several adjacent breaks may each have become a space. Use the TRIM formula shown above for ordinary spaces, or inspect the result before replacing the original data.
  • Some breaks remain: The content may include CHAR(13), a different whitespace character, or automatic wrapping. Test the alternative formula and check the column width.
  • Only some cells changed: Review whether a selection limited the search, and check whether the dialog was set to search the sheet or workbook.

Frequently Asked Questions

What character does Ctrl+J find in Excel?
In the Find what field in Windows desktop Excel, Ctrl+J enters a line-feed control character, commonly represented by CHAR(10). The field may look blank even though the character is there.

How do I replace a line break with a space in Excel?
Open Replace with Ctrl+H, put Ctrl+J in Find what, type one space in Replace with, and choose Replace All. Check the selected range and scope before changing a large amount of data.

How do I remove a line break without replacing it?
Leave Replace with empty and replace the Ctrl+J match. This removes the break but can join adjacent words. A formula alternative, with source text in A2, is =SUBSTITUTE(A2,CHAR(10),"").

Why does Excel wrap text but Find and Replace finds no line break?
Excel may be wrapping a long cell value because the column is narrow. Automatic wrapping is a display effect, not necessarily a character in the text. Widen the column or turn off Wrap Text to check.

Can I use CHAR(10) in Find and Replace?
CHAR(10) is formula syntax, so typing those characters into Find what searches for the literal text CHAR(10), not a line break. Use Ctrl+J in the Windows desktop dialog, or use CHAR(10) inside a formula such as SUBSTITUTE.

Will replacing a line break split the cell into separate rows?
No. Find and Replace changes the contents inside cells; it does not split a cell into worksheet rows or columns. To restructure data, use an appropriate text-splitting workflow rather than replacing the break alone.

Related

Try it: the Date Difference Calculator: days, months, years and weekdays between two dates, with the DATEDIF formulas.

More in How-to basics

Sources: Function behaviour and menu paths: Microsoft Support documentation for Excel. Method & sources

Spotted an error in this guide? Let us know.