
Last checked by the TextEditor.com team
Where messy text comes from
Most mess comes from copying. Each program stores text its own way, and the copy brings those habits along. Pick the source under "My text comes from" and the tool turns on the right options.
| Copied from | What goes wrong | Option that fixes it |
|---|---|---|
| PDF files | A line break at the end of every line, words split with a hyphen, ligatures like "fi" as one character | Join lines broken in a sentence, Rejoin words, Fancy letters and ligatures |
| Word and email | No-break spaces, soft hyphens, ">" marks in replies, extra empty lines | Odd spaces, Hidden characters, Email quote marks, Empty lines |
| Web pages | Tabs and runs of spaces from the page layout, zero width spaces, HTML codes like & | Repeated spaces, Tabs, Hidden characters, Remove HTML tags |
| Chat apps and social posts | Bold or script letters from font generators, zero width joiners, direction marks | Fancy letters, Hidden characters |
| Spreadsheets | Tabs between cells, spaces at the end of cells | Tabs, Remove spaces at line ends |
How to fix line breaks in text from a PDF
A PDF does not store paragraphs. It stores each line of text at a spot on the page. When you copy, every line ends with a line break, even in the middle of a sentence.
"Join lines broken in a sentence" puts the lines back together. It keeps a break after an empty line, before a list item, before an indented line, and after a short line that ends with a period. Those are the usual signs of a new paragraph. A word split with a hyphen at the end of a line ("exam-" and "ple") is put back together when the next line starts with a small letter.
Old printers set each line by hand. A long word at the end of a line was split with a hyphen, like this example, so the edge stayed straight. A new paragraph starts here, and a copy from a PDF still breaks it into short lines.
Change the text on the left. The tool guesses from line lengths, so read the result once before you use it.
Hidden characters you cannot see
Some characters take up no space at all. A zero width space (U+200B) tells a browser where a long word may wrap. A zero width joiner (U+200D) glues emoji together, so 👨👩👧 shows as one family emoji. They are useful where they belong, but copied into a name, a password or a spreadsheet they break searches and matches.
hello 5 charactershello 6 characters
The second word has a zero width space between "hel" and "lo". A search for "hello" does not find it.
| Character | Code point | Where it comes from | Removed? |
|---|---|---|---|
| Zero width space | U+200B | Web pages, chat apps, some CMS editors | Yes |
| Zero width joiner | U+200D | Emoji sequences, Indian scripts | Only outside emoji and words |
| Zero width non-joiner | U+200C | Persian, Hindi and other scripts | Only outside words |
| Byte order mark | U+FEFF | The start of files saved by older Windows tools | Yes |
| Soft hyphen | U+00AD | Word and web pages, marks where a word may break | Yes |
| Word joiner | U+2060 | Typesetting, keeps two parts on one line | Yes |
| Right to left override | U+202E | Tricks that flip text, like a file name that hides its real ending | Yes |
| Left and right marks | U+200E, U+200F | Arabic and Hebrew text | Kept when the text has Arabic or Hebrew letters |
| Variation selectors | U+FE00 to U+FE0F | Emoji style, like the red heart ❤️ | One right after a character stays. A long run of them can hide data, so it goes. |
To see each hidden character by name before you remove it, paste your text into the hidden character finder. Wikipedia has more about the zero width space.
Spaces that are not normal spaces
Unicode has more than a dozen spaces. Word puts a no-break space (U+00A0) where you press Ctrl+Shift+Space, and web pages write it as . It looks like a normal space, so a search for two words with a normal space between them misses it.
Computers add them too. In late 2022 the Unicode locale data (CLDR 42) put a narrow no-break space (U+202F) between the time and "PM" in English. Chrome and Firefox went back to a normal space after some sites broke, but other programs still write it.
3:45 PM Turn on JavaScript to check your browser.
| Space | Code point | Width between two bars |
|---|---|---|
| Normal space | U+0020 | | | |
| No-break space | U+00A0 | | | |
| Narrow no-break space | U+202F | | | |
| Thin space | U+2009 | | | |
| Em space | U+2003 | | | |
| Ideographic space | U+3000 | | | |
"Odd spaces to normal spaces" turns all of them into the space from your keyboard (U+0020). Turn it off for French text, where a no-break space before "!" and "?" is part of the spelling.
Curly quotes, dashes and fancy letters
Word and phones change straight quotes into curly ones as you type. That looks right in a letter. In code, a CSV file or a command, a curly quote is a different character and causes errors.
The dash option changes the en dash (U+2013), the em dash (U+2014) and the minus sign (U+2212) into the keyboard hyphen (U+002D). The ellipsis character (U+2026) becomes three dots.
Fancy letters from font generators are math symbols, like the bold 𝐀 (U+1D400). The tool turns them back into plain letters with Unicode NFKC, the same rule that splits the "fi" ligature (U+FB01) into "f" and "i". Signs like ™, ½ and ² stay as they are.
| Plain letters | Bold and script, a fine “quote”, Wide letters |
|---|---|
| Plus straight quotes | Bold and script, a fine "quote", Wide letters |
To make fancy letters on purpose, use the font converter.
Line endings: Windows, Mac and Linux
A line break is one or two hidden characters. Windows uses two, a carriage return and a line feed (CRLF, U+000D U+000A). Mac and Linux use only the line feed (LF, U+000A).
Most programs read both today. Windows Notepad learned to show LF files in 2018, with Windows 10 version 1809, as Microsoft explains in its Notepad post. Some older Windows tools still show everything on one line. Pick "CRLF (Windows)" under Line endings, and the copy and the download use two characters per break.
What the cleaner never changes
Letters, digits and punctuation stay as they are, except for the options you turn on under Characters. Emoji stay whole, with their skin tones and joiners. Arabic and Hebrew text keeps the marks that set its direction. Use Preview changes before you clean, and Undo if you do not like the result.
More ways to fix text
- Replace a word everywherecolour → colorFind and replace, with match case and regex patterns.
- Put lines in orderc b a → a b cSort lines from A to Z, by number or at random.
- Remove repeated linesa a b → a bKeeps the first copy of each line and drops the rest.
- Change capital lettersaBc → ABCThe case converter makes text upper, lower or title case.