Zero-width spaces and other invisible characters: how to find and remove them
A zero-width space is Unicode character U+200B: a character that takes up no room on screen but marks a place where a line may break. It, and a handful of similar characters, often hide in copied text and make words, searches and counts misbehave.
Published
The zero-width space is the Unicode character U+200B. It has no width, so you cannot see it, but it is still a real character in the text. The Unicode Standard says it “indicates a word break or line break opportunity, even though there is no intrinsic width associated with this character.” In other words, it tells a browser or word processor where a long word or URL may wrap. When it ends up somewhere it was not meant to be, for example inside a username, a spreadsheet cell or a line of code, the text looks normal but no longer matches what you typed. To find and delete it, paste the text into the invisible character remover, which lists every hidden character it finds and how many times.
What a zero-width space actually is
Every character in a Unicode text has a code point. A normal space is U+0020. The zero-width space is U+200B, and when the text is saved as UTF-8 it takes three bytes: E2 80 8B. You can see those bytes with the text to hex converter:
| Text | What you see | UTF-8 bytes in hex |
|---|---|---|
hello |
hello | 68 65 6C 6C 6F |
hel[U+200B]lo |
hello | 68 65 6C E2 80 8B 6C 6F |
The two words look identical, but the second one is a different string. A search for “hello” will not find it, a spreadsheet lookup will not match it, and a password or coupon code containing it will be rejected.
The zero-width space is useful where it was intended. Typesetters and web developers use it to allow a line break inside a long string, such as a file path or a URL in a narrow column, without adding a visible space or hyphen. In HTML it can be written as the named reference ​ or the numeric reference ​.
The other invisible characters
U+200B has several relatives. Some have no width at all; others look like a normal space but behave differently. These are the ones that most often turn up in copied text, with the bytes they take in UTF-8 and what the remover does with each.
| Character | Code point | UTF-8 bytes | What it is for | Remover |
|---|---|---|---|---|
| Zero-width space | U+200B | E2 80 8B |
A line break opportunity with no width | Removed |
| Zero-width non-joiner | U+200C | E2 80 8C |
Stops two letters from joining or forming a ligature | Removed, kept between letters of non-Latin scripts |
| Zero-width joiner | U+200D | E2 80 8D |
Asks two characters to join; glues emoji together | Removed, kept between emoji |
| Word joiner | U+2060 | E2 81 A0 |
Prevents a line break, with no width | Removed |
| Byte order mark | U+FEFF | EF BB BF |
Marks the encoding at the start of a file | Removed |
| Soft hyphen | U+00AD | C2 AD |
Shows where a word may be hyphenated | Removed |
| Left-to-right and right-to-left marks | U+200E, U+200F | E2 80 8E, E2 80 8F |
Fix the order of mixed-direction text | Removed |
| Right-to-left override | U+202E | E2 80 AE |
Forces the following text to display right to left | Removed |
| No-break space | U+00A0 | C2 A0 |
A visible space where a line must not break | Becomes a normal space (option) |
| Narrow no-break space | U+202F | E2 80 AF |
A thin space where a line must not break | Becomes a normal space (option) |
| Hangul filler | U+3164 | E3 85 A4 |
A Korean filler that renders as blank | Removed |
Three details from the Unicode Standard explain why these characters are easy to confuse:
- Word joiner versus byte order mark. U+FEFF used to double as a “zero width no-break space”. The standard now says that in new text this meaning “should be encoded by U+2060 WORD JOINER”, and U+FEFF should be used only as a byte order mark at the start of a file.
- Joiners and non-joiners “influence joining and ligature glyph selection”. They matter in scripts such as Arabic and in some Indic scripts, where they change how letters connect.
- The soft hyphen “indicates an intraword break point”. It is only displayed when a word is actually broken at the end of a line, so most of the time it is invisible.
The remover checks for 40 characters in total, including the text direction embeddings and isolates, the invisible math operators (U+2061 to U+2064), the combining grapheme joiner and space look-alikes such as the en space and em space, plus the hidden tag characters U+E0000 to U+E007F. Its tool page lists them all.
Where they come from and what goes wrong
Invisible characters are rarely typed on purpose. They arrive with copied text:
- Web pages use zero-width spaces and soft hyphens to control line breaks in narrow layouts, and no-break spaces to keep “10 kg” or “Mr. Smith” on one line. Copying the text brings them along.
- Word processors and PDFs insert soft hyphens, no-break spaces and direction marks, and keep them when you paste into another program.
- Files saved as “UTF-8 with BOM” start with U+FEFF. The Unicode FAQ warns that a BOM “will interfere with any protocol or file format that expects specific ASCII characters at the beginning”. A CSV whose first column is called
idmay then appear to have a column called[U+FEFF]id, and a script looking foridwill not find it. - Chat apps, social posts and AI chat tools can carry any of them, depending on how the text was produced and copied.
The typical symptoms:
| Symptom | Likely cause |
|---|---|
A word looks right but search, VLOOKUP or a password check fails |
Zero-width space or no-break space inside it |
| The first column of a CSV or the first key of a JSON file is not recognized | Byte order mark at the start |
| A post is “over the limit” by a character or two you cannot see | Hidden characters counted by the platform |
| Punctuation jumps to the wrong end of a line | Direction marks or an override |
| Two words run together after cleaning | A zero-width space was the only thing between them |
Removing a zero-width space never adds a normal space in its place, so one[U+200B]two becomes onetwo, which is how it already looked. If it was standing in for a real space, add one back.
How to find hidden characters
You cannot see these characters, so look for their side effects.
Compare the character count with what you see. The character counter counts each zero-width space as a character. hel[U+200B]lo shows 6 characters, not 5, and 8 bytes in UTF-8 instead of 5. If a short word shows more characters than it has letters, something is hidden in it. Because a zero-width space is not a space, the word count does not change: Hello[U+200B] world is still 2 words and 12 characters.
Look at the bytes. Paste the text into the text to hex converter and look for the byte sequences in the table above. E2 80 8B is a zero-width space, EF BB BF at the very start is a byte order mark, and C2 A0 is a no-break space.
Let the remover list them. The quickest check is the invisible character remover: read the table under the result. For its normal-looking example sentence it reports:
| Character found | Count |
|---|---|
| Zero-width space | 2 |
| No-break space | 1 |
| Word joiner | 1 |
| Byte order mark / zero-width no-break space | 1 |
If the text is clean, it says “No invisible characters found.”
How to remove them
- Paste the text into the invisible character remover, or open a plain-text file with Open file.
- Leave Replace no-break and other special spaces with a normal space ticked if you want no-break spaces turned into ordinary ones. Untick it to keep them and remove only the zero-width and direction characters.
- Leave Keep joiners inside emoji (👨👩👧) ticked if the text contains emoji. Unicode’s emoji standard explains that emoji like the family are “emoji ZWJ sequences”: separate emoji joined by U+200D. Removing every joiner splits them back into separate emoji.
- Check the table of characters found, then press Copy or Download .txt.
- If the result has double spaces where special spaces used to be, run it through Remove extra spaces. To see exactly what changed, paste both versions into Compare texts.
The emoji option looks past skin tones and presentation selectors, so emoji such as 👩🏽💻 and 🏳️🌈 stay whole. It also keeps the tag characters that build the flags of England, Scotland and Wales; tag characters anywhere else are removed.
When to keep an invisible character
Not every invisible character is a mistake.
- Zero-width non-joiners and joiners change how letters display in Arabic and Indic scripts; the standard says that in Indic text they “are used to request particular display forms”. The remover keeps a non-joiner between two letters of a non-Latin script, so Persian
میخواهمstays as written, but it removes zero-width joiners outside emoji, which changes Indic half forms such asक्ष. Check such text after cleaning, or leave it out. - Direction marks keep mixed right-to-left and left-to-right text, such as an English brand name inside a Hebrew or Arabic sentence, in the right visual order.
- No-break spaces keep numbers and their units, or a title and a name, together on one line. Untick the space option to keep them.
- Zero-width spaces in long URLs or code samples on a web page let them wrap neatly. They only cause trouble once someone copies the text out.
If you need to insert a zero-width space yourself, Microsoft Word supports typing a character’s code and pressing Alt+X: type 200B, then press Alt+X. Microsoft notes that some Office programs, such as PowerPoint, cannot convert codes this way. In HTML, use ​ or ​, or the ⁠ reference for a word joiner.
Questions
How do I type a zero-width space?
In Microsoft Word, type 200B and press Alt+X; Microsoft documents this code-then-Alt+X method for inserting Unicode characters. In HTML, write ​ or ​. On most other keyboards there is no key for it, so people copy one from a character map.
Is a zero-width space the same as a blank space?
No. A normal space (U+0020) has width and separates words. A zero-width space has no width, so "one[U+200B]two" looks like "onetwo" on screen, but programs see an extra character between the two halves.
Does a zero-width space count toward a character limit?
In the character counter it does: "hel[U+200B]lo" counts as 6 characters and 8 bytes in UTF-8. Many forms and platforms count it too, so a hidden one can push a post over a limit you cannot see.
Why does my CSV or JSON file start with a strange character?
It probably starts with a byte order mark, U+FEFF, stored as the bytes EF BB BF in UTF-8. Editors that save "UTF-8 with BOM" add it. Remove it with the invisible character remover or save the file as plain UTF-8.
Will removing zero-width joiners break emoji?
It can. Emoji such as 👨👩👧 are separate emoji glued together with zero-width joiners. The remover keeps a joiner when an emoji sits on both sides of it, as long as the "Keep joiners inside emoji" option is ticked.
Sources
- Unicode Consortium, The Unicode Standard Version 18.0, Chapter 23: Special Areas and Format Characters, https://www.unicode.org/versions/Unicode18.0.0/core-spec/chapter-23/ (checked 2026-10-21)
- Unicode Consortium, Unicode Technical Standard #51: Unicode Emoji, https://www.unicode.org/reports/tr51/ (checked 2026-10-21)
- Unicode Consortium, FAQ: UTF-8, UTF-16, UTF-32 & BOM, https://www.unicode.org/faq/utf_bom.html (checked 2026-10-21)
- WHATWG, HTML Living Standard, Named character references, https://html.spec.whatwg.org/multipage/named-characters.html (checked 2026-10-21)
- Microsoft Support, Insert ASCII or Unicode Latin-based symbols and characters, https://support.microsoft.com/en-us/office/insert-ascii-or-unicode-latin-based-symbols-and-characters-d13f58d3-7bcb-44a7-a4d5-972ee12e50e0 (checked 2026-10-21)