Skip to content

Remove Line Breaks

Strip the line breaks out of text pasted from a PDF or email so it flows as one block again. Join everything into a single line, keep paragraph breaks while flattening within them, or join lines with a separator of your own.

How Remove Line Breaks works

  1. Paste text with the line breaks you want gone.

  2. Choose to join everything, keep paragraphs, or use a custom separator.

  3. Collapse any repeated spaces left behind.

  4. Copy the result from the output panel.

When to use Remove Line Breaks

  • Flattening a paragraph copied from a PDF where every visual line ended with a hard break instead of wrapping.
  • Turning an email quote that wrapped mid-sentence back into flowing prose you can reuse.
  • Joining a column of values into a single comma-separated line to paste into a form, a query, or a spreadsheet cell.
  • Keeping the blank-line breaks between paragraphs while removing the stray breaks inside each one.
  • Preparing text pasted from any platform, since Windows and old-Mac line endings are all handled the same.
  • Cleaning up the doubled spaces a rough paste leaves behind, in the same pass that removes the breaks.

Examples

Rejoining a hard-wrapped paragraph

Input

The quarterly report is
nearly finished and will
be circulated on Friday.

Output

The quarterly report is nearly finished and will be circulated on Friday.

Join all trims each line, drops the breaks between them, and flattens everything into one block, so the sentence reads continuously again.

Joining a list with a custom separator

Input

apple
banana
cherry

Output

apple, banana, cherry

Custom mode joins each non-empty line with the separator you supply — here a comma and a space, which turns a stacked list into an inline one.

Keeping paragraph breaks intact

Input

First line of intro
continues here.

Second paragraph
also wraps.

Output

First line of intro continues here.

Second paragraph also wraps.

Keep paragraphs flattens the lines inside each block but leaves the blank line between the two paragraphs in place.

How Remove Line Breaks works under the hood

The text is normalised before any joining happens: CRLF pairs and lone carriage returns are converted to plain line feeds, so text from Windows, classic Mac, and Unix sources is treated identically and no stray carriage return survives into the output. From that point the three modes only ever have to reason about a single kind of break.

Join all is the simplest mode — it treats the whole text as one block, trims each line, discards any line that is empty after trimming, and joins the survivors with a single space. Trimming and dropping empties before the join is what stops a rough paste from leaving ragged double spaces or gaps where a blank line used to be. Custom mode does exactly the same but joins with the separator you type instead of a space, so a comma-and-space turns a stacked list into an inline sentence and a pipe or a tab works just as well.

Keep paragraphs first splits the text on blank lines — a line break followed by optional spaces or tabs and another break — into paragraph blocks. Each block is then flattened on its own the same way Join all works, and the flattened blocks are rejoined with a blank line between them. The result is prose that flows within each paragraph while the structure between paragraphs is preserved, which is usually what you want when unwrapping an article rather than a single quote.

Collapse repeated spaces, on by default, runs as a final tidy-up: any run of two or more spaces or tabs left after joining is squeezed to a single space. This catches the case where the source already had double spaces after full stops, or where trimming and joining happened to put two spaces together. Turn it off if the spacing between joined pieces is meaningful, for instance when your custom separator is itself several spaces.

Common mistakes

  • Using Join all when the text has real paragraphs. Join all fuses everything into one line, so paragraph structure is lost; Keep paragraphs is the mode for unwrapping a multi-paragraph article.
  • Forgetting that lines are trimmed before joining. Leading and trailing spaces on each line are removed, so if that spacing was meaningful the result will differ from a naive break removal.
  • Leaving Collapse repeated spaces on when the separator is spaces. If your custom separator is two or more spaces, the collapse step will squeeze it to one; turn collapse off to keep it.
  • Expecting empty lines to become empty separators. Blank lines are dropped before the join, so a gap in the source does not produce an empty field between separators in the output.

Frequently asked questions

All tools

Search NeatKit

Jump to a tool, a page, or change the theme.