Line break or paragraph break: know which one you have
Most apps use two kinds of break. A paragraph break starts when you press Enter. A manual line break (Shift + Enter in Word) moves to the next line but stays in the same paragraph. They need different codes in Find and Replace, so check which one you have by turning on the show/hide marks button (the ¶ symbol in Word).
Text copied from a PDF usually has a break at the end of every line, even in the middle of a sentence. If real paragraphs are separated by a blank line, protect them first (see the tip in the Word section).
Remove line breaks in Microsoft Word
- Press Ctrl + H to open Find and Replace.
- Click in Find what, choose More, then Special, and pick Paragraph Mark (it appears as ^p). For Shift + Enter breaks, pick Manual Line Break (^l).
- Type a single space in Replace with.
- Click Replace All.
- Tip: if you want to keep real paragraphs, first replace ^p^p with a rare marker such as ##, run the step above, then replace ## with ^p.
Remove line breaks in Google Docs
Google Docs has no single button for this, but Find and Replace supports regular expressions.
- Press Ctrl + H (Cmd + Shift + H on Mac).
- Tick Match using regular expressions.
- In Find, type \n and in Replace with, type a single space.
- Click Replace all. Docs treats every paragraph break as \n, so all breaks become spaces.
Remove line breaks in Excel and Google Sheets
Line breaks inside a cell (made with Alt + Enter) are character number 10. Use a helper column with this formula, then copy and paste the result as values:
=SUBSTITUTE(A2,CHAR(10)," ")
To strip breaks without adding a space, replace the space inside the quotes with nothing. The same formula works in Google Sheets. In Excel you can also press Ctrl + H, click in Find what, press Ctrl + J (it looks empty) and put a space in Replace with.
Remove line breaks in Notepad++ or a code editor
- Press Ctrl + H and set Search Mode to Extended (or Regular expression).
- Find \r\n (or \n on Unix files) and replace with a space.
- Click Replace All. Windows Notepad cannot do this, so use Word or Notepad++.
Remove blank lines online in one click
If your problem is extra empty lines rather than breaks inside sentences, the Text Cleaner on this site does it directly. Paste the text, switch on Remove empty lines and Trim each line, and copy the result. It runs in your browser, so the text is not uploaded. It does not join lines into one paragraph, so use the Word, Docs or Excel steps above for that.
Final words
Removing line breaks always means replacing the break character with a space: ^p in Word, \n in Google Docs, CHAR(10) in Excel and Sheets. Pick the app you are using, run Replace All, and check that words did not stick together. For blank lines only, paste your text into the Text Cleaner.
Frequently asked questions
How do I remove line breaks from copied text?
Paste it into Word or Google Docs and replace the paragraph mark (^p in Word, \n with regular expressions in Docs) with a single space. Replace All fixes the whole text at once.
How do I remove line breaks in an Excel cell?
Use =SUBSTITUTE(A2,CHAR(10)," ") in another cell, or press Ctrl + H, press Ctrl + J in the Find box and enter a space in Replace with.
What is the difference between ^p and ^l in Word?
^p is a paragraph mark made by Enter. ^l is a manual line break made by Shift + Enter. Replace the one you see when formatting marks are on.
How do I keep paragraphs but remove the other line breaks?
Replace double breaks with a temporary marker, replace the single breaks with spaces, then turn the marker back into a paragraph break.
Can I remove empty lines online without installing anything?
Yes. Paste the text into the Text Cleaner, turn on Remove empty lines and copy the result. It works in your phone or computer browser.