Typed the way the King Fahd Complex’s everyday-spelling text writes them, 99.86% of the Quran’s words are found, up from 99.01% before the word-dependent rules. Search reads Hafs spellings, forgives no typos, and has not been timed on a phone yet.
Search that reads everyday spelling
People type Quranic words the way they write every day, and a strict search finds nothing. Ours derives those everyday spellings from the mushaf text itself.
- Public code, merged
In short
In the app: type a word, a phrase or a root in Search. A result opens the mushaf on its page.
Typed one way, written another
The mushaf spells many words its own way. It writes ٱلصَّلَوٰةَ with a waw and a small alif, where people type الصلاة. It puts a small yeh in إِبْرَٰهِـۧمَ, and a hamza on a short stroke in مَسْـُٔولًۭا. A search that compares letters finds none of them.
Every line below is one of the 221 golden queries: the index is not built, and the tests do not pass, until each one finds what it must.
-
Typed: الصلاةThe mushaf writes: ٱلصَّلَوٰةَ Must find 2:3
A waw written before a small alif is typed as an alif.
-
Typed: ابراهيمThe mushaf writes: إِبْرَٰهِـۧمَ Must list 2:124 at the top
The small alif and the small yeh are typed as full letters.
-
Typed: مسؤولاThe mushaf writes: مَسْـُٔولًۭا Must find 17:34
The mushaf writes this hamza on a short joining stroke; everyday spelling seats it on a waw.
-
Typed: أهوائهمThe mushaf writes: أَهْوَآءَهُم Must find 2:120
The hamza is typed on the seat of another case ending.
-
Typed: الليلThe mushaf writes: ٱلَّيْلِ Must find 2:164
The mushaf writes one lam where everyday spelling writes two.
-
Typed: يا أيهاThe mushaf writes: يَـٰٓأَيُّهَا Must find 2:21
The vocative is typed in full, as a word of its own.
-
Typed: فطرة اللهThe mushaf writes: فِطْرَتَ ٱللَّهِ Must find exactly 30:30
An open taa is typed as a closed one.
-
Typed: المسجد الأقصىThe mushaf writes: ٱلْمَسْجِدِ ٱلْأَقْصَا Must find exactly 17:1
The mushaf ends this word with an alif; everyday spelling ends it with an alif maqsura.
Every spelling comes from the mushaf
No everyday-spelling text ships with the app. When the index is built, each of the 77,432 word slots of the Hafs text gets the spellings a reader may type, worked out by rule from its own letters and marks: the everyday spelling, the spellings that depend on the word, a hamza on each seat it can take, and the letters exactly as drawn. Each spelling is then folded into one alphabet: no marks, one alif, no hamza seats.
What no rule reaches sits on short lists, reviewed by hand: 6 lemmas written with an open taa, 2 with an alif where everyday spelling has an alif maqsura, and 4 single words.
One word, every key that leads to it
Read out of the shipped index. The letters as drawn count in part or in full. A key from them ranks just below the everyday spelling, and a key without the article below the whole word. 26 Nov 2026.
ٱلسَّمَـٰوَٰتِ 2:164
| Everyday spelling | From the letters as drawn | |
|---|---|---|
| The whole word | السماوات | السماوتالسمواتالسموت |
| Without the article | سماوات | سماوتسمواتسموت |
When a query comes in
- Marks, tatweel and presentation forms are ignored, and Persian and Urdu keyboard letters read as Arabic ones.
- A conjunction or preposition typed apart joins the word after it, as the mushaf writes them.
- A typed hamza is also tried without its seat letter, four keys a word at most. Those keys count where the word as typed is no word of the text, or where the words around it need them.
- Between a long alif and a pronoun, a hamza typed on the seat of one case ending is tried on the others.
- A verse number pasted with its ayah ends that ayah, and no phrase runs across it.
- Exact matches rank above matches on the start of a word, and results of equal rank keep the mushaf’s order.
Where the letters lie
-
An opening or a root?
Letters typed apart can spell a surah opening and a root at once. Typed apart, ا ل م lists exactly the six ayat that open with الٓمٓ and offers the root as a suggestion, one tap away. It is one of 14 openings the search knows.
-
The letters as drawn, whole words alone
Some readers type a word exactly as the mushaf draws it, such as ٱلَّيْلِ with one lam: اليل. The index keeps a spelling like that when no other word has it (54 of them), and matches it as a whole word, never as the start of a longer one, because the same letters begin other words.
Where the drawn letters are another word, the reader’s meaning wins. The mushaf draws يَـٰقَوْمِ with the letters يقوم, but whoever types them means يَقُومُ, so that is where they lead. A golden query checks that they never list 2:54, 5:20, 46:30 and 46:31.
-
Pasted ayat, numbers and all
Paste the opening of Al-Baqarah with its verse numbers and the numbers become ayah ends. Each ayah is searched on its own and the most specific one wins, so the search returns exactly 2:2, not the many words the opening’s letters also spell or begin.
الم (1) ذلك الكتاب لا ريب فيه هدى للمتقين (2) الذين يؤمنون بالغيب ويقيمون الصلاة ومما رزقناهم ينفقون (3)
How often it finds the word
The test types every word of the Quran the way the King Fahd Complex’s everyday-spelling text writes it, then checks that the search finds it. The text is a local test file and is not in the repository.
Found when typed in everyday spelling
Bench: every word of the Quran, typed as the King Fahd Complex’s everyday-spelling (imla’i) text writes it. 14 Nov 2026. The axis starts at 95%.
- Before the word-dependent rules
- With them
Share found
Show the numbers
| Typed | Before | With the rules |
|---|---|---|
| Single words | 99.01% | 99.86% |
| Ayat, from their opening 12 words | 96.33% | 98.57% |
Words of a standard-spelling text that find no ayah
Bench: every distinct word of a standard-spelling Quran text (Tanzil Simple v1.1), typed three ways. 18 Nov 2026. Fewer is better.
- Before this version’s rules
- With them
Words that find no ayah, of 14,868
Show the numbers
| Typed | Before | With the rules |
|---|---|---|
| Typed as written | 29 | 8 |
| A bare alif for every hamza on an alif | 121 | 10 |
| No hamza at all | 200 | 20 |
- Pasted phrases
- 2,902
- 0 misses, on random pasted phrases of one to four words, in the mushaf’s own spelling. Bench, 14 Nov 2026.
- Ayat found by pasting their opening words
- 6,236 of 6,236
- 12 words or fewer of each. A build gate, 19 Nov 2026.
- Average lookup
- 0.21 ms
- 4.5 ms at worst, in Node on a computer, not on a phone. Bench, 14 Nov 2026.
- The whole index
- 1.73 MB
- 21,521 spellings, 125,012 postings, 1,642 roots and 4,659 lemmas. Counted, 26 Nov 2026.
- Golden queries
- 221
- Checked on every build of the index and in the tests. Counted, 26 Nov 2026.
- Spellings reviewed by hand
- 12
- For words no rule reaches. Counted, 26 Nov 2026.
Any rewayah on screen, Hafs spellings searched
Search reads Hafs spellings. With another rewayah on screen, the results say “Searched in the Hafs text”, and each ayah is labelled with its number in the rewayah on screen. Every rewayah shares the Hafs page’s word slots, so the matched words flash on the page in any of them. How the rewayat share one page.
The index has a place reserved for the spellings of the other rewayat. It is empty: searching their own spellings is not built.
What it still misses
The feature’s documentation keeps a list of spellings the search does not find yet. Some of them:
-
Typed: العلاShould find: ٱلْعُلَى Not found: 20:4
An alif maqsura typed as an alif.
-
Typed: بالواديShould find: بِٱلْوَادِ Not found: 20:12
A spelling of this one word that no rule covers.
-
Typed: مسيولاShould find: مَسْـُٔولًۭا Not found: 17:34
The hamza’s seat typed as a plain yeh, with no hamza on it.
- No typo tolerance. A mistyped letter is not forgiven.
- No search in Latin letters. Transliterated queries are not read.
- A shortened word has to come last. The start of a word finds the whole word at the end of a phrase. Earlier in the phrase, a word typed without its pronoun suffix finds nothing.
- Not timed on a phone. Lookups were timed in Node on a computer; the app’s JavaScript engine is expected to be 3 to 6 times slower. A cold start of search, which copies and opens the index, has not been measured on a phone.
- Scores from 14 Nov 2026. The everyday-spelling scores date from that day. Spelling rules added on 18 Nov 2026 improved the second test; the everyday-spelling test has not been run again since.
Credits and sources
- King Fahd Complex (KFGQPC) imla’i text, used to test The King Fahd Glorious Qur’an Printing Complex’s everyday-spelling text of the whole Quran, the test behind the single-word and ayah scores. Nothing from it is in the app.
- Tanzil Quran Text, Simple v1.1 The standard-spelling text of the second test. Nothing from it is in the search index.
- Quranic Arabic Corpus and the Quranic Treebank The morphology behind roots, lemmas and the prefixes the search strips: the corpus under the GNU GPL with its terms of use, carried by the treebank under MIT. The index keeps both notices.
- Digital Khatt The Hafs text every spelling is worked out from. SIL Open Font License 1.1.
The rules, the gates and the figures on this page are public in the Bayaan repository: quran-search.md, the golden queries, the spelling rules and the pull request that merged it.