Skip to content

Remove line breaks and unwrap paragraphs

Strip or normalise line breaks, unwrap hard-wrapped paragraphs, tidy extra spaces and switch between LF and CRLF line endings.

  • Runs in your browser
  • Files are never uploaded
  • Free, no account

Typical source: text copied out of a PDF, an email, or a terminal that hard-wraps at 72 characters.

What to do
Join lines with

Joins the hard-wrapped lines inside each paragraph, but keeps the blank line between paragraphs. This is the fix for text copied out of a PDF or an email client.

Line endings in the result

Removes leading and trailing spaces before joining.

Turns runs of spaces or tabs into a single space.

Only used by “Normalise only”.

Lines in
0
Lines out
0
Breaks removed
0
Blank lines removed
0
Cleaned text
Paste text above to strip or tidy its line breaks.

How to remove line breaks from text

  1. Paste the text — typically something copied out of a PDF, an email or a terminal — or drop a file onto the box.
  2. Choose what should happen: unwrap paragraphs, remove every break, or only normalise the line endings.
  3. Pick what the joined lines are separated by: a space (the usual answer), nothing, a comma, a pipe or your own string.
  4. Leave trimming and space-collapsing on to clean up the ragged spacing that hard wrapping leaves behind.
  5. Copy the cleaned text or download it.

Unwrap paragraphs, or remove every break?

This is the choice that matters. Unwrap paragraphs understands that a blank line means “new paragraph” and every other break is just where the original tool ran out of column width. It joins lines within each block and keeps the blank line between blocks, so a three-paragraph letter stays three paragraphs. This is what you want 90% of the time.

Remove every break flattens the entire text onto one line. Use it when you need a single value: a CSV cell, a JSON string, an SQL literal, or a column of values you want as a comma-separated list.

Normalise only touches nothing structural. It converts Windows (CRLF) and classic Mac (CR) endings to Unix ones, limits runs of blank lines to a single one, and strips trailing spaces — the pass you run before committing a file or diffing two documents.

Why PDF text arrives broken

A PDF has no concept of a paragraph. It stores glyphs at coordinates, so when you copy from one, the extractor infers line breaks from vertical positions and inserts a hard newline at the end of every visual line. Paste that into a document with a different column width and you get the familiar stair-step of short lines. The same thing happens with plain-text emails wrapped at 72 characters, terminal output, and text copied from code editors with soft-wrap turned off.

Line-ending reference

Name Escape Bytes Used by
Line feed (LF)\n0AUnix, Linux, macOS, the web, Git
Carriage return + line feed (CRLF)\r\n0D 0AWindows, HTTP headers, SMTP, CSV per RFC 4180
Carriage return (CR)\r0DClassic Mac OS 9 and earlier

Mixed endings inside one file are the usual cause of stray ^M characters in an editor, of a Git diff that shows every line as changed, and of a CSV import that produces one giant row. Running “Normalise only” before you commit or import fixes all three.

Common tasks

  • PDF or email to a document — unwrap paragraphs, join with a space, collapse repeated spaces.
  • Column of values to a CSV row — remove every break, join with a comma.
  • Text into a JSON or SQL string — remove every break, join with a space or with a literal \n.
  • Cleaning a scraped page — normalise, then limit blank lines to one.
  • Fixing a Windows file on Linux — normalise with LF endings selected.

Large files stay smooth, and stay private

Lines are processed in chunks with the browser allowed to repaint between them, so even a very long document is cleaned without the tab freezing. Nothing is uploaded — the file you drop is read by your own browser and stays there.

Questions

How do I keep my paragraphs when removing line breaks?

Use "Unwrap paragraphs". It joins the hard-wrapped lines inside a paragraph but keeps the blank line between paragraphs, which is exactly what text copied out of a PDF or an email client needs.

What is the difference between LF and CRLF?

Unix, macOS and the web use a single line-feed character (LF, \n). Windows tools traditionally use carriage return plus line feed (CRLF, \r\n). Mixing them causes stray ^M characters in editors and doubled lines in some parsers.

Will it remove double spaces too?

If "Collapse repeated spaces" is on, yes — runs of spaces and tabs become a single space, and trailing spaces at the end of each line are removed. Turn it off to keep your original spacing exactly.

Can I join lines with something other than a space?

Yes. Pick a comma, a pipe, nothing at all, or type your own separator — useful for turning a column of values into a comma-separated list you can paste into a query.