User Rating 0.0
Total Usage 0 times
Paste any text containing digits
Quick presets:
Is this tool helpful?

Your feedback helps us improve.

About

Mixing numeral systems inside a single document causes rendering inconsistencies, breaks sorting algorithms, and produces search-index mismatches. Persian text uses Eastern Arabic-Indic digits ۰ - ۹ (Unicode U+06F0 - U+06F9), while standard Arabic text uses a distinct set ٠ - ٩ (U+0660 - U+0669). Western digits 0 - 9 (U+0030 - U+0039) occupy a third, incompatible range. This converter performs direct codepoint remapping across all three systems. It does not transliterate or approximate. Each input character is tested against a regex class and replaced via a lookup offset, preserving all non-digit content unchanged.

The tool supports bidirectional conversion: English → Persian, English → Arabic, Persian → English, and Arabic → English. Note: Persian and Arabic digit glyphs may appear identical in some fonts, but they occupy different Unicode blocks and are not interchangeable in database queries or programmatic comparisons. Always verify the target system's expected codepoint range before deployment.

persian numbers arabic numbers number converter unicode converter farsi digits arabic-indic numerals digit conversion

Formulas

The conversion uses a direct Unicode codepoint offset. For English → Persian digits:

Cpersian = char(code(Cenglish) 0x0030 + 0x06F0)

For English → Arabic-Indic digits:

Carabic = char(code(Cenglish) 0x0030 + 0x0660)

For reverse conversion (Persian → English):

Cenglish = char(code(Cpersian) 0x06F0 + 0x0030)

Where C is the character, code returns the Unicode codepoint (via charCodeAt), and char produces the character from a codepoint (via String.fromCharCode). The regex /[0-9]/g isolates only Western digits. Non-digit characters pass through unmodified. The offset between Western and Persian is 1776 (0x06F0 0x0030). The offset between Western and Arabic-Indic is 1584 (0x0660 0x0030).

Reference Data

DigitEnglish (Western)Unicode (Western)Persian (Eastern Arabic-Indic)Unicode (Persian)Arabic-IndicUnicode (Arabic)
00U+0030۰U+06F0٠U+0660
11U+0031۱U+06F1١U+0661
22U+0032۲U+06F2٢U+0662
33U+0033۳U+06F3٣U+0663
44U+0034۴U+06F4٤U+0664
55U+0035۵U+06F5٥U+0665
66U+0036۶U+06F6٦U+0666
77U+0037۷U+06F7٧U+0667
88U+0038۸U+06F8٨U+0668
99U+0039۹U+06F9٩U+0669
Extended: Common Symbols Preserved Across Conversions
Decimal.U+002E٫U+066B٫U+066B
Thousands,U+002C٬U+066C٬U+066C
Percent%U+0025٪U+066A٪U+066A

Frequently Asked Questions

Persian digits (۰-۹, U+06F0 - U+06F9) and Arabic-Indic digits (٠-٩, U+0660 - U+0669) occupy distinct Unicode blocks. While visually similar in many fonts, they differ at codepoints 4 (۴ vs ٤), 5 (۵ vs ٥), and 6 (۶ vs ٦). Database queries, string comparisons, and search engines treat them as separate characters. Using the wrong set causes lookup failures in Persian-locale applications.
No. The regex targets only digit-class characters ([0-9], [۰-۹], or [٠-٩]). All other characters - letters, punctuation, whitespace, emoji, and RTL markers - pass through without modification. The replacement function operates character-by-character using a codepoint offset.
Yes. The "Any → English" mode matches both Persian (U+06F0 - U+06F9) and Arabic-Indic (U+0660 - U+0669) digit ranges simultaneously and maps each back to the Western equivalent (U+0030 - U+0039). A string like "۱۲٣٤" would produce "1234".
Font rendering determines glyph appearance. Many system fonts use the same glyph for both ranges at digits 0-3 and 7-9. Only digits 4, 5, and 6 have visually distinct forms in most traditional Arabic vs Persian typography. Use a font like "Scheherazade" or "Vazirmatn" to see the differences. The underlying codepoints always differ regardless of visual appearance.
The core digit conversion does not alter separators by default, since they are not digit characters. The extended mode optionally converts the Western decimal point (U+002E) to the Arabic decimal separator (U+066B) and the Western comma (U+002C) to the Arabic thousands separator (U+066C). Enable "Convert separators" to activate this feature.
Yes. The converter does not insert or remove Unicode bidirectional control characters (LRM, RLM, LRE, RLE). It only replaces digit codepoints. Existing directional formatting in your text is preserved. However, switching digit systems may change how the browser's BiDi algorithm reorders number sequences within RTL paragraphs.