Removing Arabic Diacritics and Normalising Text for Search
What Arabic diacritics, tatweel and letter variants are, why they break search and matching, and how to strip or normalise them without losing meaning.

Removing Arabic Diacritics and Normalising Text for Search
Arabic writing has a base layer of letters and an optional layer of marks above and below them. Most everyday Arabic, in newspapers, signs and messages, is written without the marks; the Quran, poetry, children's books and dictionaries use them. When the two kinds of text meet in a database, a search box or a spreadsheet, things stop matching. The Arabic Text Diacritics Remover and Normaliser cleans text so that it can be compared, while you keep the original for reading.
The marks
| Mark | Name | Sound |
|---|---|---|
| َ | fatha | short a |
| ِ | kasra | short i |
| ُ | damma | short u |
| ً ٍ ٌ | tanwin | -an, -in, -un |
| ّ | shadda | doubled consonant |
| ْ | sukun | no vowel |
| ٰ | superscript alef | long a (Quranic) |
In Unicode each mark is a separate character after its letter. "مُحَمَّد" is seven code points, "محمد" only four, so a computer sees two different words.
Tatweel
Tatweel, or kashida (ـ), is a stretching line used for decoration and justification: "مرحبـــا". It is not a letter and should be removed before search.
Letter variants
Some letters have several forms that people use interchangeably:
- Alef: ا, أ, إ, آ, ٱ. Many people type plain ا for all of them.
- Ya and alif maqsura: ي and ى, often mixed, especially in Egyptian writing.
- Ta marbuta and ha: ة and ه at the end of words such as مدرسة.
- Hamza seats: ؤ and ئ, sometimes typed as و and ي.
- Persian letters: ی and ک from Persian keyboards look like Arabic ي and ك but are different characters.
What the normaliser does
Each change is a tick box:
- Remove diacritics.
- Remove tatweel.
- Unify alef forms to ا.
- ى to ي (off by default).
- ة to ه (off by default).
- ؤ to و and ئ to ي (off by default).
- Persian ی and ک to Arabic ي and ك.
The "search form" mode applies all of them at once. It is the form most Arabic search engines use internally.
A worked example
"أَهْلًا وَسَهْلًا بِكُمْ فِي مَدْرَسَةِ الإِيمَانِ ـــ مرحبـــا"
- Remove diacritics only: "أهلا وسهلا بكم في مدرسة الإيمان ـــ مرحبـــا"
- Normalise (default options): "اهلا وسهلا بكم في مدرسة الايمان مرحبا"
- Search form: "اهلا وسهلا بكم في مدرسه الايمان مرحبا"
The right way to use it
- Store two columns: the original text and its normalised form.
- Normalise every search query the same way.
- Search and match on the normalised column; show the original to users.
- Never normalise the Quran or poetry for display: the diacritics carry meaning and recitation.
Finding hidden marks
Sometimes two names look identical but do not match because one has an invisible shadda or a superscript alef. The "show the marks found" mode lists each mark in the text with its Unicode code point, so you can see what is hiding.
For developers
The diacritic range is U+064B to U+065F plus U+0670, and the Quranic annotation signs are U+06D6 to U+06ED. Apply Unicode NFKC first to turn presentation forms, such as the lam-alef ligature ﻻ, into ordinary letters. The tool does the same steps.
Names and addresses
Customer databases in the Gulf often hold the same name spelled with and without hamza, or with ة and ه. Before you look for duplicates, normalise a copy of the name column with the search form, then compare. Keep the customer's own spelling for letters and certificates.
Limits
Normalising deliberately merges spellings. Words that differ only by hamza or ta marbuta can become the same, which is good for search but wrong for publishing. The tool runs in your browser and sends nothing anywhere.



