HandyBench

Remove Line Breaks

Strip line breaks and join text into one block.

How to use the Remove Line Breaks

  1. 1 Paste the text that has unwanted line breaks.
  2. 2 Choose whether to keep paragraph spacing or join everything.
  3. 3 Copy the cleaned, single-block text.

How the line-break remover joins your text

Everything is normalised first: Windows (\r\n) and old Mac (\r) endings become a plain \n. Then one of two paths runs, depending on the "Keep paragraph breaks" checkbox, which is on by default.

  • Keep paragraph breaks on: the text is split wherever two or more consecutive line breaks occur. Inside each block, every run of line breaks becomes a single space and the block is trimmed. The blocks are then rejoined with one blank line between them.
  • Keep paragraph breaks off: every run of line breaks, blank lines included, becomes one space, so the whole text turns into a single line.

The second checkbox, "Collapse extra spaces", reduces any run of two or more spaces or tabs to one space. Joins always use a space, never nothing, which is correct for English but wrong for languages written without word spaces.

Worked example

Text copied from a PDF with hard wraps and two paragraphs:

The quick brown fox jumps over
the lazy dog and keeps run-
ning across the field.

A second paragraph starts
here.

With paragraphs kept, the result is two lines of flowing text: The quick brown fox jumps over the lazy dog and keeps run- ning across the field. followed by a blank line and A second paragraph starts here. With the option off, all of it becomes one 113-character line with no blank line in between.

Edge cases and limits

  • Hyphenated wraps. The tool does not undo hyphenation, so run- followed by ning becomes run- ning. A quick fix is the Find and Replace tool in regex mode: find (\w)- (\w) and replace with $1$2. Be aware that this also joins genuine compounds such as "well- known".
  • Whitespace-only separator lines. A paragraph gap only counts when the line breaks are consecutive. If the "blank" line actually contains spaces, the text is not split there and the two paragraphs merge. Run the text through the Text Cleaner first if that happens.
  • Lists and addresses. Each item sits on its own line deliberately, so joining them loses the structure. Use this tool for prose, not for lists.
  • Single spaces at line ends. A space already sitting before a break is kept alongside the added one, which is why collapsing spaces is worth leaving on.

To turn a joined block back into one item per line, run it through the find and replace tool and swap the separator for a line break (regex mode accepts \n).

Examples

  • ▸ "The quick brown fox jumps over⏎the lazy dog" → "The quick brown fox jumps over the lazy dog".
  • ▸ Hard-wrapped PDF text with two paragraphs → two flowing paragraphs separated by one blank line.

Frequently asked questions

Why does text copied from a PDF have so many line breaks?

PDFs store each visual line separately, so copying adds a break at the end of every line. This tool merges them back into flowing paragraphs.

Can I keep paragraph breaks but remove single line breaks?

Yes. Leave "Keep paragraph breaks" ticked and single line breaks become spaces while blank-line paragraph separation is preserved. Untick it to join everything into one line.

Does it replace line breaks with a space or with nothing?

Always with a single space. That is right for English text, but a word split across two lines with a hyphen will stay split, for example "run- ning", and text in languages without word spaces will gain unwanted spaces.

What does "Collapse extra spaces" do?

It reduces any run of two or more spaces or tabs to one space after the line breaks are removed. This is useful for PDF text, where a line often ends with a space that would otherwise be doubled up when the next line is joined.

Why did two paragraphs merge into one?

A paragraph gap is detected only when two or more line breaks are consecutive. If the blank line between paragraphs actually holds spaces or tabs, it is not recognised, so run the text through the Text Cleaner first or untick "Keep paragraph breaks" if you want one block anyway.