Remove Line Breaks Tool

Remove, replace, or clean up line breaks in text in bulk. Useful for fixing text copied from PDFs or Excel where breaks appear mid-word, or for preparing text for CSV cells and single-line logs.

Tips

  • Text copied from PDFs or Excel often has line breaks inserted mid-word due to column width. Enable the insert space option in "Remove all" mode to join everything into one line without merging words together.
  • Multi-line text pasted into a CSV cell can confuse some parsers and break the cell boundaries. Use "Replace with spaces" mode first to convert breaks into spaces before pasting.
  • If a copied blog post or draft ends up with many consecutive blank lines, "Collapse blank lines only" keeps paragraph breaks intact while removing the extra empty lines.
  • When you need a true single-line string (Slack notifications, API parameters, etc.), use "Remove all" mode to strip every line break completely.
  • The converted text appears in a read-only output box, so you can safely hit "Copy" and paste it elsewhere without accidentally editing it first.

Frequently Asked Questions

Use "Remove all (join into one line)" with the "insert a space at each break" option enabled. PDF line breaks often land in the middle of a word, so skipping the space option would merge two words together.

Many CSV parsers handle line breaks correctly inside a quoted cell, but some tools behave unpredictably. Stripping the breaks first with "Replace with spaces" mode guarantees compatibility across systems.

Yes. The tool automatically detects and normalizes both \r\n (Windows) and \n (Unix/Mac) line endings before processing.

Use "Collapse blank lines only". It leaves single line breaks inside a paragraph untouched and only compresses runs of two or more consecutive blank lines down to a single blank line.
ツールくん

Side Note — How mismatched line endings cause invisible bugs

Text files mainly use one of two line-ending conventions: LF (\n) on Unix/Linux/macOS, and CRLF (\r\n) on Windows. Older Mac OS versions (pre-OS X) even used a lone CR (\r). These differences still cause real headaches today, such as a Windows-authored text file gaining stray characters when read on a Linux server.

Most requests for "removing line breaks" trace back to text copied from a PDF or Excel column: what looks like a single flowing sentence on screen was actually saved with hard line breaks at each visual wrap point. The paragraph looks clean until the moment you copy it, at which point a flood of embedded line breaks comes along for the ride.

This tool is the exact inverse of dev.encoding.line_break, which inserts a line break every N characters. That tool exists to wrap a long line for readability; this one exists to undo accidental wrapping and restore text to the single sentence or paragraph it was always meant to be.

→ Browse all trivia