> Source: https://txtfetch.com/tools/clean-extracted-text > Plain-text twin — every page on txtfetch.com has one. https://txtfetch.com/text --- # Your extracted text has damage. Here's exactly what, and what can honestly be fixed. Paste it below and this names every signal, links each one to its fix, and repairs what it safely can. It runs entirely in your browser. Nothing is uploaded. Paste text you've already extracted, or drop a local `.txt` file. This names every kind of damage in it, links each one to the page that explains it, and repairs what it honestly can. It runs entirely in your browser. Nothing is uploaded. ## what-this-tool-does This scan runs the same detector behind the [chunk previewer](https://txtfetch.com/tools/chunk-preview). It names 11 kinds of extraction damage. Mojibake, hyphenated line breaks, and hard-wrapped lines are three of them. Repeated headers, bare page numbers, and stray replacement characters are three more. Unexpanded ligatures, glued words, space-run columns, collapsed long lines, and missing paragraph breaks round out the list. Every finding links to the [page](https://txtfetch.com/fixes) that explains it in full. Naming the damage is only half the job. This page repairs what it honestly can. Eight repairs are listed below. Each one is a heuristic, unless its own note says exact. Every repair reports how many edits it made. ## the-eight-repairs Two repairs are exact and lossless. The rest are heuristics. Each one fixes the common case, and says so plainly: - **Join hyphenated line breaks.** Joins `word-\nword` back into one word. It can also join a real compound word that broke at the same spot. - **Unwrap hard-wrapped lines.** Joins a line into the next line. It only joins when this line does not end a sentence, and the next line starts lowercase. That is the shape a hard-wrapped paragraph leaves behind. - **Remove repeated headers and footers.** Drops any short line that repeats three or more times. That is the same floor the detector itself uses. - **Remove page-number lines.** Drops bare lines like "3" or "Page 3 of 12". - **Expand ligatures.** Exact and lossless. Turns fi, fl, and five other ligatures back into plain letters. - **Remove undecodable characters.** Drops the replacement character (�) and stray control bytes. This deletes damage. It does not restore what was already lost. - **Collapse space-run columns.** Off by default, because it's lossy. Collapses table-column spacing down to one space. This destroys the column alignment. It does not fix reading order. - **Fix mojibake.** See the next section. This one is exact, but only some of the time. ## how-the-mojibake-fix-works Mojibake happens when UTF-8 bytes get decoded as Windows-1252 instead. This is almost always a mistake somewhere upstream. The original bytes stay intact. Only the encoding label is wrong. So the fix maps each character back to its Windows-1252 byte. Then it decodes those bytes as UTF-8 again. When the source really was UTF-8 read as Windows-1252, this recovers the original text exactly. This tool never guesses. It applies the fix only when two checks both pass. First, the re-decode must produce no `U+FFFD` character. Second, a fresh scan of the result must find zero mojibake findings. Genuine accented text, like café or crème, usually fails this check. That text was never mojibake in the first place. When the checks fail, this page reports "not applied". It never silently corrupts text that was not broken. ## two-kinds-of-damage-this-cannot-fix Two signals get no repair, on purpose. **Glued words**, like `thequickbrownfox`, need a dictionary to split safely. A wrong split invents a word boundary that might not be real. That is worse than leaving the words fused. **Lost paragraph structure** is the second case. It shows up as one giant block, or as two columns collapsed into one line. This structure cannot be invented after the fact. The source document either encoded it, or it did not. Once it is gone, nothing in the plain text can rebuild it. Unwrapping hard-wrapped lines sometimes restores a paragraph-like shape as a side effect. The before-and-after counts on this page prove that when it happens, instead of promising it upfront. ## what-to-do-next Got a whole document to check, not just a snippet? The [fixes hub](https://txtfetch.com/fixes) covers every symptom this scan can name. Each page explains why it happens, and how to fix it yourself. Chunking this text next? The [chunk previewer](https://txtfetch.com/tools/chunk-preview) shows exactly where a boundary would land. It also shows whether these same signals are why a chunk ends mid-thought. Want to see real damage next to the corrected text? See [the extracted text, side by side](https://txtfetch.com/diff). [Get your key →](https://app.txtfetch.com/signup) ## faq **Why does extracted PDF text lose the spaces between words?**: PDF text is a sequence of positioned glyph runs, not words with real boundaries. A producer draws each run at a coordinate, and relies on visual spacing to imply a gap. An extractor that just joins runs in order can fuse two words with no space at all. See /fixes/missing-spaces-between-words. **Is it safe to de-hyphenate extracted text automatically?**: Mostly, yes. The join only fires when both letters around the break are lowercase. That is the shape a print-layout line wrap leaves. It can still merge a genuine compound word that broke at the same spot, so spot-check the result before you trust it at scale. **What does ’ mean, and can it be recovered?**: It's mojibake: UTF-8 bytes read back with the wrong encoding, almost always Windows-1252. The original bytes are intact, so it's usually fully recoverable by re-decoding correctly. This tool does that automatically, but only after checking the reversal is exact. It refuses rather than guess. See /fixes/mojibake-wrong-encoding. **Does this tool upload my text anywhere?**: No. Every scan and every repair runs in your browser, in plain JavaScript. Nothing you paste or drop ever leaves the page. **Why can't glued words like thequickbrownfox be split back apart automatically?**: Splitting a fused run needs a dictionary. Even then, a wrong split is worse than the original: it invents a word boundary that might not be real. This tool names the signal, and links to the fix. It does not guess at where the space belongs. **Can this tool restore paragraph breaks that extraction lost?**: Not directly. A paragraph break is a blank line the source document had to encode in the first place. If that line is gone, nothing left in the text can recover it. Unwrapping hard-wrapped lines sometimes restores the same shape as a side effect. The after-count on this page proves that when it happens, instead of promising it upfront. **What does txtfetch do differently so I don't need this tool at all?**: txtfetch extracts through Apache Tika. Tika detects source encoding and reflows paragraphs as part of parsing. So mojibake and hard-wrapped lines show up far less than in a raw parser dump. This page exists for text you already have, from whatever produced it. It doesn't replace checking your own extraction pipeline first. ## That was one file. The API does the queue. This page read your text on your own machine. The API reads a folder of them. [Read the quickstart →](https://txtfetch.com/docs) [Get an API key →](https://app.txtfetch.com/signup)