Remove Line Breaks
Tells apart PDF-style hard-wrapped lines from genuine paragraph breaks, and strips only the former.
Text copied out of a PDF almost always arrives full of unwanted line breaks in the middle of sentences — the PDF viewer inserted a line break wherever the original document happened to wrap a line visually, and that break gets copied along with the text even though it isn't a real paragraph boundary. This tool removes exactly those unwanted mid-sentence breaks while leaving genuine paragraph breaks (blank-line-separated blocks) intact.
The cleaned-up text appears here as you paste.
How it tells a PDF line wrap from a real paragraph break
The core signal: a single line break followed immediately by another line of text (no blank line between them) is very likely a hard line wrap from the source document's visual formatting, not an intentional paragraph break — real paragraph breaks in properly-formatted text are conventionally marked with a blank line between blocks, exactly the convention /paragraph-counter/ also relies on to detect paragraph boundaries.
So the tool replaces single line breaks (one line break with no blank line) with a single space, joining the wrapped line back into a continuous sentence, while leaving double line breaks (a genuine blank line) untouched, since those represent real paragraph boundaries the tool should preserve.
A secondary heuristic helps with genuinely ambiguous cases: if a line ends mid-word with a hyphen (a hyphenated line-break, common in justified PDF text where a long word is split across the line wrap), the tool removes the hyphen and joins the word back together rather than leaving an awkward "hyphen space" artifact — "exam-\nple" correctly becomes "example", not "exam- ple".
Who uses this
- Cleaning up a passage copied from a PDF (report, e-book, academic paper) before pasting it into a word processor or CMS.
- Fixing text copied from a terminal or plain-text file with fixed line-wrapping at a specific column width.
- Preparing scraped or extracted text for a word/character count that shouldn't be inflated by artificial line-break characters.
Edge cases to know about
- Poetry and other text where every single line break is intentional (not a wrapping artifact) will be incorrectly joined by this tool, since it can't distinguish "this line break is meaningful" from "this line break is just where the PDF wrapped" without more context — don't run poetry or lyric text through this tool.
- Some PDFs use a blank line even for wrapped lines within the same paragraph (inconsistent source formatting), which can cause the tool to under-merge in those specific documents — always spot-check the output on unusually-formatted source PDFs.
- Hyphen-joining assumes a hyphen at a line's end mid-word is a line-break artifact, but some words are genuinely and correctly hyphenated (like "well-known") — if such a word happens to fall exactly at a line wrap in your source, the tool may incorrectly join it into one word without the hyphen. This is rare but worth checking on technical or heavily-hyphenated text.
Related tools
FAQ
- Will this tool also remove blank lines between real paragraphs?
- No — it specifically preserves blank-line-separated paragraph breaks and only removes single, non-blank line breaks (the PDF-wrap kind). If you also want to collapse blank lines themselves, use /remove-empty-lines/ separately, which handles that different task.
- Why did a hyphenated word in my source lose its hyphen?
- The tool assumes a hyphen at the very end of a wrapped line is a line-break artifact from justified text splitting a long word across the wrap, and removes it while joining the word. This is usually correct for PDF-extracted text, but if a genuinely hyphenated word happens to fall exactly at a line break in your source, it can be incorrectly joined without the hyphen — check the output if your text has a lot of compound words.
- Is this safe to use on poetry or song lyrics?
- No — poetry's line breaks are intentional and meaningful, and this tool can't tell that apart from an accidental PDF wrap. Running poetry through it will destroy the line structure. It's built specifically for prose extracted from a fixed-width or paginated source.