Remove line breaks — turn broken lines into one line or clean paragraphs

Paste text that is broken across many lines and get it back as one continuous line, as tidy paragraphs, or joined with no gap at all.

Live demo · real result from this tool
Mode

Result

This paragraph was copied from a PDF, so every line ends early. This is a second paragraph.

Processed on your device — nothing is uploaded.

How to use Remove Line Breaks

  1. Paste your text into Your text. The sample is a paragraph copied from a PDF, with breaks in the middle of sentences.
  2. Choose a Mode: Replace with spaces, Keep paragraph breaks or Join with nothing.
  3. Copy the result.

What it does and when to use it

Text often arrives with line breaks in the wrong places. PDFs break a line wherever the page edge was. Plain-text emails wrap at a fixed width. Terminal output and copied subtitles put every phrase on its own line. Pasted into a document, a form or a social post, that text looks broken.

Each mode fixes a different case:

  • Replace with spaces makes one line from everything, including separate paragraphs. Good for single-line fields: a product title, an alt text, a CSV cell, a search box.
  • Keep paragraph breaks joins the lines inside each paragraph but keeps one blank line between paragraphs. Good for articles, letters and notes copied from a PDF.
  • Join with nothing deletes the breaks without adding anything. Good for a long URL, an API key or encoded data that was wrapped by an email program.

If your text came from a PDF with hyphenated line ends, the Text Unwrapper can also re-join split words. To go the other way and break long lines at a set width, use the Text Wrapper. If you only want to delete the empty lines and keep the rest, use Remove Empty Lines.

How it works

  • Replace with spaces finds each group of one or more line breaks, together with any spaces or tabs on either side, and replaces the whole group with a single space. Then it trims the start and end of the text.
  • Keep paragraph breaks splits the text into paragraphs at blank lines (a line with only spaces counts as blank). Inside each paragraph, every line break and its surrounding spaces become one space. Paragraphs are joined again with one blank line between them.
  • Join with nothing removes every line break character and nothing else.

All three run in your browser.

Worked examples

The first two examples use a five-line passage from a PDF: “This sentence was / broken by a PDF / reader.”, a blank line, then “New para- / graph here.”

Replace with spaces. Everything becomes one line: This sentence was broken by a PDF reader. New para- graph here. The blank line between paragraphs is gone too.

Keep paragraph breaks. The result is two paragraphs, “This sentence was broken by a PDF reader.” and “New para- graph here.”, with one blank line between them. The hyphen stays because this tool does not re-join split words.

Join with nothing. A key copied as “ABC12”, “DEF34” and “GH” on three lines becomes ABC12DEF34GH.

Limits and tips

  • Bullet points and numbered lists are joined like any other lines; their markers stay in the text.
  • Check a long single line with the Character Counter if it must fit a limit.

Frequently asked questions

Which mode should I pick?
Replace with spaces for a single line, such as a meta description or a spreadsheet cell. Keep paragraph breaks for articles and emails. Join with nothing for things that were split but never had spaces, such as a licence key, a long link or a block of base64.
Does it handle Windows line endings?
Yes. Windows (CR LF), Unix (LF) and old Mac (CR) line endings are all treated as line breaks in every mode.
Why does "para- graph" keep its hyphen?
This tool does not guess whether a hyphen at the end of a line split a word. The Text Unwrapper has an option that re-joins such words, so use it for PDF text with hyphenated line ends.
Are double spaces cleaned up?
In Replace with spaces mode, spaces and tabs around each line break are merged into one space and the ends are trimmed. Spaces inside a line are not changed. Join with nothing removes only the breaks and leaves every other character as it was.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close