Text Formatter & Cleaner

About Text Formatter & Cleaner

The Text Formatter & Cleaner repairs text that came out of a PDF, an e-book, an OCR scan or an old document and lost its shape on the way. Copying from a PDF gives you the visual lines of the page instead of paragraphs, words cut in half by a hyphen at the end of a line, page numbers and running headers in the middle of sentences, and a table of contents squeezed into one long paragraph where every title runs into the dot leaders and page number of the one before it. This tool fixes all of that in one pass, and every rule can be switched off on its own. It joins broken lines into paragraphs while keeping headings and list items apart, and rejoins hyphenated words. It is careful with real compounds: a word that also appears with a hyphen elsewhere in the same text keeps its hyphen. It rebuilds a table of contents one entry per line with even dot leaders, and the Word download turns those lines into real Word entries with the page numbers aligned to the right. It removes lines that are only a page number and headers that repeat on every page, and puts numbered verses or list items (1. 2. 3.) that were run together back on separate lines. It also fixes problems that are hard to see: Latin letters such as a, e, o, p, c and J hidden inside Cyrillic words, which look right but break search and spell check, soft hyphens and zero-width spaces, ligatures like fi, spacing around punctuation, and broken č, ć, ž and đ from bad PDF fonts or a wrong encoding. The Show changes view marks every addition and removal before you copy the result. For a quick PDF-only cleanup, Fix Copied PDF Text joins lines and removes hyphenation, Serbian Latin to Cyrillic Converter switches the cleaned text between Latin and Cyrillic, and Text Diff Checker compares two versions of a text.

Text copied from a PDF is rarely clean because a PDF does not store paragraphs. It stores lines of text placed at exact positions on a page, and when you copy, each of those lines ends with a line break. A long paragraph becomes ten short lines, a word hyphenated by the typesetter becomes two halves, and the header, footer and page number of every page land between the sentences. Simply removing every line break does not help, because it also merges headings, list items and real paragraphs. This tool decides line by line: a line that does not end a sentence continues on the next one, a short line that ends with a period closes the paragraph, and a line in capitals or one that starts with a number or bullet starts a new block. Tables of contents suffer the most. The dot leaders and right-aligned page numbers are layout, not text, so a copied contents page often turns into one paragraph like Introduction ......3 About the author .....12 Chapter one ....15. The tool finds each title, its dots and its page number, even when a line break falls in the middle of the dots, and lists the entries again one per line. Some damage is invisible. The Latin a and the Cyrillic а are different characters that look identical, and so are e and е, o and о, p and р, c and с and J and Ј. OCR software and some PDF fonts mix them freely, so a word that looks fine cannot be found by search. Soft hyphens and zero-width spaces cause the same problem, and so do ligatures, where fi or fl is a single special character. Repairing these by hand is close to impossible because you cannot see them, so the tool checks every word and every character for you.

How to use Text Formatter & Cleaner

  1. Paste messy text or open a .txt or .docx file
  2. Check the result and untick any rule you do not want
  3. Copy the clean text or download it as .txt or .docx

Frequently Asked Questions

How do I clean up text copied from a PDF?
Paste the text into the left box or open a .txt or .docx file. The clean version appears on the right as you type: lines are joined into paragraphs, split words are rejoined, page numbers and repeated headers are removed and the spacing is fixed. Copy it or download it as .txt or .docx.
Can it fix a table of contents that turned into one long paragraph?
Yes. Entries in the form Title ....... 12 are found even when they run into each other or are broken across lines, and each one is put on its own line with even dot leaders. A heading repeated on every page of the contents is kept only once. Choose the Tab style or download a .docx to get real Word entries with the page numbers aligned to the right.
Will it remove hyphens that belong in a word?
Not if the word appears with its hyphen somewhere else in the text. A word like well-known that is split at the end of a line keeps the hyphen when well-known is also written in one line elsewhere, while docu- and ment become document. A hyphen before a capital letter, as in Jean-Paul, is always kept.
What are Latin letters hidden in Cyrillic words?
Letters such as a, e, o, p, c, x, y and J look the same in both alphabets. Text from OCR, PDFs and old fonts often mixes them, so a Cyrillic word contains one or two Latin letters. It looks right, but search, Ctrl+F and spell check do not find it. The tool replaces the odd letters so each word is written in one alphabet. Words that really mix both alphabets are left alone.
How do I see what was changed?
Click Show changes above the result. Added text is green, removed text is red and joined line breaks are marked with ↵. The number next to each rule shows how many fixes it made, and you can untick any rule to undo its changes.
Does it work for English and other languages?
Yes. Line joining, hyphenation, the table of contents, headers, page numbers, spacing and quotes work for any language written in Latin, Cyrillic or Greek letters. English text gets “curly” quotes and Serbian text gets „Serbian“ quotes. Repairing broken č, ć, ž and đ is only used for text that looks Serbian, Croatian or Bosnian.
Is my text uploaded to a server?
No. Everything runs in your browser, including opening .docx files and creating the Word download. Nothing is sent to or stored by ToolBox.

Related Tools