Why text arrives full of line breaks
PDFs, plain-text emails, terminal output and some websites store text as fixed-width lines. Copy it into a document or a form and every line ends with a hard break, so sentences are chopped mid-way and nothing reflows.
Two modes
- Keep paragraphs (default): lines inside each paragraph are joined, but blank lines between paragraphs are kept. This is what you want for articles, letters and reports.
- One line: everything is joined into a single line (useful for spreadsheet cells, form fields with no line breaks, or building a single long string).
Choose what goes between joined lines: a space (normal text), nothing (for text split inside words, such as base64 or long URLs), a comma (for lists), or any custom separator. Use \n or \t in a custom separator for a new line or tab.
When the PDF also hyphenated words
If words were split with hyphens at line ends (“compa- ny”), or there are page numbers and running headers between the lines, use the PDF Text Cleaner instead (it rejoins hyphenated words and removes that clutter).
Worked example
Here is what the Remove Line Breaks returns for its built-in example. Settings used: Paragraphs: Keep paragraphs; Join lines with: Space. Click Try an example in the tool above to load it, then change it as you like.
This paragraph was copied
from a PDF, so every line
ends with a hard break.
The second paragraph
is separated by a blank line.This paragraph was copied from a PDF, so every line ends with a hard break.
The second paragraph is separated by a blank line.Questions
How do I remove line breaks but keep paragraphs?
Choose “Keep paragraphs”. Single line breaks are replaced with spaces; blank lines between paragraphs stay.
Does this remove Windows carriage returns (\r\n)?
Yes. Windows (CRLF), old Mac (CR) and Unix (LF) line endings are all recognised.
Last reviewed · How Textkiln tools work