What Are Zero Width Spaces?
A zero width space (often abbreviated as ZWSP) is an invisible Unicode character with the code point U+200B. Despite its name, it takes up zero visual width on screen—you can't see it at all—but it exists as a real character in your text. This makes it different from a regular space, which you can see as a gap between words.
There are several related invisible characters that this tool detects. The zero width joiner (U+200D) connects characters in scripts like Arabic or in emoji sequences—for example, it's what turns individual emoji into compound ones like the family or profession emojis. The zero width non-joiner (U+200C) does the opposite, preventing characters from connecting when they normally would. Then there's the byte order mark (U+FEFF), which often appears at the beginning of text files to indicate the encoding format.
While these characters serve legitimate typographic and technical purposes, they often end up in text unintentionally, causing problems that are hard to diagnose because the characters themselves are invisible.
Why Hidden Characters Appear in Your Text
Invisible characters sneak into content through several common pathways:
- Copying from websites: Many sites use zero width spaces for responsive text wrapping, allowing long words or URLs to break at appropriate points on small screens. When you copy text from these sites, the invisible characters come along.
- PDF extraction: Copying text from PDF documents frequently introduces hidden formatting characters, especially in documents with complex layouts or multiple columns.
- Messaging and social media: Some platforms use ZWSPs to separate hashtags or prevent auto-linking, while others use the zero width joiner for emoji combinations.
- Content management systems: Certain CMS platforms and text editors insert these characters during formatting operations or when handling multilingual content.
- Data exchange: When text moves between different systems, encodings, or applications, invisible characters can be introduced as artifacts of the conversion process.
Because these characters are invisible, you might not know they're there until they cause a problem—like a string comparison failing unexpectedly, a database query returning no results for text that looks correct, or a search function not finding content that clearly exists.
How This Detection Tool Works
This tool scans through every character in your text and checks each one against a list of known invisible Unicode characters. It identifies not just the basic zero width space but also the joiner, non-joiner, byte order mark, left-to-right and right-to-left marks, and other formatting control characters that have no visual representation.
Each type of invisible character can be toggled on or off independently, so you can choose to remove only specific types while keeping others. For example, you might want to strip zero width spaces from plain text while preserving the zero width joiner in emoji sequences that you want to keep intact.
The preview panel shows your text with every hidden character clearly marked, so you can see exactly where they are and how many there are before deciding to remove them.
Removing Zero Width Spaces in Different Applications
If you encounter invisible characters in specific applications, there are ways to find and remove them directly. In Notepad++, you can enable View > Show Symbol > Show All Characters to make them visible, then use Find and Replace with the regex pattern for the specific character you want to remove. You might also want to use our Remove Extra Spaces tool alongside this one, as invisible characters often accompany other whitespace issues.
In Microsoft Word, zero width characters can sometimes be revealed by turning on Show/Hide formatting marks (Ctrl+*), though not all invisible characters display with this setting. For Excel users, the SUBSTITUTE function can remove specific Unicode characters if you know their code points. VS Code users can install extensions that highlight invisible characters or use the built-in render whitespace option.
For a simpler approach that works across all applications, paste your text into this tool, clean it, and paste it back. This avoids the need to configure any specific editor or write any formulas.
Who Uses a Zero Width Space Remover?
- Web developers: Debug string comparison issues where invisible characters cause equality checks to fail.
- Data analysts: Clean imported text data that contains hidden formatting artifacts.
- Content editors: Remove invisible characters from articles and copy before publishing.
- Translators: Clean text before and after translation to prevent encoding issues.
- Security researchers: Detect steganographic messages hidden using zero width characters in CTF challenges.
- Database administrators: Clean data before import to prevent invisible characters from corrupting queries.
Key Features
- Five detection categories: Zero width space, joiner, non-joiner, byte order mark, and other invisible formatting characters.
- Independent toggles: Choose exactly which types of invisible characters to detect and remove.
- Detailed reporting: See each hidden character's Unicode code point, name, and count.
- Visual preview: Hidden characters are clearly marked in the preview panel.
- Paste from clipboard: Quick button to paste content directly from your clipboard.
- 100% private: All detection and removal happens in your browser.
- Completely free: No signup, no limits, no watermarks.
Removing ZWSP Programmatically
If you need to handle zero width spaces in code, here are common approaches across different languages:
- JavaScript:
text.replace(/\u200B/g, '')removes all ZWSPs. Combine with other Unicode escapes for comprehensive cleaning. This is often used in form validation and data processing pipelines. - Python:
text.replace('\u200b', '')handles the basic case. For a more thorough approach, you might usere.sub(r'[\u200b-\u200f\ufeff]', '', text)to catch multiple invisible characters at once. - C#:
text.Replace("\u200B", "")removes ZWSPs. In .NET, you can also use theChar.GetUnicodeCategorymethod to identify and filter format characters programmatically. - SQL:
REPLACE(column, NCHAR(8203), '')where 8203 is the decimal value for U+200B. Most database systems support this approach.
Our Clean Text Formatter provides a more comprehensive solution if you're dealing with multiple types of text issues beyond just invisible characters—it combines whitespace normalization, punctuation cleanup, and character removal in one tool.
Zero Width Characters in Security and CTF
In the cybersecurity community, zero width characters have an interesting dual use. In Capture The Flag (CTF) competitions, they're sometimes used for steganography—hiding secret messages within seemingly normal text by encoding information in invisible characters between visible letters. A string of zero width spaces and joiners can encode binary data that's completely hidden from casual observation.
This tool can help with CTF challenges by revealing exactly which invisible characters are present and where they're located. By seeing the pattern of hidden characters, you can decode the hidden message they represent. This technique is also relevant for security professionals who need to detect data exfiltration attempts, as zero width characters have been used to smuggle data out of monitored systems within otherwise innocent-looking text.