Clean up text with broken lines
Text copied from a PDF, an old email, a scanned document or a terminal window often arrives with a newline at the end of every visual line. Pasted into a document, a CMS or a chat, it breaks in the middle of sentences, and fixing it by hand means deleting dozens of breaks one by one. This tool joins the lines for you, keeps the paragraphs you want to keep and tidies up extra spaces and empty lines while it is at it.
Typical uses are quoting a passage from a PDF report, pasting a research paper into a translation tool, turning a list into a single line for a spreadsheet cell or a tag field, and cleaning up a forwarded email before you reply.
The three modes
- Remove all line breaks joins every line into one block of text. Use it for a short quote, a single field or a list you want on one line.
- Keep paragraphs joins the lines inside each paragraph and keeps a blank line between paragraphs. This is the best choice for text from PDFs and emails. Tick Remove empty lines to get one paragraph per line with no gap.
- Remove empty lines only keeps each line as it is and deletes blank lines, for example in code, a list or a log file.
Before and after
This passage was copied from a PDF with two columns:
Most teams now share infor- mation in writing. Short updates work better than long ones. A good update says what changed and what needs a decision.
With Keep paragraphs, the hyphen fix and collapse extra spaces turned on, it becomes:
Most teams now share information in writing. Short updates work better than long ones. A good update says what changed and what needs a decision.
With Remove all line breaks and Comma as the separator, a list like apples, pears and plums on three lines becomes apples, pears, plums.
What the options do
- Collapse extra spaces turns runs of spaces and tabs into a single space. PDFs often add several spaces where columns or justified text used to be.
- Trim lines removes spaces at the start and end of each line, so indented lines join cleanly.
- Fix words split by hyphens joins words that were broken across two lines, like "infor-" and "mation", only when the next line starts with a lowercase letter.
- Remove empty lines skips blank lines instead of turning them into extra separators.
How to use the line break remover
- 1Paste your text into the left box. The clean version appears on the right as you type.
- 2Pick a mode. For PDFs and emails, Keep paragraphs usually gives the best result. Choose what replaces each line break: a space, nothing, a comma or your own separator.
- 3Check the result and the line count, then copy the clean text or download it as a .txt file.
Frequently asked questions
Why does text copied from a PDF have line breaks everywhere?
A PDF stores where each line sits on the page, not where a sentence or paragraph ends. When you copy it, every visual line ends with a newline character, so the text breaks in the middle of sentences when you paste it into an email, a document or a form.
What is the difference between the three modes?
Remove all line breaks turns the whole text into one block. Keep paragraphs joins the lines inside each paragraph but keeps the blank line between paragraphs, which is usually what you want for PDFs. Remove empty lines only keeps every line as it is and deletes the blank ones in between.
How does the hyphen fix work?
When a line ends with a letter and a hyphen and the next line starts with a lowercase letter, the tool treats it as one word split by the layout and joins it, so "infor-" and "mation" become "information". When the next line starts with a capital letter or a digit, as in Jean-Paul or Covid-19, the hyphen stays and only the break is removed. Real compound words split right at their hyphen, like self-aware, lose their hyphen, so read the result once.
Can I replace line breaks with a comma or something else?
Yes. Choose comma to turn a list with one item per line into a comma separated list, nothing to join the lines without a gap, or custom to use any text, such as a semicolon, a pipe or " | ". Type \t in the custom field for a tab.
Is my text uploaded?
No. The text is cleaned up in your browser as you type. Nothing is sent to a server or stored, so you can safely paste emails, contracts or other private text.