Remove Line Breaks

Strip or replace line breaks and extra whitespace in text. Free, instant, private.

📝 Text Tools Free Browser-based
Tool
0
Characters before
0
Characters after
0
Removed

What Causes Unwanted Line Breaks?

Line breaks appear in the wrong place for several distinct reasons, each requiring the same fix — removing them before re-using the text elsewhere:

  • PDF copy-paste — PDFs store text as printed lines, not paragraphs. Each line ends with a hard return at the column width of the original page. When you copy from a PDF, every line break comes along, breaking words mid-sentence.
  • Email clients — Older email standards (RFC 2822) require lines to be at most 998 characters and recommend wrapping at 76–80 characters. Plain-text emails arrive with line breaks at every 76th character, turning one paragraph into dozens of short lines.
  • Chat and messaging exports — WhatsApp, Slack, Teams and Discord exports write one message per line. A conversation exported as a transcript fragments the content at every reply.
  • Word processors — Copying from Google Docs or Microsoft Word into a plain-text field sometimes carries soft returns that are invisible in the source but appear as hard breaks when pasted.
  • Code output / terminal — Command-line tools often print one item per line. To reuse those values in SQL, code or a spreadsheet you need to collapse them to a comma-separated list.

Common Use Cases

ScenarioWhat to Set
Clean up a copied PDF paragraphKeep paragraphs ON, replace with space
Convert a list to SQL IN() valuesKeep paragraphs OFF, replace with ,
Paste clean text into a form fieldKeep paragraphs ON, collapse spaces ON
Join lines with no separatorKeep paragraphs OFF, replace with nothing
Convert line-separated data to pipe-delimitedKeep paragraphs OFF, replace with |

Options Reference

OptionWhat it does
Keep paragraph breaksRemoves only single newlines; double newlines (paragraph gaps) are preserved as paragraph separators
Collapse multiple spacesMerges two or more consecutive spaces, including tabs, into a single space
Trim each lineStrips leading and trailing spaces from every line before processing — removes padding from PDF columns
Replace breaks withSubstitute removed breaks with any string — space, comma, pipe, or leave empty to join with no separator
'Does it handle tabs and multiple spaces?', 'a' => 'Yes. Enable Collapse multiple spaces to merge tabs, multiple spaces and other repeated whitespace into a single space. Useful when PDF copy-paste also adds column-alignment spaces between words.'], ['q' => 'How do I convert a list of items into a SQL IN() clause?', 'a' => 'Paste your list, uncheck Keep paragraph breaks, and set Replace line breaks with to ", " (comma space). The result is a comma-separated string you can paste directly inside SQL IN().'], ]" />