٢ is the Unicode character ARABIC-INDIC DIGIT TWO, code point U+0662 (decimal 1634) in the Arabic block, added in Unicode 1.1. In HTML write ٢, and in UTF-8 it is the 2 bytes D9 A2.
Codes
| Where | How to write it |
|---|---|
| Code point | U+0662 |
| Decimal | 1634 |
| UTF-8 bytes | D9 A2 |
| UTF-16 (big-endian) | 0662 |
| UTF-32 | 00000662 |
| HTML decimal | ٢ |
| HTML hex | ٢ |
| CSS | \662 |
| JavaScript | \u0662 |
| JSON | \u0662 |
| Python | \u0662 |
| Python by name | \N{ARABIC-INDIC DIGIT TWO} |
| Java, C# | \u0662 |
| Rust, Swift | \u{662} |
| Go, C, C++ | \u0662 |
| URL (percent-encoded) | %D9%A2 |
JavaScript and JSON strings store text as UTF-16, so this character is one code unit long. Python 3 strings count code points, so its length there is 1.
Properties
| Property | Value |
|---|---|
| Name | ARABIC-INDIC DIGIT TWO |
| Code point | U+0662 (decimal 1634) |
| Block | Arabic (U+0600–U+06FF) |
| General category | Nd: Decimal digit |
| Script | Arabic |
| Bidirectional class | AN: Arabic number |
| Numeric value | 2 |
| Mirrored in right-to-left text | No |
| First in Unicode version | 1.1 |
Nearby in Arabic
- U+065A Arabic Vowel Sign Small V Above
- U+065B Arabic Vowel Sign Inverted Small V Above
- U+065C Arabic Vowel Sign Dot Below
- U+065D Arabic Reversed Damma
- U+065E Arabic Fatha With Two Dots
- U+065F Arabic Wavy Hamza Below
- ٠ U+0660 Arabic-Indic Digit Zero
- ١ U+0661 Arabic-Indic Digit One
- ٣ U+0663 Arabic-Indic Digit Three
- ٤ U+0664 Arabic-Indic Digit Four
- ٥ U+0665 Arabic-Indic Digit Five
- ٦ U+0666 Arabic-Indic Digit Six
- ٧ U+0667 Arabic-Indic Digit Seven
- ٨ U+0668 Arabic-Indic Digit Eight
- ٩ U+0669 Arabic-Indic Digit Nine
- ٪ U+066A Arabic Percent Sign
All 256 characters: Arabic.
Official reference
Questions people ask
- What is the HTML code for ٢?
- Use ٢ (decimal) or ٢ (hex).
- What is the UTF-8 encoding of U+0662?
- D9 A2 (hex), 2 bytes. In a URL it is %D9%A2.
- How do I write U+0662 in JavaScript or Python?
- JavaScript: \u0662. Python: \u0662.
Source
Unicode Character Database 18.0.0 (Unicode License v3); HTML entity names from the WHATWG HTML Standard (CC BY 4.0). The encodings above are computed from the code point and checked against Python's encoders. How the character looks depends on your fonts.
Legal entity
Devansh Yadav
Moradabad, Uttar Pradesh
Governing law: Courts at Moradabad, Uttar Pradesh
Phone: +91 8433475698
Legal: legal@analyzeit.in