Skip to content
TextArray
100% local

Text direction detector (LTR/RTL)

Detect whether text runs left-to-right or right-to-left and get the dir attribute to use.

Input

Text direction detector (LTR/RTL)

Latin, Cyrillic and Greek run left to right; Hebrew, Arabic, Syriac, Thaana, N'Ko and Adlam run right to left — and text that mixes them is where layouts quietly break. Paste any string and this tool reports its writing direction two ways: the strong-character majority, which is the sensible paragraph direction, and the first strong character, which is what a browser's dir="auto" actually keys on. When the two disagree — an RTL sentence that happens to open with a Latin brand name — you have found precisely the string that will render wrong with auto direction.

The report counts strongly-typed LTR and RTL characters with percentages, plus the neutral rest (digits, punctuation, spaces, emoji, which adapt to their surroundings under the Unicode bidi algorithm). It ends with the ready-to-paste attribute, dir="ltr" or dir="rtl", and adds a warning line when the minority direction exceeds ten percent — genuinely bidirectional content that deserves explicit markup for its embedded runs rather than one attribute at the top.

Typical moments this earns its place: debugging why a user-submitted string renders its punctuation on the wrong side, deciding what dir to store alongside user-generated content, checking translation files before shipping an Arabic or Hebrew locale, or demonstrating bidi behavior in a bug report.

Everything runs locally in your browser — the text you inspect never leaves your device.

FAQ

What is a "strong" character?
In the Unicode bidi algorithm, letters carry an inherent direction — Latin a is strongly LTR, Hebrew א strongly RTL. Digits, punctuation, spaces and emoji are neutral or weak: they follow their surroundings. Direction verdicts only ever count the strong ones.
Why show both majority and first-strong direction?
Because they answer different questions. The majority is the natural paragraph direction for the content. The first strong character is what dir="auto" uses — so when the two differ, dir="auto" will render the text against its natural direction, and that string needs an explicit dir.
Which scripts count as RTL?
Hebrew, Arabic (which also covers Persian and Urdu), Syriac, Thaana (Dhivehi), N'Ko and Adlam. Everything else with letters — Latin, Cyrillic, Greek, CJK, Devanagari and the rest — counts as LTR for the verdict.
What should I do with mixed-direction text?
Set the paragraph dir to the majority direction, and wrap embedded opposite-direction runs in their own elements (or use Unicode isolates like ⁦…⁩). The advisory line appears when the minority exceeds ten percent — the level where one top-level attribute stops being enough.
Is my text uploaded anywhere?
No. The detection runs entirely in your browser and your text never leaves your device.