Remove Line Breaks From Text (Word, Excel, Google Docs)
Quick answer: To remove line breaks from text, replace each break with a space. In Word, press Ctrl+H, find ^p and replace it with one space. In Excel, use =SUBSTITUTE(A2,CHAR(10)," "). In Google Docs, tick Match using regular expressions and replace \n with a space. Or paste the text into a paragraph to single line converter.
Why copied text has line breaks in the middle of sentences
Copy a paragraph from a PDF or a plain-text email, paste it somewhere else, and you often get a line break at the end of every visual line instead of only at the end of each paragraph. The words are fine. The breaks are the problem: they chop sentences into short lines that will not reflow when you change the page width or the font.
The fix is to swap each break for a space. First, work out which kind of break you have, because each program names them differently:
- Word paragraph mark. Made by pressing Enter. Word’s search code is
^p. - Word manual line break. Made by pressing Shift+Enter. The code is
^l. - Excel line break inside a cell. A line feed character, written
CHAR(10)in a formula. - Google Docs. Its regular expression search uses
\nfor a line break.

Remove line breaks from text in Word
Word’s Find and Replace box accepts special codes. Microsoft’s table of special characters gives ^p for a paragraph mark and ^l for a manual line break.
- Select the text you want to fix.
- Press Ctrl+H to open the Replace tab.
- In Find what, type
^p. In Replace with, type a single space. - Click Replace All.
If the breaks came from Shift+Enter, search for ^l instead. Microsoft also notes that ^p does not work in the Find what box when Use wildcards is switched on, so leave that box unticked.
This turns every paragraph into one block, including the real ones. To keep genuine paragraphs, assuming a blank line separates them, run three Replace All passes in this order:
- Find
^p^pand replace it with a marker that is not in your text, such as##. - Find
^pand replace it with one space. - Find
##and replace it with^p^p.
Remove line breaks in Excel
A line break inside a cell is a line feed, CHAR(10). The cleanest formula swaps it for a space so the words on either side stay apart:
=SUBSTITUTE(A2,CHAR(10)," ")
- Type the formula in an empty column beside your data and press Enter.
- Drag the fill handle down to cover the other rows.
- Copy the results and paste them over the originals as values, then delete the helper column.
Wrap the formula in TRIM if you also want stray double spaces tidied up. There is a shorter option too. Microsoft’s CLEAN documentation shows =CLEAN(A2) removing CHAR(10) and CHAR(9) from a string. The catch is that CLEAN removes the character and puts nothing in its place, so a break between two words will glue them together. It also skips a few nonprinting Unicode characters, so use SUBSTITUTE when the breaks sit between words.
Remove line breaks in Google Docs
Docs works differently: its Find and replace box can search with regular expressions. Google’s find and replace help describes the option as “Match using regular expressions”.
- Click Edit, then Find and replace.
- Tick Match using regular expressions.
- In Find, type
\n. In Replace with, type one space. - Click Replace all.
Google says anything you type in the Replace with box is inserted as literal text, which suits this job because the replacement is only a space. Every break it finds is replaced, including the ones between real paragraphs. Check the result when you finish. If nothing changed, or the layout looks wrong, paste the text into the online tool below instead.
Remove line breaks from text online
When the text comes from a PDF or an email and you have not opened it in any program yet, a browser tool is the shortest route. The Paragraph to Single Line Converter works in four steps:
- Paste your text, or open a .txt file.
- Choose what joins the lines. The default is a space.
- Pick the output: plain text, a JSON string or a CSV cell.
- Copy the result or download it as a .txt file.
The options go beyond a plain join:
- Join lines with a space, nothing, a comma, a comma and space, a semicolon, a pipe, a tab or text of your own.
- Keep paragraph breaks joins the lines inside each paragraph and leaves one blank line between paragraphs.
- Join words split by a hyphen rejoins “inter-” and “national” into “international” when a line ends with a hyphen.
- Collapse repeated spaces, Trim every line and Remove duplicate lines clean up what is left.
Counters show the characters, words, lines in, lines out and breaks removed, so you can see the change at once. The tool reads Windows, Unix and old Mac line endings, is free, has no character limit and runs in your browser. Its page lists a few limits. Without blank lines it cannot tell a wrapped line from a deliberate one. Hyphen joining can wrongly merge real hyphenated words such as “well-known”. Joining with nothing glues words together, so save that for codes and IDs.
Which method fits your situation
| Your situation | Best method |
|---|---|
| Text copied from a PDF or email, no program open yet | Online tool with Keep paragraph breaks |
| Text already in a Word file | Ctrl+H, find ^p, replace with a space |
| Hundreds of cells with line breaks | SUBSTITUTE with CHAR(10) in a helper column |
| Text in a Google Docs file | Find and replace with regular expressions |
| A list that must become a comma-separated line | Online tool, Join lines with a comma |
| A value for code or a spreadsheet import | Online tool, output as a JSON string or CSV cell |
Fixing the usual side effects
- Words run together. You replaced the break with nothing. Run it again with a space.
- Double spaces. The original lines already ended in a space. Use the tool’s Collapse repeated spaces option, or in Word replace two spaces with one.
- Paragraphs merged into one block. Use Keep paragraph breaks in the tool, or the three-pass marker method in Word.
- Odd invisible characters. Collapse and Trim do not remove zero-width spaces. The remove text formatting tool has an option for them.
- All capitals after the join. If the PDF text arrived in capitals, run it through the sentence case tool afterward.
If the copied text is the only thing standing between you and a clean paragraph, the Paragraph to Single Line Converter joins the lines in one click and keeps your original in the input box. Paste, pick the separator, and copy.
Frequently asked questions
How do I remove line breaks from text without losing paragraphs?
In the online tool, tick Keep paragraph breaks. In Word, replace ^p^p with a marker, replace ^p with a space, then swap the marker back to ^p^p. This only works when a blank line separates your real paragraphs.
What is the difference between ^p and ^l in Word?
The code ^p finds a paragraph mark, the break you make with Enter. The code ^l finds a manual line break, the one you make with Shift+Enter. Search for whichever your text contains.
Does the CLEAN function remove line breaks in Excel?
Yes. Microsoft’s example shows CLEAN removing CHAR(10) from a string. It leaves no space behind, so words around the break can join. SUBSTITUTE with CHAR(10) and a space avoids that.
Is it safe to paste private text into an online line break remover?
The Paragraph to Single Line Converter says it runs in your browser and does not upload or store your text. If the text is truly sensitive, the Word and Excel methods above stay on your own device.