DuckyTools
Home Text Invisible Character Detector

Invisible Character Detector Text

Find the zero-width and look-alike characters hiding in pasted text — and strip them out.

Invisible Character Detector is a free online tool that find the zero-width and look-alike characters hiding in pasted text — and strip them out. It runs entirely in your web browser using plain JavaScript, so files are processed on your own device and never uploaded to a server. There is no sign-up, no file size limit imposed by the site, no watermark and no paid tier.

Price
Free — no account, no quota, no watermark
Category
Text
Where it runs
In your browser, on your device
Files uploaded
None
Technology
plain JavaScript
Settings
3
Works offline
Yes, after the first visit

About Invisible Character Detector

Two strings that look identical and do not compare equal is one of the most maddening bugs in software, and the cause is nearly always one of the twenty characters this looks for. A zero-width space from a web page, a no-break space from a word processor, a byte order mark from a text editor — all present in the data, all counted by `length`, none visible. Several are worse than a nuisance: U+202E, the right-to-left override, is the character behind the Trojan Source attack, where source code reads one way and compiles another.

How to use it

  1. Paste or type your text. Every figure recalculates on each keystroke.
  2. Use the sample button to see what the numbers look like on real prose.

The 3 settings

SettingWhat it doesDefault
Replace no-break spaces with normal spacesOn or off. On by default.On
Remove zero-width and control charactersOn or off. On by default.On
Keep zero-width joiners (needed by emoji)On or off. On by default.On

Under the hood

Runs onplain JavaScript — runs the whole thing
ControlsReplace no-break spaces with normal spaces, Remove zero-width and control characters, Keep zero-width joiners (needed by emoji)

Questions

Why does my text look identical but not match?

Almost certainly U+00A0, a no-break space, or U+200B, a zero-width space. Both are common in text copied from web pages and PDFs. They render as a space or as nothing at all, and neither is the ASCII space your comparison expects.

Why is the zero-width joiner kept by default?

Because it is load-bearing in emoji. A family emoji is several people joined by U+200D, and stripping it turns one glyph into three separate figures. Turn the option off if you are certain your text has no emoji sequences.

How do these get into my text?

Word processors insert no-break spaces around punctuation and units. PDFs carry soft hyphens from justification. Websites insert zero-width spaces as break opportunities in long strings. Translation tools add bidirectional marks. None of it is malicious; all of it survives copy-and-paste.

Should I be worried about the bidirectional ones?

In source code and file names, yes. U+202E can display "exe.txt" for a file actually named "txt.exe", and it can make a line of code read differently from how it executes. Finding one somewhere it has no business being is worth investigating.