Skip to content

Remove line breaks

Paste text from a PDF, an email or a web page. The broken lines join up, your paragraphs stay, and you can check every change before you copy.

Remove line breaks from text

0 characters, 0 lines

Without line breaks

Paste text to remove its line breaks.

Which line breaks stay
Clean up

More mess to fix, like hidden characters or HTML tags? Use the text cleaner. To replace a word with a line break, use find and replace.

Advertisement
Short broken lines of text on the left joined into one long smooth line on the right

Last checked by the TextEditor.com team

How to remove line breaks

Paste your text in the box. The result shows next to it right away. Choose which breaks stay, then press Copy text.

ModeWhat staysUse it for
Keep paragraphsThe empty lines between paragraphs. Each paragraph becomes one line.Most text from a PDF, an email or a web page
Keep paragraphs and listsParagraphs, plus lines that start with a bullet or a number, headings and short lines that end a sentenceReports and articles with lists in them
One lineNothing. All the text ends up on one line.A form field, a spreadsheet cell, a list of names to put together

Press Changes, next to Result, to see what moved. Red marks show the breaks that go, green marks show what took their place. Your text stays in the box, so you can switch modes as often as you like.

Why text from a PDF breaks at the end of every line

A printed page with short lines, each ending in a small return arrow, being pulled off and laid flat as one long line
A PDF keeps where each line sits, so every line ends in a break.

A PDF stores where each line sits on the page, not where a paragraph starts and ends. When you copy, every line comes with a line break at its end. That break was right for the page, but it is wrong in a chat or a document.

The same happens with text from old emails, subtitles and some web pages. Those line breaks are called hard breaks. A normal paragraph has none. Your screen wraps it to fit, which is called a soft wrap.

Hard line breaks against a soft wrap
Copied from a PDF

Printers set each line to fit
the page. When you copy it, the
break at the end of every line
comes with it, so the lines stay
this short or wrap in odd places.

After removing the breaks

Printers set each line to fit the page. When you copy it, the break at the end of every line comes with it, so the lines stay this short or wrap in odd places.

Move the slider. The text on the right wraps to fit any width. The text on the left keeps its breaks, so a narrow column chops it up and a wide one leaves gaps.

How the tool keeps your paragraphs

A paragraph ends with an empty line, which is two line breaks in a row. Keep paragraphs joins the lines inside each paragraph and leaves the empty lines alone. More than one empty line in a row becomes one.

A list has no empty lines between its items, so Keep paragraphs would glue them together. Keep paragraphs and lists checks each line: a break stays before a bullet or a number, after a colon, and after a short line that ends a sentence. This is the same rule the text cleaner uses for text from a PDF.

Which breaks go in each mode
Shopping list for Saturday:
- apples
- bread

The market opens at 8 and closes
at noon, so we should leave
early.

A crossed out ↵ is a break that goes. A green dot is the space that takes its place. Breaks without a mark stay.

Advertisement

Words split with a hyphen at the end of a line

Books and PDFs often split a long word at the end of a line and add a hyphen. When the lines are joined, you get "exam- ple" with a space in the middle. The tool removes the hyphen and the break when the next line starts with a small letter.

End of line, then next lineResultWhy
exam-↵pleexampleSmall letter next, so the hyphen was only there to split the word
E-↵MailE-MailA capital letter next, so the hyphen stays
well-↵knownwellknownThe tool cannot tell a split word from a word that always has a hyphen
well-↵known, with well-known on one line somewhere else in the textwell-knownThe tool found the word with its hyphen in your text, so the hyphen stays
COVID-↵19COVID-19A digit next to the hyphen, so it stays
and/↵orand/orA slash or a long dash right after a word joins without a space
well-↵known, option offwell-knownThe hyphen stays and the halves join without a space

Words like well-known and long-term are the trap. The tool looks for each split word in the rest of your text. If it finds the word with a hyphen and never without one, the hyphen stays. Check the rest in the Changes view, or turn off "Rejoin words split with a hyphen" when your text has many of them.

Line breaks in emails

Plain text emails often break lines at about 72 to 78 characters. The email standard, RFC 5322, says a line must not be longer than 998 characters and should not be longer than 78. Many mail programs still follow the 78 rule when they send plain text.

Replies add a > mark at the start of each quoted line. Remove line breaks keeps those marks. The text cleaner has a "Remove email quote marks" option that takes them out first.

Remove line breaks in Word and Excel

In Microsoft Word, open Replace with Ctrl + H. Type ^p in Find what for a paragraph mark, or ^l for a line break made with Shift + Enter. Type a space in Replace with and press Replace All. This removes every break, paragraphs too, so keep paragraphs with this page instead.

In Excel, a line break in a cell is the character CHAR(10). This formula puts a space in its place:

=SUBSTITUTE(A1, CHAR(10), " ")

You can also open Replace in Excel and press Ctrl + J in the Find what box. That types a line break, which you cannot see.

Windows ends a line with two characters, a carriage return and a line feed (CRLF). Mac and Linux use only the line feed. This page treats both the same, and the old Mac carriage return too.

Which tool do you need?

You want toUse
Join broken lines, keep paragraphs, make one lineThis page
Get the text out of a PDF file firstPDF to text
Fix hidden characters, odd spaces, HTML tags and fancy letters as wellText cleaner
Replace a word with a line break, or add breaks every 80 charactersFind and replace
Put lines in order or remove repeated linesSort lines and remove duplicate lines

Frequently asked questions

How do I remove line breaks but keep paragraphs?

Paste your text and leave the mode on Keep paragraphs. Lines inside a paragraph are joined with a space. The empty lines between paragraphs stay.

How do I turn a list into one line with commas?

Paste the list, pick One line, and choose "a comma and a space" in place of each break. Milk, eggs and bread on three lines become "milk, eggs, bread".

Why are some line breaks still there?

Keep paragraphs keeps the empty lines between paragraphs. Keep paragraphs and lists also keeps the break before each list item and after headings. Pick One line to remove every break.

Does it work with Windows line breaks?

Yes. Windows line breaks (CRLF), Mac and Linux line breaks, and the Unicode line and paragraph separators are all found and removed.

Is my text uploaded?

No. The text is changed in your browser and never leaves your device. The page works offline once it has loaded.

How do I add line breaks back?

Use find and replace. It can put a line break after every sentence, or break long lines at a width you pick.

↑ ↓ to choose, Enter to open, Esc to close