Spell Toolkit

Clean Up Text Copied from a PDF

Paste text from a PDF, an email or Word and get readable paragraphs back. It tells you what it found before it changes anything, and shows you every guess it made. Nothing you paste leaves your browser.

  1. 1. Paste your textPDF, email, Word
  2. 2. See what's wrongeach fix is a switch
  3. 3. Copy it back outor download a .txt
From a PDF, an email, Word — anywhere

Paste above and the cleaned text appears here as you type. Nothing is uploaded.

What this does

Copy a few paragraphs out of a PDF and paste them anywhere, and they arrive broken: a line break at the end of every line, words split in half by a hyphen, a page number sitting in the middle of a sentence, and stored as one character instead of two letters. This tool puts the paragraphs back together.

The reason it happens is that a PDF has no paragraphs in it. It records where each line of text sits on the page, and nothing about which lines belong together. When you copy, the extractor has to put a break after every visual line, because that is all the information the file contains. Rebuilding the structure means inferring it — so this tool shows you what it inferred rather than quietly rewriting your text.

How to use it

  1. Paste your text. The findings appear immediately — there is no button to press and nothing to configure first.
  2. Read what it found. Each line is a count and a fix, and every fix is a switch you can turn off.
  3. Open Show what changed on the two fixes that guess — rejoined words and removed header lines — and check them.
  4. Copy the result, or download it as a plain .txt file.

A worked example

Suppose you copy three pages out of an annual report to quote in a summary. What lands in your clipboard looks like this:

Global Operations Review 2024        Page 2

The committee found that month-end close
continues to slip, and that the root cause is
the manual reconciliation between the two
finance systems. It is performed in a spread-
sheet with no owner.

Global Operations Review 2024        Page 3

Four separate problems, and only one of them is visible at a glance. The running header repeats on every page. Every line ends in a break. The word spreadsheet is split across two lines by a hyphen that is not part of the word. And financebegins with a single ligature character, so searching the pasted text for “finance” will not find it.

Paste it in and you get one paragraph, the header gone, the word whole, and the ligature expanded — with a note telling you the header was removed three times and which word was rejoined, so you can confirm none of it was your actual content.

Assumptions and edge cases

Rebuilding structure that was never in the file is inference, and inference can be wrong. Here is every judgement this tool makes, and where each one breaks down.

Which line breaks are removed
It estimates the column width from your text, then keeps a break when the next line's first word would have fitted on the line above — because then the renderer had no reason to wrap. It fails on text that mixes wrapped and unwrapped lines, where there is no single column width to find.
Hyphenated words
Rejoined when the continuation is lowercase, kept when it is a capital or a digit. That gets information and Anglo-Saxon both right, and it gets a lowercase compound split across a line — well-known, say — wrong, by removing a hyphen that belonged there. Every join is listed so you can spot it.
Repeated headers and footers
Detected by collapsing digits to a placeholder, so a moving page number does not hide the repeat. A line must be under 80 characters and its repeats must be spread out. A short document with only two pages will not trigger it unless the line is a bare page number.
Lists
A bullet, a number, or a letter with a bracket starts a new line. A paragraph that happens to wrap onto a line beginning “A. Smith” will be split there, because that is indistinguishable from a list item.
Tables
Three or more consecutive spaces mean columns, and nothing on either side of that is rejoined. A table aligned with single spaces cannot be detected and will be treated as prose.
Headings
An all-capitals line never runs on into the text below it. A heading in title case is only kept separate when it is short enough that the next word would have fitted beside it.
Invisible characters
Space-like characters become ordinary spaces; zero-width and directional characters are removed outright. A form feed becomes a blank line, because in extracted text it marks a page break.
Curly quotes and bullets
Left alone unless you ask. They are correct typography rather than damage, and straightening them is a change of meaning, not a repair.
Running it twice
Cleaning already-clean text does nothing. Long unwrapped lines make the estimated column width large, so no further joining happens — which is what makes the output safe to paste back in.

Questions

Is my text uploaded anywhere?
No. Everything runs inside your browser tab using JavaScript. There is no server to send it to — this site is static files only, with no backend and no database. You can confirm it by opening your browser's network tab: nothing is sent while you work, and the tool keeps working if you go offline after the page loads. That matters more here than on most tools, because the thing people paste into a text cleaner is often a contract, a report or an internal memo.
Why does text copied from a PDF have a line break on every line?
Because a PDF has no paragraphs. It stores each line of text at a fixed position on the page, and when you copy, the extractor has to guess where one line ends and the next begins — so it puts a break after every visual line. The paragraph structure was never in the file to begin with. Rebuilding it is guesswork, which is why this tool shows you what it decided rather than silently rewriting your text.
How does it know which line breaks to remove and which to keep?
It measures the width of the column your text was wrapped at, then asks a question about each break: would the first word of the next line have fitted on this line? If it would have, the renderer had no reason to wrap, so the break was deliberate and it is kept. If it would not have fitted, the line ran out of room and the two halves belong to the same paragraph. That is a question about how the page was laid out rather than about grammar, which is why it handles a paragraph's short last line correctly even when it is only a few characters shorter than the rest.
Will it join a bulleted list into one paragraph?
No. A line starting with a bullet, a number, or a letter followed by a bracket always begins a new line, and its own wrapped continuation is pulled up to it. Tables are protected too: three or more spaces in a row means columns, so a table header never gets welded onto its first row of data.
What happens to hyphenated words?
A word split across a line break is rejoined. The judgement call is which hyphens are real, and the rule is the continuation: lowercase means the hyphen was inserted by the renderer and it goes, so infor-mation becomes information. A capital letter or a digit means the hyphen belongs to the word, so Anglo-Saxon and COVID-19 come through intact. A soft hyphen is unambiguous and always removed. Every join is listed under 'Show what changed' so you can check them.
How does it find repeated page headers?
By collapsing every run of digits to a placeholder before looking for repeats. That is what lets it see 'Annual Report 2024 — Page 7', 'Page 8' and 'Page 9' as one repeating thing rather than three unique lines — the trick most tools miss, because a plain duplicate-line check never matches any of them. Two guards keep it off your actual content: the line has to be short, and its occurrences have to be spread out, because a value repeating on adjacent lines is a table column and not a footer.
Can I use it on an email rather than a PDF?
Yes. Reply markers — the '>' prefixes a mail client adds to quoted text — are stripped, and mail wrapped at 72 characters is rejoined the same way PDF text is. Text pasted out of Word is handled too: curly quotes, non-breaking spaces and the stray control characters Word leaves behind are all covered.
What are 'invisible characters' and why do they matter?
Characters you cannot see that still count as different text. A non-breaking space looks exactly like a space but is a different character, so a VLOOKUP or a SQL join against it silently fails. Zero-width spaces, byte order marks and directional marks are worse, because they take up no width at all. Excel's CLEAN() only removes character codes 0 to 31, which is why the widely shared TRIM(CLEAN(SUBSTITUTE(A2,CHAR(160)," "))) formula still leaves most of them behind. This tool handles all of them, and tells you how many of each it found.
Why are curly quotes left alone by default?
Because straightening them changes your text rather than repairing it. A curly quote is not a defect — it is correct typography, and in prose you usually want to keep it. It is a separate switch, marked 'opt in', for when you are pasting into something that cannot handle them. The same applies to normalising bullet characters.
How much text can it handle?
Comfortably into the megabytes. Every step is a single pass over the text, so cost grows in a straight line with length rather than exploding. The practical limit is your browser's memory for the text itself.

If this one is missing something you need, tell us — early feedback shapes what gets built next.