Arabic Text Normalizer

Strip tashkeel, unify alefs and yaas, and fix the spelling differences that break Arabic search.

Arabic search breaks on small spelling differences: أ versus ا, ى versus ي, ة versus ه, and tashkeel marks that one writer adds and another leaves out. This tool applies the standard search normalization used by Arabic search engines (the same rule set as Apache Lucene's Arabic normalizer): hamza-on-alef forms become a bare alef, dotless yeh becomes yeh, teh marbuta becomes heh, and diacritics and tatweel are removed. Each rule is a switch, so you can keep the ones your task needs and skip the rest.

RuleBeforeAfterWhy it breaks search
Hamza on alefأ إ آ ٱاأحمد typed with أ will not match احمد typed with ا
Dotless yehىيعلى typed with ى will not match علي typed with ي
Teh marbutaةهمدرسة typed with ة will not match مدرسه typed with ه
Tashkeelَ ُ ِ ّ ْ ً ٌ ٍremovedمُحَمَّد with marks will not match محمد without them
Tatweelـremovedالسـلام with stretching will not match السلام

Warning: normalization destroys spelling differences on purpose. Do not use normalized text as a final document, a Quranic quote, or a name on an official form. Use it for search, matching and deduplication, and keep the original for anything people will read or sign. The teh marbuta to heh rule is the most lossy: مدرسة (school) and مدرسه (his school, in dialect spelling) become the same string, which is what you want for search and not what you want for grammar.

The five rules, and where they come from

These five rules are the standard Arabic normalization set published by Apache Lucene, the search library behind many Arabic search engines: normalize hamza with an alef seat to a bare alef, normalize teh marbuta to heh, normalize dotless yeh to yeh, remove Arabic diacritics (the harakat), and remove tatweel (the stretching character). Search teams use this set because it matches how Arabic is actually typed: writers drop hamzas, swap ى and ي, and write ة as ه, all without changing the word they mean.

Tashkeel is the biggest source of failed matches. The marks fatha, damma, kasra, shadda, sukun and tanwin are pronunciation guides, and most everyday Arabic text leaves them out entirely. A Quranic quote or a children's textbook keeps them, and a chat message drops them, so the same word appears in two forms that a plain search treats as different words. Stripping the marks collapses both forms to one. Tatweel is a justification trick: writers stretch a word like السـلام to fill a line, and the stretching character must be removed before matching, or the stretched word never matches its normal form.

Deduplication and matching

Normalize both sides before comparing. Two customer names, two product titles or two lists of comments match after normalization even when one side kept the hamzas and the other did not. The stats line counts every change by rule, so you can see which rule did the work.

What normalization cannot do

Normalization does not add missing tashkeel, does not fix spelling, and does not turn dialect into standard Arabic. It also cannot tell مدرسة from مدرسه once the rule has run. That trade is the point: search recall goes up, and spelling precision goes down. Keep both versions when the difference matters.

Frequently Asked Questions

It means reducing spelling variants of the same word to one form before search or comparison: alef forms to a bare alef, dotless yeh to yeh, teh marbuta to heh, and removal of diacritics and tatweel. The rule set here matches Apache Lucene's Arabic normalizer, the standard used by Arabic search engines.
Because أ (alef with hamza above) and ا (bare alef) are different characters. Many writers drop the hamza, so the same name appears in both forms. Unifying alefs collapses both to احمد.
No. Normalization destroys spelling on purpose and is meant for search, matching and deduplication only. Keep the original for documents, quotes, names on forms, and anything people will read or sign.
It removes pronunciation marks, not letters, so the consonant skeleton stays the same. It can merge words that differ only by vowels, which is acceptable for search and not acceptable for a Quranic quote or a grammar lesson.
Tatweel (ـ) is a stretching character writers use to justify a line, as in السـلام. It is not a letter, and it must be removed before matching, or the stretched word never matches its normal form.
No. All normalization runs in your browser on this page. Nothing is uploaded or stored.

Related Tools

Was this tool helpful?

Comments

Loading comments...

Check Out Other Popular Tools