Skip to content
Esc

Remove line breaks

Text never leaves this browser

Paste text or drop a file to remove line breaks — the mid-sentence wraps that email and PDFs leave behind — or to tidy whitespace and drop duplicate lines. The preview updates as you type. The work runs in this tab, so the text is never uploaded.

Clean
Join lines with

How to use it

  1. Paste text, drop a .txt (or .md, .csv, .json, .log) file, or try the sample.
  2. Choose what to clean: line breaks (join wrapped lines, optionally keeping paragraph breaks), whitespace (squeeze or strip spaces and tabs, and collapse blank lines), or duplicate lines (consecutive only, or anywhere in the file).
  3. Check the before and after counts, then copy the result or download it as a .txt file.

Details

Line breaks
A single newline is treated as a wrap. With Keep paragraph breaks on, a blank line still separates paragraphs. You can join with a space or with nothing, and trim each line first
Whitespace
Squeeze collapses runs of spaces and tabs to one space, and leaves newlines alone. You can also strip all spaces and tabs, or strip every whitespace character including newlines
Duplicate lines
Anywhere keeps the first copy of a line and drops later repeats, in the original order. Consecutive only collapses runs of the same line. Optional ignore-case and ignore-surrounding-spaces flags change how two lines are compared, not how the kept line is written
Limits
Up to 5 MB at a time. Carriage returns and Unicode line and paragraph separators are read as ordinary newlines

Questions

Are my files uploaded?

No. The page loads its code once, then reads and processes your files inside the browser tab. Nothing is sent to a server; you can confirm it in your browser's network panel while a file is processed.

What does remove line breaks actually change?

It joins lines that were wrapped in the middle of a sentence, which is common in email, PDFs and copied terminal output. By default, a blank line is kept as a paragraph break, each line is trimmed, and the join is a single space. Turn off Keep paragraph breaks if you want the whole file as one block.

How is this different from the word or character counter?

Those pages count the text you paste. This page changes it: it unwraps lines, tidies spaces or drops duplicate lines, then shows a live result you can copy or download.

Will Remove all whitespace delete my line breaks too?

Yes. That option strips every whitespace character, including newlines and tabs, and leaves a single run of letters and punctuation. Use Squeeze or Remove them (spaces and tabs only) if you want to keep the line structure.

Does duplicate-line mode keep the first copy?

Yes. Anywhere in the file keeps the first time a line appears and drops later copies, in the original order. Consecutive only collapses a run of identical lines into one. The kept line is the original text, even if you ignored case or surrounding spaces when comparing.

Is there an API?

Yes. The MCP server on this site has a remove_line_breaks tool with the same three modes. There is no separate HTTP API.