What are BiDi characters and why do they cause glitches?
Bidirectional (BiDi) characters are hidden markers like the left-to-right mark (U+200E) and right-to-left mark (U+200F). They are essential for handling mixed-direction text — for example, a paragraph containing both English and Arabic.
However, when these markers are copied "out of context" — such as copying a single English word from a multilingual site — they remain embedded in the text. This causes your cursor to jump to the wrong side of a word, makes highlighting text nearly impossible, and can even flip the displayed order of punctuation like periods and parentheses. Like all invisible characters, they have no glyph, so you can't find them by looking.
Why are BiDi characters dangerous in code?
BiDi markers are particularly dangerous for developers. If a directional override ends up inside a string or an identifier, the code can display one way while compiling another. This is the basis of the "Trojan Source" attack (CVE-2021-42574): override characters such as U+202E reorder what reviewers see on screen, so a line that looks like a harmless comment can actually contain executing logic. That's why many code editors and GitHub now warn about BiDi characters in diffs — and why pasted snippets should be sanitized before committing. To audit a snippet without altering it first, the hidden character checker lists every directional control it finds by code point and count, leaving the text as it is.
Our tool identifies every directional control character — U+200E, U+200F, the Arabic letter mark U+061C, the embedding and override set U+202A through U+202E, and the newer isolates U+2066 through U+2069 — and strips them completely, "resetting" the text to the default direction of your destination editor. See the full invisible Unicode characters list for every code point covered, or the zero-width space remover for the other big family of invisible troublemakers.