You paste a command into a terminal and it fails with an error about a character you cannot see. A spreadsheet refuses to match two product codes that look identical. A form rejects an email address that is obviously correct. A JSON file stops parsing after someone edited it in a word processor. In each case, the culprit is usually a character that is invisible or looks almost exactly like the one you meant to type.
This guide explains the most common hidden and look-alike characters, where they come from, how to detect them, and how to clean them out in one pass without damaging the text you actually want to keep.
The usual suspects
Modern text uses Unicode, which contains thousands of characters beyond the ones on your keyboard. A handful of them cause most of the trouble.
| Character | Looks like | Where it comes from | What it breaks |
|---|---|---|---|
| Smart quotes “ ” ‘ ’ | " and ' | Word processors, email apps, phones | Code, CSV quoting, search |
| En dash – and em dash — | - | Autocorrect, copied articles | Command-line flags, part numbers |
| Ellipsis … | ... | Autocorrect | Word counts, exact matching |
| Non-breaking space | a normal space | Web pages, Word, PDFs | Matching, splitting on spaces |
| Zero-width space | nothing | Web pages, chat apps, some editors | Matching, URLs, passwords |
| Byte order mark (BOM) | nothing | Files saved by some Windows programs | Headers in CSV, script first lines |
| Soft hyphen | nothing (until a line wraps) | Web pages and layout software | Search, spell check |
| Control characters | nothing or a box | Old systems, binary data, bad exports | Parsers, databases |
Two ideas explain why these are so troublesome. First, look-alikes: an en dash and a hyphen are different characters, so --help typed with a dash is not the flag your program expects. Second, invisibles: a zero-width space between two letters of a product code makes it a different string, even though you see no difference.
How to detect hidden characters
A few quick checks reveal whether invisible characters are present:
- Count characters. If a word that looks six characters long reports seven in a Character Counter, something invisible is inside it.
- Move the cursor. In many editors, pressing the arrow key through a word with a zero-width character takes one extra keypress at the hidden position.
- Turn on "show whitespace" in a code editor. VS Code highlights unusual Unicode characters, and Notepad++ can show all characters from its View menu.
- Compare two strings. Paste the "identical" values into a diff tool such as Text Diff; if it flags a difference you cannot see, a hidden character is the likely cause.
Clean text in your browser
The Text Cleaner applies a set of individually switchable rules and shows exactly what it changed.
- Open the Text Cleaner and paste your text into Messy text. Click Sample to load an example containing smart quotes, a zero-width space, a non-breaking space, tabs and emoji.
- Review the Cleaning rules. By default these are on:
- Smart quotes → straight
- Dashes → hyphen
- Ellipsis → three dots
- Remove invisible characters (zero-width spaces, BOM, soft hyphens and direction marks)
- Non-breaking & odd spaces → space
- Remove control characters (line breaks and tabs are kept)
- Trim trailing spaces
- Normalise line endings
- Switch on the optional rules if you need them: Tabs → single space, Collapse repeated spaces and Remove emoji. Use Select all, Defaults or None to set every switch at once.
- Check the summary under the output. It lists each rule that made a change and how many times, for example "Smart quotes: 6" or "Remove invisible characters: 1".
- Copy the Clean text or click Download to save it.
Everything happens locally in your browser, so you can safely clean passwords, customer data or internal documents.
Choosing the right rules for the job
Not every rule suits every text. Think about where the text is going:
- Code, commands, JSON, CSV: use the defaults. Straight quotes and plain hyphens are what parsers expect, and invisible characters are never wanted.
- Data for spreadsheets or databases: add Collapse repeated spaces so that "ACME Ltd" and "ACME Ltd" match, and consider Tabs → single space unless the data is tab-separated.
- Text for publishing: be careful. Typographers deliberately use curly quotes, en dashes for ranges (pages 4–7) and em dashes in prose. Converting them to straight characters is correct for code, but can make polished writing look plainer. Turn those rules off and keep only the invisible-character and space rules.
- Social media or chat exports: Remove emoji is useful when you need plain text for analysis, but leave it off for anything people will read.
Other ways to clean text
- Paste as plain text. Most apps support Ctrl+Shift+V (Cmd+Shift+Option+V on a Mac in many apps) to paste without formatting. This removes fonts and colours, but it does not remove zero-width characters or convert smart quotes.
- Turn off autocorrect. In Word, the AutoFormat options control "Straight quotes with smart quotes" and dash replacement. Turning them off prevents new smart punctuation, but does not fix text that already contains it.
- Regular expressions. In an editor with regex search, a pattern like
[-]finds common zero-width characters. This is precise but requires knowing the exact code points you are looking for. - Programming languages. Unicode normalisation functions (such as NFKC normalisation) convert many compatibility characters, including some odd spaces, into standard ones. They do not convert smart quotes to straight quotes, which is a stylistic choice rather than a normalisation.
For keyword lists in particular, the Keyword Cleaner combines cleaning with de-duplication and case handling.
Troubleshooting
Text still does not match after cleaning
Check for differences in letter case, or for letters that come from another alphabet. The Cyrillic "а" and the Latin "a" look identical but are different characters, and no cleaning rule converts one into the other.
Accented letters look wrong after pasting
That is usually an encoding problem (for example, "é" instead of "é"), which happens when a file saved in one encoding is opened as another. Re-open the original file with UTF-8 encoding rather than trying to clean the garbled result.
I need to insert an invisible character on purpose
Some platforms need a blank-looking character, for example to leave an empty name or add spacing. The Invisible Character tool provides these for copying. Just remember that the Text Cleaner will remove them again.
Frequently asked questions
What is a zero-width space?
It is a Unicode character (U+200B) that takes up no visible space. It marks a point where a line may break, but when copied into data or code it makes two strings differ invisibly.
Why do smart quotes break code?
Programming languages and data formats recognise only straight quotes (" and ') as string delimiters. Curly quotes are ordinary characters to a parser, so a string wrapped in them is not recognised.
Does cleaning text remove line breaks?
No. Line breaks and tabs are kept by the control-character rule. Normalise line endings only converts Windows and old Mac line endings into standard line feeds.
Is it safe to remove all invisible characters?
For code, data and plain text, yes. In some languages, zero-width joiners and direction marks affect how text is displayed, so check the output if you work with scripts such as Arabic, Hebrew or those used in South Asia.
Can the cleaner remove emoji?
Yes. Switch on Remove emoji. It removes pictographs together with flags, skin-tone modifiers and keycap sequences, leaving the surrounding text in place.