Text Cleaner - Remove Line Breaks and Extra Spaces
Text cleaner
How to clean up text copied from a PDF
Text pasted from a PDF, an e-book or an old email often looks fine until you paste it somewhere else: a line break at the end of every printed line, words cut in half by a hyphen, double spaces, invisible characters that break search, and curly quotes that code and spreadsheets do not accept. This tool fixes all of that in one pass and shows how many changes each step made, so you can see what was wrong.
Three steps
- 1 Paste the messy text into the left box.
- 2 Leave the default steps on, or untick the ones you do not want. The number next to each step shows what it changed.
- 3 Read through the clean text on the right and copy it.
Why PDF text breaks at every line
A PDF does not store paragraphs, it stores lines placed at fixed positions on a page. When you copy, each printed line becomes its own line, so a paragraph turns into a stack of short lines. "Join broken lines" glues the lines of a paragraph back together, and "Keep paragraph breaks" treats a blank line as the end of a paragraph. If your PDF gave no blank lines between paragraphs, everything becomes one block: add an empty line where each paragraph should start, or untick "Keep paragraph breaks" to get one long line. While paragraph breaks are kept, lines that start with a bullet or a number (-, •, 1., a)) are treated as list items and stay on their own lines.
Words split by a hyphen
Justified text splits long words at the end of a line: "sen-" on one line, "tence" on the next. When a line ends with a letter and a hyphen and the next line starts with a small letter, the tool removes the hyphen and joins the halves into "sentence". The catch: a real compound that happened to break at its hyphen, such as "well-known", also becomes "wellknown". Scan the result for such words, or untick the option if your text has many of them.
Invisible characters
A non-breaking space looks like a normal space but is a different character, so searching for "copying text" will not find "copying" and "text" joined by one. Zero-width spaces, word joiners and byte order marks take up no room at all, yet they split words, break passwords and code, and make two identical-looking lines different. The tool turns non-breaking and thin spaces into normal spaces and deletes zero-width characters and soft hyphens. Zero-width joiners are kept on purpose: emoji sequences and scripts such as Hindi and Bengali need them. Invisible left-to-right and right-to-left marks are removed as well. PDFs also store letter pairs such as fi, fl and ffi as one ligature character (fi, fl, ffi): it looks right, but search and spell checkers do not recognise the word, so "Split ligatures" turns it back into ordinary letters.
Curly or straight quotes?
Word processors and PDFs turn " and ' into curly quotes. They look better in print, but code, JSON, CSV files, spreadsheet formulas and command lines only understand straight quotes. The tool converts single and double curly quotes, including the low „ ‚ forms, to straight ones. Guillemets « » and the prime marks ′ ″ used for feet, inches and minutes are left alone, because they are not curly versions of a straight quote.