Text copied out of a PDF, an email client or a web page is usually correct in substance and broken at the line boundaries: sentences chopped every forty characters, a stack of blank lines between paragraphs, or line endings in the wrong flavour for whatever reads the file next. This tool offers four operations on those boundaries, applied live, entirely inside your browser.
How to use it
- Pick one of the four options at the top — Remove extra line breaks, Remove all line breaks, CRLF → LF, or LF → CRLF. Each carries a one-line description beneath it, and the first is selected by default.
- Paste into the Input box on the left; the Output box mirrors the result and recalculates when you switch options.
- The output box is read-only, so adjust the source text on the left instead. Copy, at the bottom right, takes the result away; Clear, on the left, empties the input box.
When it comes in handy
Rejoining paragraphs that a PDF or email hard-wrapped
Academic papers, statutes and bounce notifications tend to carry a line break every forty-odd characters, which looks ragged the moment you paste it into a document. Remove all line breaks pulls the passage back onto one line so you can insert real paragraph breaks yourself. It is also the necessary first step before feeding text to a translation or summarisation tool, which would otherwise treat each fragment as its own sentence.
Stripping the extra blank lines a paste from Word or Notion leaves behind
Copying between applications often converts paragraph spacing into two or three literal blank lines, and the article ends up looking padded. Remove extra line breaks collapses those runs, keeping the paragraph structure while losing the half-page gaps.
Restoring CRLF before handing a file to a Windows toolchain
Some older Windows programs, batch scripts and spreadsheet importers only recognise \r\n and will render LF-only content as one enormous line. Running LF → CRLF as the final step before you copy saves a round of "the file format is wrong" emails.
Limits and behavior
- What Remove extra line breaks actually does is collapse runs of three or more line-break characters down to two — in other words, two or more consecutive blank lines become a single blank line, while a lone blank line between paragraphs is left alone. The short description under the option states different numbers; the behaviour described here is what the code does.
- The run is detected character by character on line breaks alone, so a line that looks empty but holds a space or a tab interrupts it and that stretch is not collapsed. These phantom blank lines are especially common in text pasted from Word — if the option appears to do nothing, that is usually why. Strip trailing whitespace in your editor first, then come back.
- Remove all line breaks does more than delete breaks: each one becomes a space, then every run of whitespace — tabs and repeated spaces included — is squeezed to a single space, and the result is trimmed at both ends. Code indentation and space-aligned columns are destroyed, so reserve this mode for prose. Rejoined Chinese or Japanese also ends up with a space at every former break, which usually needs a find-and-replace afterwards.
- A browser text box normalises
\r\nto\nthe instant you paste, which means CRLF → LF has almost nothing left to do in this interface — the input has already been converted. The direction that genuinely changes the bytes is LF → CRLF, and the\r\nit produces lives in the output box and in what the copy button writes to your clipboard, though pasting that back into the input box normalises it away again. Run it last. - None of the four modes looks at what a line says: nothing is deduplicated, and nothing tries to guess where a paragraph genuinely ends. There is no file upload, only what you paste in, and the rewriting is done by JavaScript in this tab, so your text is not transmitted — the page itself does load third-party resources such as advertising.
Frequently asked questions
How many blank lines does Remove extra line breaks leave?
One. The rule is that runs of three or more line-break characters become two, and two adjacent breaks are what renders as a single blank line. Whether you started with two consecutive blank lines, five or ten, you end up with one; places that already had exactly one are untouched.
I selected Remove extra line breaks and nothing happened. Why?
Most often because the blank lines are not truly blank and contain a space or a tab. The mode looks for consecutive line-break characters, and a single space between two of them breaks the run. The other possibility is that you only ever had single blank lines, which are meant to survive. For the first case, clear trailing whitespace with a regular-expression replace in your editor and try again.
Why are there spaces between my Chinese characters after joining?
Because each line break is replaced with a space rather than simply deleted. That is essential for English — otherwise the last word of one line fuses with the first word of the next — but unnecessary for Chinese, and the tool cannot reliably tell which script sits at each junction. The practical fix is a find-and-replace afterwards, removing spaces that fall between two Han characters.
CRLF → LF does not seem to do anything.
In this interface it very rarely can. A web text box normalises Windows line endings to LF as the content arrives, so the string the code receives contains no \r\n to convert. To change line endings in an actual file, use your editor's line-ending setting or a command-line tool. As a footnote: everything here happens on your own device, and nothing you paste is uploaded to a server.