Remove Line Breaks: The Right Answer Depends on the Language
Copy a sentence out of a PDF and it arrives broken in the wrong places. There are two ways to remove those breaks, and Korean and Japanese need different ones. Using "remove all" on Korean glues the words together.
Text copied from a PDF, a paper or an email comes back broken at points where no break belongs. The line endings you saw on screen were not structure — they were the width of the page, and the characters holding them there come along with the copy.
This tool clears those breaks out. How it should clear them depends on what language the text is written in.
"Replace with space" versus "remove all"
English and Korean separate words with spaces. A line break falls where a space belongs, so the break has to become a space. Deleting it outright runs the words on either side together.
Japanese and Chinese work the other way. They do not put spaces between words, so replacing a break with a space inserts a gap the writing system never had and the result reads oddly. Those languages want "remove all".
So: English and Korean documents take "replace with space", Japanese and Chinese documents take "remove all". For a mixed document, use "replace with space" and fix the few awkward joins by hand.
The five modes
| Mode | What it does | When to use it |
|---|---|---|
| Replace with space | Turns each break into one space, joining everything | English or Korean copied from a PDF |
| Remove all | Deletes breaks, joining text directly | Japanese or Chinese text; codes and values that must run together |
| Remove empty lines | Drops blank lines, keeps the rest of the breaks | Lists that arrived double-spaced |
| Collapse blank lines | Reduces runs of blank lines to one | Keeping paragraph structure while tidying spacing |
| Trim each line | Strips leading and trailing spaces per line | Lists with inconsistent indentation |
Windows and Mac break lines differently
The character that ends a line differs by operating system. Windows uses two — a carriage return followed by a line feed — while macOS and Linux use one. Nothing distinguishes them on screen, but they diverge as soon as you count characters or feed the text into another program.
This tool normalises them before doing anything else, so a file written on Windows and one written on a Mac produce the same result. If a text editor has ever reported a line count you did not expect, or shown a stray symbol at the end of every line, this is usually why.
Where the stray breaks come from
- •PDFs and papers — breaks inserted to fit the page width, stored as real characters.
- •Quoted email — replies typically wrap the quoted section at a fixed width.
- •Word and other office documents — copying from inside a table or text box breaks at every cell.
- •Terminal output — copied already wrapped to the window width.
- •Web pages — the source HTML's indentation sometimes comes along with the copy.
Extended FAQ
My Korean text came out with all the words stuck together.
You used "remove all". Korean separates its chunks with spaces, so it needs "replace with space". "Remove all" is for Japanese and Chinese, which have no spaces to preserve.
I want to keep my paragraphs.
Use "collapse blank lines". It tidies runs of blank lines down to one while leaving the paragraph structure intact. "Replace with space" and "remove all" both flatten everything into a single line.
There are still spaces at the ends of lines.
Add "trim each line", or follow up with the extra-spaces tool. One exception: in Markdown, two trailing spaces mean a line break, so leave them alone in Markdown source.
The character count changed more than I expected.
Line breaks are characters too. In a file written on Windows each break is two of them, so the more lines there were, the bigger the difference.
Is my text stored anywhere?
No. Everything runs in your browser and nothing is sent to a server.
