Fix Text Copied From a PDF — Remove Line Breaks, Headers and Extra Spaces
Paste the broken text into the box, turn on the repairs — trim lines, merge paragraphs, collapse spaces, drop duplicates — and copy the clean version back out. Twelve actions, all running locally on the page.
Why PDF text breaks when you copy it
A PDF does not store paragraphs — it stores positioned fragments of text. When a line reaches the page width, the PDF simply starts a new fragment at the left margin, so copying gives you a hard line break in the middle of a sentence. Page headers and footers repeat on every page and get pasted with them, hyphenated words split across lines arrive as “govern- ment”, and the typographer’s ligatures like fi and fl paste as single characters some editors refuse to search.
None of that is fixable by retyping, and it is exactly what the cleaner above was built for: paste the broken text, switch on the repairs, and copy the result back out. Nothing is uploaded — the text stays in your browser.
The one-pass repair order
- Trim line ends — removes the trailing spaces most PDF copies carry on every line, which are invisible until they break a word count.
- Merge into one paragraph — turns every line break into a space, which rejoins the wrapped sentences. Skip this if your text is meant to stay as separate lines, like a poem or a column.
- Extra spaces → one — collapses the double spaces the merge creates at the old break points.
- Duplicate lines — removes the page headers and footers that repeated on every pasted page, keeping the first copy only.
- Only if the text needs it: Blank lines to drop the gaps between pages, Links or Email addresses to strip references out of a quote, or Punctuation to get plain words for analysis.
Case conversion is a separate set of buttons underneath — sentence case for prose, title case for headings, UPPERCASE, lowercase, camelCase, snake_case or kebab-case for code and file names. A typical cleanup for text going into a document is: trim → merge → collapse spaces → sentence case, and the whole job takes under ten seconds.
What the cleaner will not do
It cannot restore a word that the PDF hyphenated mid-line — “govern- ment” becomes “govern- ment” with the break removed, and you still have to rejoin the two halves. If the source matters enough, paste from the PDF with its “copy with formatting” option off, or export to plain text first. Scanned PDFs are images, not text, so nothing copies from them until they go through OCR.
For counting what you have after cleaning — words, characters and reading time — the word counter reads the same clipboard, and the character limits guide tells you how much fits where you are pasting it.
- Paste the copied text — Ctrl+V on desktop or long-press paste on a phone. The box accepts thousands of lines at once.
- Turn on the repairs — Start with trim line ends, merge into one paragraph and extra spaces — the PDF trio.
- Check the live preview — The cleaned output updates with every toggle, so you can flip an action off if it went too far.
- Copy or download — One button copies the result; another saves it as a .txt file if you are cleaning a long document.
- Twelve actions in one place instead of five different websites for five different fixes.
- Everything is reversible in a click — toggles recompute the output, they never destroy your paste.
- Runs entirely in your browser: private notes and unpublished drafts never touch a server.
- Case converters cover prose and code styles alike, from sentence case to kebab-case.
Fix Text Copied From a PDF — questions
How do I remove line breaks from text copied from a PDF?
Paste the text into the cleaner and enable “Merge into one paragraph”, which converts every line break to a space, then “Extra spaces → one” to clean up the joins. The result reads as continuous paragraphs instead of one line per PDF row.
How do I delete the repeated page headers and footers?
Enable “Duplicate lines”. Every line that appears more than once — like a running header on each pasted page — is kept the first time and removed afterwards, which strips them without touching unique sentences.
Will it fix hyphenated words split across lines?
It removes the line break but not the hyphen, so “govern- ment” becomes “govern- ment” on one line. Rejoining those pairs needs a human or a spell-check pass — there is no reliable automatic rule for when a hyphen was a line-break artifact and when it belongs to the word.
Can it convert the case of my text?
Yes — sentence case, Title Case, UPPERCASE, lowercase, camelCase, snake_case and kebab-case are all one-click buttons below the cleaning toggles, and they compose with any of the twelve cleaning actions.
Is my text uploaded anywhere when I clean it?
No. The cleaner is plain JavaScript on the page; the text never leaves your browser and is gone the moment you close the tab. That matters for pasted legal text, unpublished writing and anything with names in it.
Why did my copied text come out as nothing at all?
The PDF is probably a scan — a photograph of pages rather than real text. Nothing can copy from an image until OCR (optical character recognition) converts it to text, which the cleaner does not do. Look for a PDF viewer with an OCR or “text recognition” option.