Hebrew RTL Direction Fixer

Embed correct Unicode bidi markers for Hebrew in mixed-direction text

Wrap Hebrew runs in mixed Hebrew-English text with the correct Unicode bidi control characters (RLI/PDI isolates, RLE/PDF embeddings, or RLM marks) so they display in the right order inside LTR HTML, code, and documents. Free and private.

Why does Hebrew display in the wrong order in English text?

The Unicode Bidirectional Algorithm guesses direction from surrounding context. In a left-to-right paragraph, an embedded Hebrew run plus adjacent numbers or punctuation can be reordered incorrectly. Explicit bidi control characters tell the renderer exactly where the right-to-left run starts and ends.

This tool fixes the garbled ordering you get when Hebrew is embedded inside left-to-right text, by inserting the correct invisible Unicode bidi control characters around each right-to-left run.

How it works

The tool scans for maximal runs of strong right-to-left characters (Hebrew, Arabic, and their presentation forms) and bridges any neutral characters — spaces, digits, punctuation — that sit between two RTL letters so a run like שלום 2 עולם stays intact. It then wraps each run using your chosen strategy:

isolate:  RLI (U+2067) … run … PDI (U+2069)
embed:    RLE (U+202B) … run … PDF (U+202C)
mark:     RLM (U+200F) … run … RLM (U+200F)

Isolates are the modern Unicode recommendation because they contain the run’s direction without disturbing the surrounding text. The escaped output renders each inserted control character as a visible \uXXXX escape so you can confirm exactly what was added.

Example and notes

Take the sentence The sign reads שלום 18 today. In a left-to-right context the number 18 next to the Hebrew can be reordered awkwardly. After fixing, the Hebrew run plus its bridged digits are isolated, so the phrase renders in the intended order while the English around it is untouched. Because the markers are invisible, paste the fixed text where it will be displayed and use the escaped view only to verify placement. Prefer isolates for HTML and modern editors; reach for RLM marks only in constrained plain-text fields that strip paired controls.