Line Break Remover
Remove line breaks, blank lines or every line containing a word from pasted text. Join everything into one paragraph or keep paragraph spacing. Free, nothing uploaded.
On your device: nothing you enter here is uploaded.
Input
Result
The result appears here as you type.
What this tool is for
Text copied out of a PDF or an email arrives broken every seventy characters. Pasting it into a CMS keeps those breaks and the paragraph looks shredded. This joins the lines back into flowing text, and can keep genuine paragraph breaks while removing the accidental ones.
Four jobs in one tool
Join lines, keep paragraphs: the fix for text copied out of a PDF, an email or a terminal, where every line ends early. Single line breaks become spaces and blank lines between paragraphs survive.
Remove every line break: flattens everything into one block, which is what you want for a meta description, a spreadsheet cell or a JSON string.
Remove blank lines only: keeps each line as it is and deletes the empty ones, including lines that contain nothing but spaces.
Remove lines containing, or keep only lines containing: filters a list or a log by a word. Type "DEBUG" to drop debug output, or "@gmail.com" with the keep mode to pull those addresses out of a list. Matching ignores letter case.
Why text from a PDF breaks in the wrong places
A PDF stores where each line is drawn on the page, not which lines belong to the same paragraph. When you copy, the viewer guesses, and most viewers put a hard line break at the end of every visual line. Hyphenated words split across lines arrive as two halves with a hyphen in the middle, so after joining, search the result for "- " to catch those.
Doing the same in other programs
In Microsoft Word, Find and Replace with ^p replaces paragraph marks, and ^l manual line breaks. In Notepad++, VS Code and most code editors, turn on regular expressions and replace \n with a space. In a terminal, tr '\n' ' ' flattens a file, and grep -v word removes lines containing a word. This page does the same without remembering any of that, and nothing you paste leaves your browser.
How to use it
- Paste the text with unwanted line breaks.
- Choose whether to keep paragraph breaks (blank lines), flatten everything into a single block, or remove only the blank lines.
- To filter, pick "Remove lines containing" or "Keep only lines containing" and type the word.
- Copy the repaired text.
Frequently asked questions
Will it remove the spaces between words?
No. Each removed line break is replaced by a single space, and runs of multiple spaces are collapsed so the text reads normally.
What about Windows line endings?
Both CRLF and LF line endings are handled, so text from Windows, macOS and Linux behaves the same.
Can I remove every line that contains a certain word?
Yes. Choose "Remove lines containing" and type the word or fragment: every line that includes it disappears, regardless of letter case. "Keep only lines containing" does the opposite and leaves just the matching lines.