The golden book
Reference words for Arabic numbers in words (tafqeet), to test any engine in any programming language. Version 1.0.0 · 2026-11-30 · Mohsen Alyafei
Purpose
To provide the most rigorous, complete, and strictly grammar-aligned golden reference dataset for Arabic cardinal numbers (الأعداد الأصلية).
The dataset serves as an authoritative verification standard for Arabic number-to-words (tafqeet / تفقيط) libraries and engines. Any library or implementation can generate its output for the included numbers and directly compare it against the Gold Book entries to measure accuracy against high-standard Arabic grammar rules for numbers.
The test's result
Any language that can read JSON
The golden book is plain JSON. There is no dependency on a specific language or runtime. A library (or a one-off script) in any of the following can load the files and compare its output against the entries:
Most common
- JavaScript / TypeScript (Node, Deno, Bun, browser)
- Python
- Java
- C# / .NET
- Go
- Rust
- PHP
- Ruby
- Swift
- Kotlin
Also straightforward
- C / C++ (with a JSON library such as nlohmann/json or cJSON)
- Dart / Flutter
- Scala
- Elixir / Erlang
- Haskell
- R
- Julia
- Perl
- Lua
Practical note
The only requirement is the ability to:
- Parse a JSON object
- Iterate over the sets and number keys
- Compare strings
Even languages without a built-in JSON parser can use one. The golden book itself imposes no language restriction.
The files' shape
Each file holds the same 7,934 numbers in six sets, one for each gender and case: every number from 0 to 999; 1, 2, 3, 8, 10, 11, 12, 13 and 18 in every place a count can stand; the scales up to quadrillion. An entry is "number": "words", in a set named cardinal_<Male|Female>_<Raf|Nasb|Jarr>_<None|Alif|Full>_<Auto|Normal>, such as {"cardinal_Male_Nasb_Full_Auto": {"202000": "…", …}, …}. A file to test has the same shape, with any of the sets.
The conventions
| Rule | None | Alif | Full |
|---|---|---|---|
| tashkeel | no vowel marks at all, not even the tanween: أحد عشر ألفا، ثلاثا (not أحد عشر ألفاً) | no vowel marks, except the tanween of the accusative on a word that ends in alif | full: every letter carries its mark (vowel, sukun, shadda, tanween), except the alif of اثْنَانِ (hamzat al-wasl), a long vowel letter (وَاحِدٌ، عِشْرُونَ، إِحْدَى) and the silent alif of مِائَة |
| hundred | مائة, joined to its count: ثلاثمائة، ثمانمائة (not مئة, not ثلاث مائة) | مائة, joined to its count: ثلاثمائة، ثمانمائة (not مئة, not ثلاث مائة) | مِائَة, its alif unmarked, joined to its count, which takes the case: ثَلَاثُمِائَةٍ، ثَلَاثَمِائَةٍ، ثَلَاثِمِائَةٍ |
| joining | parts joined by و with no space after it, no commas: ألف ومائتان وخمسون | parts joined by و with no space after it, no commas: ألف ومائتان وخمسون | parts joined by وَ with no space after it, no commas |
| order | largest part first: ألف ومائة (1100), not مائة وألف | largest part first: ألف ومائة (1100), not مائة وألف | largest part first: أَلْفٌ وَمِائَةٌ (1100) |
| scales | ألف، مليون، مليار، تريليون، كوادرليون (short scale; مليار, not بليون) | ألف، مليون، مليار، تريليون، كوادرليون (short scale; مليار, not بليون) | أَلْف، مِلْيُون، مِلْيَار، تِرِيلْيُون، كُوَادْرِلْيُون (short scale) |
| legal | a group of 101, 102, 201, 202 … (hundreds and then 1 or 2) writes its scale after the hundreds and again after the 1 or 2: مائة ألف وألف (101000), مائتا ألف وألفان (202000); مائة وثلاثة آلاف (103000) is unchanged | a group of 101, 102, 201, 202 … (hundreds and then 1 or 2) writes its scale after the hundreds and again after the 1 or 2: مائة ألف وألف (101000), مائتا ألف وألفان (202000); مائة وثلاثة آلاف (103000) is unchanged | a group of 101, 102, 201, 202 … writes its scale after the hundreds and again after the 1 or 2: مِائَةُ أَلْفٍ وَأَلْفَانِ (102000) |
| tanween | — | written on the alif: ألفاً، مليوناً (not ألفًا) | written on the alif, and the letter before it takes no other mark: أَلْفاً، مِلْيُوناً (not أَلْفًا, not أَلْفَاً) |
| markOrder | — | — | Unicode's standard order (NFC): the vowel before the shadda: سِتَّةٌ = ت + fatha (U+064E) + shadda (U+0651) |
| legal (Normal files) | no legal form: the hundreds and the 1 or 2 after them share one scale word: مائة وألف (101000), مائتان وألفان (202000), خمسمائة ومليونان (502000000) | no legal form: the hundreds and the 1 or 2 after them share one scale word: مائة وألف (101000), مائتان وألفان (202000), خمسمائة ومليونان (502000000) | no legal form: the hundreds and the 1 or 2 after them share one scale word: مِائَةٌ وَأَلْفٌ (101000), مِائَتَانِ وَأَلْفَانِ (202000), خَمْسُمِائَةٍ وَمِلْيُونَانِ (502000000) |
A sample: masculine, accusative
| Number | None | Alif | Full | Alif · Normal |
|---|---|---|---|---|
| 2 | اثنين | اثنين | اثْنَيْنِ | اثنين |
| 8 | ثمانية | ثمانية | ثَمَانِيَةً | ثمانية |
| 18 | ثمانية عشر | ثمانية عشر | ثَمَانِيَةَ عَشَرَ | ثمانية عشر |
| 300 | ثلاثمائة | ثلاثمائة | ثَلَاثَمِائَةٍ | ثلاثمائة |
| 11000 | أحد عشر ألفا | أحد عشر ألفاً | أَحَدَ عَشَرَ أَلْفاً | أحد عشر ألفاً |
| 102000 | مائة ألف وألفين | مائة ألف وألفين | مِائَةَ أَلْفٍ وَأَلْفَيْنِ | مائة وألفين |
| 202000 | مائتي ألف وألفين | مائتي ألف وألفين | مِائَتَيْ أَلْفٍ وَأَلْفَيْنِ | مائتين وألفين |
To see the words for any number, in any gender, case and tashkeel, use the Arqam page.