Skip to content
Reembun
Remove line breaks icon
Text

Remove line breaks

Strip unwanted line breaks from pasted text while keeping paragraph breaks, and tidy up the extra spaces and smart quotes that come with them.


Ready. Runs locally on your device.

Your files stay on your device. The tool works directly in your browser, using your device to process your files. Nothing is sent to our servers, and we never receive, store, or see your files or figures.

Share

Share this page

Share result

Your results

Use the tool above first. Whatever it works out shows up here, ready to copy or share.

Cite

Cite this page

Reembun. (2026, July 28). Remove line breaks. https://reembun.com/remove-line-breaks
Pick a style, then copy the reference. The access date is today.

How to use it

  1. Paste the broken up text

    Usually something copied out of a PDF, an email client or a terminal, where every line ends where the column ended.

  2. Keep your paragraphs

    Remove line breaks is already on. Keep paragraph breaks protects the blank lines between paragraphs, so you do not end up with one solid block.

  3. Clean up what is left

    Collapse repeated spaces, trim each line, remove empty lines and remove duplicate lines deal with the debris the reflow leaves behind.

  4. Copy or run it again

    Copy result takes the cleaned text. Replace the input with the cleaned result if you want a second pass with different options.

The problem

Text copied from a PDF, an email client or a hard-wrapped plain text file arrives with a line break at the end of every visual line rather than at the end of every paragraph. Pasted into anything that reflows, it looks broken.

This is a sentence that was
hard wrapped at seventy
characters and now looks
like this when pasted.

What “keep paragraph breaks” does

The tool distinguishes two kinds of break:

  • A single line break is treated as wrapping and removed
  • A blank line is treated as a paragraph boundary and kept

That convention holds for almost all copied text. The result keeps its structure while losing its accidental wrapping:

This is a sentence that was hard wrapped at seventy characters and now reads normally.

This is the next paragraph, still separate.

Turning the option off joins everything into a single block, which is what you want for a field that must hold one line.

The other cleanups

Collapse repeated spaces. Double spaces after full stops, and the runs left behind after removing breaks.

Trim each line. Leading and trailing whitespace, which is invisible and breaks exact-match comparisons.

Remove empty lines. Useful after other operations have left gaps.

Remove duplicate lines. For deduplicating a pasted list.

Straighten smart quotes. Converts typographic punctuation back to ASCII:

TypographicASCII
Curly single quotes'
Curly double quotes"
En and em dashes-
Ellipsis character...
Non-breaking spaceRegular space

This is the fix for a surprising range of problems: code that will not compile after being pasted through a document, CSV columns that will not parse, and search queries that return nothing because the apostrophe is not the apostrophe.

Strip HTML tags. Removes markup while keeping the text between it.

Where the breaks came from

PDFs store positioned glyphs, not paragraphs. Line structure is visual only.

Plain-text email was traditionally hard-wrapped at 72 or 78 characters, a convention from terminal-era mail clients that persists in mailing lists.

Code editors with a fixed ruler wrap comments and documentation at a column.

Spreadsheets insert breaks inside cells, which then travel with the copied text.

Order of operations

The cleanups apply in a fixed order: strip HTML, straighten punctuation, remove line breaks, then trim, collapse, deduplicate and sort. That ordering matters, since collapsing spaces before joining lines would leave double spaces where breaks used to be.

Common questions

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

Because a PDF stores positioned text rather than flowing paragraphs. Each visual line is a separate object, and copying inserts a break at the end of each. The paragraph structure was never in the file to begin with, which is why it has to be reconstructed on the way out.

How does it know which breaks to keep?

It treats a blank line as a paragraph break and a single line break as an accident of wrapping. That is the convention in almost all copied text, and it means a document keeps its paragraphs while losing its hard wrapping.

What are smart quotes and why straighten them?

Word processors replace straight quotes with typographic ones. They look better in print and break code, CSV files, URL parameters and search queries. The straightening option converts curly quotes, en and em dashes and ellipses back to plain ASCII.

Is my text uploaded?

No. Everything runs in this tab. Nothing is sent anywhere, which matters given that most text arriving here is a draft, a client document or something copied out of an internal system.

Last reviewed