Arabic words run from right to left, but a run of digits still reads left to right. This page explains why, and how Unicode handles digits in mixed text.
Quick answer: a single run of digits, such as 1446, reads left to right inside Arabic, Persian and Urdu text. Groups separated by spaces or hyphens can reorder, so they need an isolate.
Why Do Words and Numbers Run in Opposite Directions?
Wikipedia says Arabic and Persian are mostly, but not exclusively, right to left. The words in those languages therefore run from the right edge toward the left.
Numbers keep the order used in English. The largest place value sits on the left, so ١٤٤٦ starts with the thousands digit. Wikipedia says Eastern Arabic digits follow the same place-value arrangement as Western digits.
Wikipedia says mathematical expressions, numeric dates and numbers with units are embedded from left to right, even in right-to-left text.
How Do Digits Read Inside an Arabic Line?
Two rules work together. Words follow the right-to-left order of the language, and a single run of digits keeps its own left-to-right order.
The figure below shows both orders. It places a single run of digits inside an Arabic line.
How Does Unicode Treat Digits?
Unicode gives every character a bidirectional class. The Unicode Bidirectional Algorithm, described in UAX #9, uses those classes to turn stored text into display order.
Digits are weak characters, so their direction depends on the text around them. UAX #9 sorts them into number classes, EN and AN.
Which Digits Are EN and Which Are AN?
UAX #9 puts European digits, U+0030 to U+0039, in class EN. It also puts Extended Arabic-Indic digits, U+06F0 to U+06F9, in class EN. UAX #9 calls that group Eastern Arabic-Indic digits.
UAX #9 puts Arabic-Indic digits, U+0660 to U+0669, in class AN. These are the Eastern Arabic digits used on this site, so the names can confuse readers.
Rule W2 changes an EN digit to AN when the nearest strong character before it is Arabic (AL). For spaces and punctuation next to a number, rule N1 treats both number classes as right-to-left letters.
How Do Phone Numbers, Dates and Prices Display?
A single run of digits keeps its order in an Urdu line. A comma between two digit groups joins them as one number, so 1,500 stays together.
Groups separated by spaces or hyphens behave differently. UAX #9 says that a list of numbers separated by neutrals comes out in the run’s order.
In an Urdu line, the groups then read right to left. So the second group of 0300 1234567 can appear on the left. A date such as 2026-10-25 has three groups joined by hyphens, so its groups can reorder in the same way.
W3C’s remedy for this case is an isolate. LRI starts an isolate that reads left to right, and PDI ends it, so the groups keep their written order.
Where Do Mixed Lines Go Wrong?
W3C says that without controls, a number after a right-to-left phrase can be pulled to the wrong side. Its example is a Hebrew phrase followed by the number 5.
Punctuation after such a phrase can also land in the wrong place. W3C suggests a right-to-left mark after the punctuation, or an isolate wrapper around the phrase.
Digit Shapes That Look Different
Four, five and six differ in shape between the Arabic-Indic set and the Persian set. Wikipedia says the Persian digits have their own code points, even when a form looks the same.
Urdu uses the same code points as Persian, according to Wikipedia. A reader who sees a different shape can check the code point.
What Do Typists and Developers See?
Text is stored in the order it is typed. The display order is worked out when the line is drawn. Wikipedia describes the bidi algorithm as converting logical order into visual display.
Markup still sets the default direction of a page. W3C says the Unicode control characters are for inline use. The direction of a whole page or element should come from markup.
Plain text fields, attributes and CSV files cannot carry markup, so the control characters matter there. W3C prefers the isolate forms over the older embedding controls.
Check a mixed line where readers will see it. A line can look right in an editor and still look wrong on a phone.
What Are the Common Mix-Ups?
- Thinking the whole line reverses. Only the words follow right-to-left order. A single run of digits keeps its own order.
- Expecting the minus sign on one side. Wikipedia says Arabic puts the minus sign on the right of the number, and Persian on the left.
- Expecting one decimal mark. Wikipedia says U+066B is the Arabic decimal separator, though a comma is also used.
- Treating digits as abjad letters. The abjad calculator on this site counts letters only, so digits never add to a total.
How Does This Connect to the Numerals Pages?
The shapes and uses of the Eastern digits are on the Eastern Arabic numerals guide. This page covers direction only.
For where the digits came from, read the origin of Arabic numerals. To see a number in abjad letters, use the number to abjad numerals tool.
خلاصہ
عربی اور فارسی عبارت زیادہ تر دائیں سے بائیں لکھی جاتی ہے، مگر ہندسوں کا ایک مسلسل سلسلہ بائیں سے دائیں ہی پڑھا جاتا ہے۔ عدد میں سب سے بڑی قدر بائیں طرف ہوتی ہے، جیسے ۱۴۴۶ میں پہلا ہندسہ ہزار کا ہے۔ یونیکوڈ ہر کردار کو ایک سمتی درجہ دیتا ہے، اور ہندسے کمزور کردار ہیں جن کی سمت آس پاس کے متن سے طے ہوتی ہے۔ فون نمبر یا تاریخ میں ہندسوں کے گروہ اسپیس یا ہائفن سے الگ ہوں تو ان کی ترتیب بدل سکتی ہے۔ ایسے میں گروہوں کو ایک علیحدہ سمتی دائرے میں رکھا جاتا ہے تاکہ ان کی لکھی ہوئی ترتیب برقرار رہے۔
Frequently Asked Questions
Are Arabic numbers written from left to right?
Yes. A single run of digits, such as 1446, reads from left to right inside Arabic, Persian and Urdu text. The words around it still run from right to left.
Why do Arabic words run right to left but numbers do not?
Writing direction and digit order are separate. Unicode gives digits a number class, which keeps a single run of digits in left-to-right order.
What is the difference between EN and AN digits?
EN covers European digits, U+0030 to U+0039, and Persian digits, U+06F0 to U+06F9. AN covers Arabic-Indic digits, U+0660 to U+0669, the Eastern Arabic set used on this site.
How can I stop a number from moving to the wrong side?
W3C suggests wrapping the mixed part in an isolate that starts with LRI and ends with PDI. It also suggests a right-to-left mark after punctuation. Set the direction of the page or element in markup too.
Is the minus sign on the left or the right in Arabic?
In Arabic it goes on the right of the number. In Persian it goes on the left, according to Wikipedia.
Sources and Further Reading
- UAX #9: Unicode Bidirectional Algorithm, Unicode Consortium. Rules W2, W4 and N1, and the example of numbers separated by neutrals.
- DerivedBidiClass.txt, Unicode Character Database. Class EN for U+0030 to U+0039 and U+06F0 to U+06F9. Class AN for U+0660 to U+0669.
- Bidirectional text, Wikipedia. Mostly right-to-left writing, numeric dates embedded left to right, and weak characters.
- Eastern Arabic numerals, Wikipedia. Persian code points, place value, minus sign and decimal separator.
- Using Unicode controls for bidi text, W3C Internationalization. Markup for direction, isolate controls and numbers after a right-to-left phrase.