Skip to main content

Find & Remove Hidden Zero-Width Characters Detect and remove hidden zero-width and invisible characters in text.

Zero-Width Character Detector illustration
📝

Zero-Width Character Detector

Detect and remove hidden zero-width and invisible characters in text.

1

Paste Text

Paste text that may contain hidden invisible characters.

2

View Detection Results

See a list of all invisible characters found with their positions and types.

3

Get Cleaned Text

Copy the cleaned text with all invisible characters removed.

Loading tool...

What Is Zero-Width Character Detector?

A zero-width character detector is a tool that scans text for hidden invisible Unicode characters that can't be seen but affect text processing, including Zero-Width Space (U+200B), Zero-Width Non-Joiner (U+200C), and Word Joiner (U+2060). Developers and security researchers use it to identify potential issues in their code or data, such as bugs caused by invisible characters that break string comparisons. One specific problem it solves is detecting hidden characters used in homograph attacks, where an attacker uses invisible Unicode characters to manipulate text and deceive users.

The tool is particularly useful for finding zero-width space in text and detecting invisible Unicode characters like the Soft Hyphen (U+00AD) and BOM (U+FEFF). What makes it different is its ability to not only detect these characters but also remove them from the text, providing a cleaned version of the input. It achieves this by iterating over each character in the input string, checking if it matches any of the known zero-width characters defined in the ZERO_WIDTH_CHARS record, and if so, adding it to a list of found characters.

It uses a callback function onProcess to handle the detection and cleaning process, which returns a detailed report including the position and Unicode code point of each detected character, making it an effective invisible character finder. The report also includes the cleaned text with all hidden characters removed, allowing users to easily identify and fix issues caused by these characters.

Why Use Zero-Width Character Detector?

  • Detects 15+ types of invisible Unicode characters
  • Shows exact position and type of each hidden character
  • Provides cleaned text with invisible characters removed
  • Essential for debugging string comparison issues
  • Identifies potential text manipulation or watermarking

Common Use Cases

Code Debugging

Find invisible characters causing compilation errors, failed comparisons, or unexpected behavior.

Data Cleaning

Clean database entries, CSV files, and imported data by removing embedded invisible characters.

Security Analysis

Spot hidden Unicode used in phishing, homograph attacks, or text manipulation.

Copy-Paste Cleanup

Catch stray formatting characters that slip in when copying text from websites or documents.

Technical Guide

The detector scans each character's Unicode code point against a known list of invisible/zero-width characters. It checks for Zero-Width Space (U+200B), Zero-Width Non-Joiner (U+200C), Zero-Width Joiner (U+200D), Left/Right-to-Right Marks (U+200E/200F), Word Joiner (U+2060), Invisible Math Operators (U+2061-2064), BOM (U+FEFF), Soft Hyphen (U+00AD), Combining Grapheme Joiner (U+034F), Arabic Letter Mark (U+061C), and Mongolian Vowel Separator (U+180E). Each detected character is logged with its position, Unicode code point, and human-readable name. The cleaned output is generated by filtering out all detected invisible characters.

Tips & Best Practices

  • 1
    Always check pasted code for invisible characters if you get unexpected errors
  • 2
    Zero-width characters in passwords can make them appear to match when they don't
  • 3
    Text copied from websites often contains hidden formatting characters
  • 4
    JSON and CSV data can be corrupted by invisible characters in field values
  • 5
    Use this tool as a first step when debugging "works on my machine" string issues

Related Tools

Frequently Asked Questions

Q Why can't I see zero-width characters?
They have no visual representation — they're designed to be invisible while affecting text processing (line breaking, joining, etc.).
Q How do invisible characters get into my text?
They can be introduced by copy-pasting from websites, text editors, PDFs, or by text processing tools.
Q Can invisible characters cause bugs?
Yes, they can cause string comparison failures, JSON parsing errors, database issues, and code compilation errors.
Q Are invisible characters malicious?
They have legitimate uses (typography, emoji combining) but can be used maliciously in phishing URLs, fake content, and data manipulation.
Q What's the most common invisible character?
Zero-Width Space (U+200B) is the most common, often introduced by copy-pasting from web pages.

About This Tool

Zero-Width Character Detector is a free online tool by FreeToolkit.ai. All processing happens directly in your browser — your data never leaves your device. No registration or installation required.