Remove line breaks
Join wrapped text copied from PDFs or emails locally. Paragraph and hyphen options need review against the original text.
Runs entirely in your browser
Choices reset when text or options change.
Paste text to begin.
Text up to about 5 MB. The result updates as you type; very long text updates a moment after you stop typing.
How to remove line breaks
- Paste your text into the box, or open a .txt file.
- Choose Keep paragraphs to join only the lines inside each paragraph, or Remove all to make one long line. Pick what to put between joined lines.
- Copy the result or download it as a .txt file.
Turning broken lines back into paragraphs
Text copied from PDFs, old emails, terminal windows and some websites often has a hard line break at the end of every visual line. Pasted into a document or a form, it stays broken into short lines that don't reflow. This tool removes those breaks and joins the pieces with a space, so the text flows again.
Keep paragraphs is the right choice for most prose: it keeps the blank lines that separate paragraphs and joins everything else. Remove all puts the whole text on one line, which suits short snippets, list items you want comma-separated, or values going into a single spreadsheet cell.
PDF text sometimes splits words across lines with a hyphen. Turn on Join words split by a hyphen to put them back together, and check the result for real hyphenated words.
Tips
- Need to change other characters too, such as double spaces after full stops or curly quotes? Follow up with Find and replace.
- Count the cleaned text with the Word counter or the Character counter.
- Going the other way, from a list to sorted lines? Use Sort lines alphabetically.
Guide: extracting text from a PDF.
Questions
Why does text copied from a PDF have line breaks everywhere?
A PDF stores where each line sits on the page, not which lines belong to the same paragraph. When you copy text out, most viewers end every line with a line break, so a paragraph arrives as a stack of short lines. Joining the lines inside each paragraph restores normal flowing text.
How does Keep paragraphs know where a paragraph ends?
A blank line (a line that is empty or holds only spaces) marks the end of a paragraph. Lines with text between blank lines are joined into one paragraph, and the result has exactly one blank line between paragraphs. If your text has no blank lines at all, Keep paragraphs gives the same result as Remove all.
What does Join words split by a hyphen do?
When a line ends in a hyphen and the next line starts with a lower-case letter, as in "infor-" and "mation", the two parts are joined without the hyphen. A genuine hyphenated word that happens to break at its hyphen, such as "well-" "known", will lose its hyphen too, so this option is off until you turn it on. Turn on Review each hyphen to keep real hyphens as you join lines.
Can I join lines with a comma instead of a space?
Yes. Choose Custom and type what should go between joined lines, such as a comma and a space to turn a list into one line. Nothing, a space and a custom separator are offered.