Like ToolFern? Prefer us as your source on Google →

Remove Line Breaks

Strip out unwanted line breaks and join your text back into clean, flowing lines. Replace single breaks with a space, nothing, a comma, or your own custom text, keep your paragraph breaks, and tidy extra spaces.

How to use it

Paste your text into the input.

Now pick what each line break becomes. A space for prose. Nothing at all when the text was split mid-word. A custom string covers the odd job, like joining 40 list items with commas.

Tick Keep paragraphs to preserve genuine paragraph gaps while flattening the breaks inside them, then tick Collapse spaces to clean up the doubles that always turn up afterwards.

Copy the result.

The PDF paste problem

This is why most people are here, and it is worth understanding rather than just fixing.

A PDF does not store paragraphs. It stores the position of every line on the page. When you copy from one, the text arrives with a hard line break at the end of every visual line, because that is genuinely all the structure there is.

Paste that into a document and the text refuses to reflow. Change the font size or the column width and the lines stay exactly where the PDF put them, breaking in places that made sense on the original page and nowhere else.

Removing the breaks restores the paragraph, and the text starts wrapping properly again.

Two things make it messier. Hyphenated words split across lines come through with the hyphen still in them, so informa- and tion become informa- tion when you join with a space. And running heads, page numbers and footnotes get interleaved into the text as their own lines, which no tool can reliably tell apart from real content. Both need a scan by eye afterwards.

Windows and Unix disagree about line endings

Text files do not all mark the end of a line the same way, and it causes real trouble.

Windows uses 2 characters: carriage return then line feed, written \r\n, code points U+000D and U+000A, known as CRLF. Unix, Linux and modern macOS use just 1, the line feed \n, known as LF.

The split goes back to physical teleprinters. Carriage return moved the print head back to the left margin. Line feed rolled the paper up one row. Two mechanical actions, so two characters. Unix decided 1 was enough and dropped the carriage return, Windows kept both, and every text file crossing between them has carried the difference ever since.

You meet it when a file opens in an old editor with all 500 lines run together, or when a diff marks every line changed while nothing visibly differs.

This tool treats both as line breaks, so a mixed file comes out consistent.

When not to remove them

Line breaks matter in some formats, and flattening them destroys meaning rather than tidying it.

Code depends on them. So does anything in Markdown or YAML, where indentation and line structure carry meaning. Addresses, poetry and song lyrics are all meant to break where they break.

The Keep paragraphs option exists for the in-between case. It flattens breaks inside a paragraph while leaving the blank line between paragraphs intact, which is nearly always what you want with prose pulled out of a PDF.

Frequently asked questions

Why does my PDF text have a break on every line?

Because a PDF stores line positions rather than paragraphs. Every visual line ends in a real line break, which is all the structure the file contains.

Should I replace breaks with a space or with nothing?

A space for ordinary prose. Nothing when the text was split mid-word.

Will it keep my paragraphs?

Yes, if you tick Keep paragraphs. Breaks inside a paragraph get flattened and the blank line between paragraphs survives.

What about hyphenated words split across lines?

They come through with the hyphen intact, so joining leaves you with something like “informa- tion”. Those need fixing by eye, since no tool can tell a split word from a genuine hyphen reliably.

Does it handle Windows and Mac line endings?

Yes. Both CRLF and LF are treated as line breaks, so a mixed file comes out consistent.

Why do I get double spaces afterwards?

Because some lines already ended with a space before the break. Tick Collapse spaces and they get cleaned up.

Related: clean up messy text · count the result · find and replace · remove duplicate lines

Found this useful? Share it