Bidi Control Characters Cleaner

Find and remove the hidden direction marks and zero-width characters that sneak into copied text.

How to use

What it checks and how it works

The Unicode Bidirectional Algorithm (UAX #9) defines invisible control characters that steer the direction of text: the marks LRM, RLM and ALM, the embeddings and overrides LRE, RLE, PDF, LRO and RLO, and the isolates LRI, RLI, FSI and PDI. Zero-width space, word joiner, byte-order mark and soft hyphen also travel in copied text. They do not show, but they break exact matches, URLs, file names and counts. The tool lists every one it finds and removes the groups you choose. ZWNJ and ZWJ change how letters join, so they stay unless you ask, which matters for Persian and Urdu. W3C recommends markup or CSS for direction where you control the page, with control characters for plain text.

Why would a text contain hidden characters?

They come from copying out of chat apps, PDFs, word processors and web pages that insert direction marks to display mixed Arabic and English correctly.

Is it safe to remove them all?

Usually, for identifiers such as URLs, names and keywords. In text meant to be read, removing them can change how a mixed Arabic and English line displays, so check the result.

Can hidden characters be a security problem?

They can be used to make text look different from what it is. If you receive code or a link with direction overrides, inspect it with this tool before you trust it.

Sources

Related tools

Privacy

Runs in your browser; nothing is uploaded. The interactive tool needs JavaScript.