[{"data":1,"prerenderedAt":1022},["ShallowReactive",2],{"blog-\u002Fblog\u002Fhow-arabizi-transliteration-works":3,"blog-related-\u002Fblog\u002Fhow-arabizi-transliteration-works":1003},{"id":4,"title":5,"author":6,"body":7,"category":982,"date":983,"description":984,"extension":985,"image":986,"imageAlt":987,"keywords":988,"meta":989,"navigation":990,"path":991,"readingTime":992,"seo":993,"seoTitle":994,"sitemap":995,"stem":996,"tags":997,"updatedAt":983,"__hash__":1002},"blog\u002Fblog\u002Fhow-arabizi-transliteration-works.md","How Arabizi Transliteration Works (and Why Letter-by-Letter Converters Fail)","Abdessamad Bettal",{"type":8,"value":9,"toc":966},"minimark",[10,23,26,31,38,253,291,295,298,475,478,482,496,503,549,552,556,563,710,713,762,766,777,780,789,803,806,810,826,830,856,860,880,884,887,911,914,918,942,946],[11,12,13,17,18,22],"p",{},[14,15,16],"strong",{},"In brief:"," converting Arabizi to Arabic is not a character substitution problem. Arabizi leaves out information Arabic spelling requires — long vs. short vowels, emphatic letters, the shape of word endings and the seat of the hamza — so a good converter must ",[19,20,21],"em",{},"guess"," it. The Arabizi.io engine does this in three layers: a dictionary of real Arabizi spellings, a weighted \"pronunciation lattice\" of every plausible Arabic spelling, and a beam search that ranks those spellings against a 40,000-word Arabic frequency lexicon. It runs entirely in the browser in well under a millisecond per word.",[11,24,25],{},"This article explains the problem and the design in detail. I'm the developer of the engine, so the examples and numbers below come from building and testing it.",[27,28,30],"h2",{"id":29},"the-problem-arabizi-under-specifies-arabic","The problem: Arabizi under-specifies Arabic",[11,32,33,34,37],{},"Arabizi writes how a word ",[19,35,36],{},"sounds",". Arabic spelling encodes several things the sound doesn't make obvious to a Latin-script writer. For every word, a converter has to recover:",[39,40,41,61],"table",{},[42,43,44],"thead",{},[45,46,47,52,55,58],"tr",{},[48,49,51],"th",{"align":50},"left","What's missing",[48,53,54],{"align":50},"Arabizi",[48,56,57],{"align":50},"Possible Arabic",[48,59,60],{"align":50},"Correct",[62,63,64,85,103,121,147,172,193,211,232],"tbody",{},[45,65,66,73,79,82],{},[67,68,69,72],"td",{"align":50},[14,70,71],{},"Vowel length"," — is the vowel written with ا\u002Fو\u002Fي or left out?",[67,74,75],{"align":50},[76,77,78],"code",{},"kitab",[67,80,81],{"align":50},"كتب \u002F كتاب \u002F كيتاب",[67,83,84],{"align":50},"كتاب",[45,86,87,92,97,100],{},[67,88,89],{"align":50},[14,90,91],{},"Emphatic vs. plain consonants",[67,93,94],{"align":50},[76,95,96],{},"sabah",[67,98,99],{"align":50},"سباح \u002F صباح",[67,101,102],{"align":50},"صباح",[45,104,105,110,115,118],{},[67,106,107],{"align":50},[14,108,109],{},"Which h",[67,111,112],{"align":50},[76,113,114],{},"hob",[67,116,117],{"align":50},"هب \u002F حب",[67,119,120],{"align":50},"حب",[45,122,123,129,141,144],{},[67,124,125,128],{"align":50},[14,126,127],{},"Word-final a"," — ة, ا, ى, or nothing?",[67,130,131,134,135,134,138],{"align":50},[76,132,133],{},"jamila"," · ",[76,136,137],{},"marhaba",[76,139,140],{},"mustashfa",[67,142,143],{"align":50},"جميلة · مرحبا · مستشفى",[67,145,146],{"align":50},"(three different endings)",[45,148,149,155,166,169],{},[67,150,151,154],{"align":50},[14,152,153],{},"Hamza seat"," — أ, إ, ؤ, ئ or ء?",[67,156,157,134,160,134,163],{"align":50},[76,158,159],{},"mas2ala",[76,161,162],{},"ra2is",[76,164,165],{},"su2al",[67,167,168],{"align":50},"مسألة · رئيس · سؤال",[67,170,171],{"align":50},"(depends on neighboring vowels)",[45,173,174,179,187,190],{},[67,175,176],{"align":50},[14,177,178],{},"Initial vowel",[67,180,181,134,184],{"align":50},[76,182,183],{},"ana",[76,185,186],{},"islam",[67,188,189],{"align":50},"أنا · إسلام",[67,191,192],{"align":50},"needs أ or إ",[45,194,195,200,205,208],{},[67,196,197],{"align":50},[14,198,199],{},"Doubled consonants",[67,201,202],{"align":50},[76,203,204],{},"sayyara",[67,206,207],{"align":50},"سييارة \u002F سيارة",[67,209,210],{"align":50},"سيارة (written once)",[45,212,213,218,226,229],{},[67,214,215],{"align":50},[14,216,217],{},"Attached words",[67,219,220,134,223],{"align":50},[76,221,222],{},"w7abibi",[76,224,225],{},"bel3arabi",[67,227,228],{"align":50},"و + حبيبي · ب + ال + عربي",[67,230,231],{"align":50},"وحبيبي · بالعربي",[45,233,234,239,247,250],{},[67,235,236],{"align":50},[14,237,238],{},"Assimilated article",[67,240,241,134,244],{"align":50},[76,242,243],{},"assalam",[76,245,246],{},"ennas",[67,248,249],{"align":50},"اسلام \u002F السلام",[67,251,252],{"align":50},"السلام · الناس",[11,254,255,256,259,260,263,264,267,268,267,271,274,275,278,279,282,283,286,287,290],{},"On top of that, Arabizi is ",[14,257,258],{},"not standardized"," and is mostly written in ",[14,261,262],{},"dialect",". The same word can be spelled ",[76,265,266],{},"shukran",", ",[76,269,270],{},"shokran",[76,272,273],{},"choukran"," or ",[76,276,277],{},"shukren",", and ",[76,280,281],{},"2"," can mean hamza (",[76,284,285],{},"2ana",") or, in Cairo and Beirut, ق (",[76,288,289],{},"2albi"," = قلبي).",[27,292,294],{"id":293},"why-letter-by-letter-converters-fail","Why letter-by-letter converters fail",[11,296,297],{},"The simplest approach maps each Latin letter to one Arabic letter and drops short vowels. Before rewriting our engine in October 2026, ours worked mostly that way, with a small dictionary on top. Here is what it produced on ordinary words — real output from that version:",[39,299,300,316],{},[42,301,302],{},[45,303,304,307,310,313],{},[48,305,306],{"align":50},"Input",[48,308,309],{"align":50},"Old output",[48,311,312],{"align":50},"Problem",[48,314,315],{"align":50},"New output",[62,317,318,335,353,370,387,405,422,439,457],{},[45,319,320,324,327,330],{},[67,321,322],{"align":50},[76,323,133],{},[67,325,326],{"align":50},"جملَ",[67,328,329],{"align":50},"dropped the long ī, ended in a stray fatha",[67,331,332],{"align":50},[14,333,334],{},"جميلة",[45,336,337,342,345,348],{},[67,338,339],{"align":50},[76,340,341],{},"kalima",[67,343,344],{"align":50},"كلمَ",[67,346,347],{"align":50},"final -a should be ة",[67,349,350],{"align":50},[14,351,352],{},"كلمة",[45,354,355,359,362,365],{},[67,356,357],{"align":50},[76,358,204],{},[67,360,361],{"align":50},"ساييرَ",[67,363,364],{"align":50},"doubled y written twice",[67,366,367],{"align":50},[14,368,369],{},"سيارة",[45,371,372,376,379,382],{},[67,373,374],{"align":50},[76,375,285],{},[67,377,378],{"align":50},"ءنَ",[67,380,381],{"align":50},"hamza not seated on alif, stray fatha",[67,383,384],{"align":50},[14,385,386],{},"أنا",[45,388,389,394,397,400],{},[67,390,391],{"align":50},[76,392,393],{},"l9ahwa",[67,395,396],{"align":50},"لقهوَ",[67,398,399],{"align":50},"article not recognized",[67,401,402],{"align":50},[14,403,404],{},"القهوة",[45,406,407,411,414,417],{},[67,408,409],{"align":50},[76,410,225],{},[67,412,413],{"align":50},"بلعربي",[67,415,416],{"align":50},"clitic + article not split",[67,418,419],{"align":50},[14,420,421],{},"بالعربي",[45,423,424,428,431,434],{},[67,425,426],{"align":50},[76,427,159],{},[67,429,430],{"align":50},"مسءلَ",[67,432,433],{"align":50},"hamza seat depends on the vowels; ة missing",[67,435,436],{"align":50},[14,437,438],{},"مسألة",[45,440,441,446,449,452],{},[67,442,443],{"align":50},[76,444,445],{},"john",[67,447,448],{"align":50},"جهن",[67,450,451],{"align":50},"silent h, vowel dropped",[67,453,454],{"align":50},[14,455,456],{},"جون",[45,458,459,464,467,470],{},[67,460,461],{"align":50},[76,462,463],{},"jennifer",[67,465,466],{"align":50},"جننفر",[67,468,469],{"align":50},"foreign names spell every vowel",[67,471,472],{"align":50},[14,473,474],{},"جينيفر",[11,476,477],{},"Each fix in that last column needs knowledge that isn't in the letters: Arabic morphology (ة endings, the article), orthography rules (hamza seats), and the vocabulary itself (that جميلة is a word and جملة is a different one).",[27,479,481],{"id":480},"layer-1-a-dictionary-of-real-arabizi-spellings","Layer 1: a dictionary of real Arabizi spellings",[11,483,484,485,267,487,267,489,491,492,495],{},"The first thing the engine does is look the word up in a curated dictionary: several hundred common words and expressions across Modern Standard Arabic and the four big dialect groups (Egyptian, Levantine, Gulf, Maghrebi), plus several hundred personal names. Each entry lists the spelling variants people actually type, so ",[76,486,266],{},[76,488,270],{},[76,490,273],{}," and ",[76,493,494],{},"chokran"," all map to شكراً.",[11,497,498,499,502],{},"Before giving up on the dictionary, the engine ",[14,500,501],{},"peels off clitics"," — the one-letter words Arabic attaches to the next word — and tries again:",[504,505,506,516,525,534,544],"ul",{},[507,508,509,511,512,515],"li",{},[76,510,222],{}," → و + ",[76,513,514],{},"7abibi"," → وحبيبي",[507,517,518,520,521,524],{},[76,519,225],{}," → ب + ال + ",[76,522,523],{},"3arabi"," → بالعربي",[507,526,527,529,530,533],{},[76,528,393],{}," → ال + ",[76,531,532],{},"9ahwa"," → القهوة",[507,535,536,539,540,543],{},[76,537,538],{},"fil-madrasa"," → في + ال + ",[76,541,542],{},"madrasa"," → في المدرسة (two words in Arabic)",[507,545,546,548],{},[76,547,243],{}," → sun-letter article → السلام",[11,550,551],{},"Dictionary hits always rank first, because for frequent words a human-curated spelling beats any statistical guess.",[27,553,555],{"id":554},"layer-2-the-pronunciation-lattice","Layer 2: the pronunciation lattice",[11,557,558,559,562],{},"For everything else, the engine builds a ",[14,560,561],{},"lattice",": a graph where each Latin unit expands into every Arabic reading it could have, each with a cost (lower is more likely). A simplified excerpt:",[39,564,565,575],{},[42,566,567],{},[45,568,569,572],{},[48,570,571],{"align":50},"Latin unit",[48,573,574],{"align":50},"Arabic options (cost)",[62,576,577,587,597,607,623,645,656,666,677,687,700],{},[45,578,579,584],{},[67,580,581],{"align":50},[76,582,583],{},"s",[67,585,586],{"align":50},"س (0) · ص (0.5)",[45,588,589,594],{},[67,590,591],{"align":50},[76,592,593],{},"h",[67,595,596],{"align":50},"ه (0) · ح (0.3)",[45,598,599,604],{},[67,600,601],{"align":50},[76,602,603],{},"t",[67,605,606],{"align":50},"ت (0) · ط (0.5)",[45,608,609,620],{},[67,610,611,267,614,267,617],{"align":50},[76,612,613],{},"sh",[76,615,616],{},"kh",[76,618,619],{},"gh",[67,621,622],{"align":50},"ش · خ · غ (0)",[45,624,625,639],{},[67,626,627,267,630,267,633,267,636],{"align":50},[76,628,629],{},"3",[76,631,632],{},"7",[76,634,635],{},"5",[76,637,638],{},"9",[67,640,641,642,644],{"align":50},"ع · ح · خ · ق (0); ",[76,643,638],{}," also ص (0.4)",[45,646,647,653],{},[67,648,649,650],{"align":50},"internal ",[76,651,652],{},"a",[67,654,655],{"align":50},"nothing (0) · ا (0.35)",[45,657,658,663],{},[67,659,649,660],{"align":50},[76,661,662],{},"i",[67,664,665],{"align":50},"nothing (0.05) · ي (0.3)",[45,667,668,674],{},[67,669,670,671,673],{"align":50},"final ",[76,672,652],{}," (long word)",[67,675,676],{"align":50},"ة (0) · ا (0.15) · ى (0.5)",[45,678,679,684],{},[67,680,670,681],{"align":50},[76,682,683],{},"an",[67,685,686],{"align":50},"ـاً tanween (0) · ان (0.3)",[45,688,689,697],{},[67,690,691,692,694,695],{"align":50},"initial ",[76,693,652],{}," \u002F ",[76,696,662],{},[67,698,699],{"align":50},"أ \u002F إ (0) · ا (0.3)",[45,701,702,707],{},[67,703,704,706],{"align":50},[76,705,281],{}," between vowels",[67,708,709],{"align":50},"أ · ئ · ؤ — cheapest one depends on the neighboring vowels",[11,711,712],{},"A few context rules shape the costs:",[504,714,715,731,747,753],{},[507,716,717,720,721,267,724,491,727,730],{},[14,718,719],{},"The last vowel of a word that ends in a consonant is probably long."," In Arabic nouns like ",[19,722,723],{},"kitāb",[19,725,726],{},"salām",[19,728,729],{},"jamīl"," the final syllable's vowel is long, so writing its mater (ا\u002Fو\u002Fي) is made cheaper there.",[507,732,733,736,737,267,740,267,743,746],{},[14,734,735],{},"Doubled consonants are written once"," (",[76,738,739],{},"ss",[76,741,742],{},"yy",[76,744,745],{},"77","), because Arabic marks gemination with an optional shadda rather than a second letter.",[507,748,749,752],{},[14,750,751],{},"A capital S, D, T, Z or H"," is a hint for the emphatic letter (ص ض ط ظ ح) — except at the start of a word, where it's usually just capitalization.",[507,754,755,758,759,761],{},[14,756,757],{},"s+h, k+h, g+h read separately"," are heavily penalized, so ",[76,760,613],{}," is ش and not سه.",[27,763,765],{"id":764},"layer-3-ranking-with-a-frequency-lexicon","Layer 3: ranking with a frequency lexicon",[11,767,768,769,772,773,776],{},"A lattice for an eight-letter word can encode thousands of spellings. To pick the right one, the engine runs a ",[14,770,771],{},"beam search"," left to right and, once the lexicon is loaded, ",[14,774,775],{},"prunes every path that isn't the beginning of a real Arabic word",". The prefix check is a binary search over a sorted list of 40,000 words, so it costs microseconds.",[11,778,779],{},"Each complete spelling gets a score:",[781,782,783],"blockquote",{},[11,784,785,788],{},[14,786,787],{},"score = lattice cost + 0.3 × ln(frequency rank + 1)",", or lattice cost + 4 if the spelling isn't in the lexicon",[11,790,791,792,798,799,802],{},"So a common word with a slightly unusual mapping (جميلة, rank ~350) beats a rare word or a non-word with a cheaper mapping. The lexicon comes from the open ",[652,793,797],{"href":794,"rel":795},"https:\u002F\u002Fgithub.com\u002Fhermitdave\u002FFrequencyWords",[796],"nofollow","FrequencyWords"," list built from Arabic film subtitles (CC BY-SA 4.0), cleaned of diacritics and noise. Subtitles turn out to be an excellent source for this job: they contain conversational vocabulary ",[19,800,801],{},"and"," thousands of foreign names already written in Arabic — جون, مايكل, جينيفر — which is exactly what people type.",[11,804,805],{},"The top-ranked spelling is inserted as you type; the next candidates appear as chips you can pick with a click or the Tab key.",[27,807,809],{"id":808},"names-need-different-rules","Names need different rules",[11,811,812,813,816,817,821,822,825],{},"Foreign names are spelled differently from native Arabic words: ",[14,814,815],{},"every vowel is written out"," so the name can be read (Peter → بيتر, Lucas → لوكاس), and a final -a is usually ا, not ة (Maria → ماريا). When the ",[652,818,820],{"href":819},"\u002Fname-in-arabic","name in Arabic tool"," calls the engine, it switches on a ",[19,823,824],{},"name mode"," that makes dropping a vowel expensive and disables tanween. Without it, short common words win — \"Theo\" would come out as ذو (\"possessor of\") instead of ثيو.",[27,827,829],{"id":828},"arabic-back-to-arabizi","Arabic back to Arabizi",[11,831,832,833,837,838,840,841,843,844,847,848,851,852,855],{},"The reverse direction is easier but has its own trap: unvocalized Arabic doesn't say which short vowels to write. The ",[652,834,836],{"href":835},"\u002Farabic-to-arabizi","Arabic to Arabizi converter"," uses a reverse dictionary for common words (قهوة → ",[76,839,532],{},", حبيبي → ",[76,842,514],{},") and a letter-level mapping for the rest. When the input carries tashkeel it follows the marks exactly — shadda doubles the consonant (مُحَمَّد → ",[76,845,846],{},"mu7ammad","), the article assimilates before sun letters (الشَّمْس → ",[76,849,850],{},"ash-shams","), and a final ة takes its pausal form (المَدْرَسَةِ → ",[76,853,854],{},"al-madrasa",").",[27,857,859],{"id":858},"performance-and-privacy","Performance and privacy",[504,861,862,868,874],{},[507,863,864,867],{},[14,865,866],{},"Size:"," the lexicon is ~470 KB of text, about 166 KB gzipped, downloaded once after the page has rendered, so it doesn't slow the first paint. Until it arrives, the dictionary and lattice already work.",[507,869,870,873],{},[14,871,872],{},"Speed:"," roughly 0.1–1 ms per word on a laptop, fast enough to re-run on every keystroke.",[507,875,876,879],{},[14,877,878],{},"Privacy:"," everything runs on your device. No keystrokes, words or text are sent to a server.",[27,881,883],{"id":882},"known-limitations","Known limitations",[11,885,886],{},"No Arabizi converter can be perfect, because the input genuinely lacks information:",[504,888,889,899,905],{},[507,890,891,894,895,898],{},[14,892,893],{},"Context-dependent words."," ",[76,896,897],{},"3am"," can be عام (\"year\") or Levantine عم (the \"-ing\" particle); the engine picks one by frequency. A future version will look at neighboring words.",[507,900,901,904],{},[14,902,903],{},"Rare dialect words"," that aren't in the dictionary or lexicon fall back to a phonetic spelling, which is readable but not always the conventional one.",[507,906,907,910],{},[14,908,909],{},"Unvocalized Arabic → Arabizi"," can only guess short vowels for uncommon words.",[11,912,913],{},"That's why every choice is visible and reversible: the alternatives are always one click away.",[27,915,917],{"id":916},"try-it","Try it",[504,919,920,928,935],{},[507,921,922,923,927],{},"Type with English letters on the ",[652,924,926],{"href":925},"\u002F","Arabic keyboard",".",[507,929,930,931,927],{},"Paste a message into the ",[652,932,934],{"href":933},"\u002Farabizi-to-arabic","Arabizi to Arabic converter",[507,936,937,938,927],{},"See how ",[652,939,941],{"href":940},"\u002Fblog\u002Farabizi-across-dialects","Arabizi differs across dialects",[27,943,945],{"id":944},"related-reading","Related reading",[504,947,948,954,960],{},[507,949,950],{},[652,951,953],{"href":952},"\u002Fblog\u002Farabizi-numbers-chart-explained","Arabizi numbers chart",[507,955,956],{},[652,957,959],{"href":958},"\u002Fblog\u002Fwhat-is-arabizi-arabic-chat-alphabet","What is Arabizi?",[507,961,962],{},[652,963,965],{"href":964},"\u002Fblog\u002Fbest-yamli-alternatives","Yamli not working? The best alternatives",{"title":967,"searchDepth":968,"depth":968,"links":969},"",3,[970,972,973,974,975,976,977,978,979,980,981],{"id":29,"depth":971,"text":30},2,{"id":293,"depth":971,"text":294},{"id":480,"depth":971,"text":481},{"id":554,"depth":971,"text":555},{"id":764,"depth":971,"text":765},{"id":808,"depth":971,"text":809},{"id":828,"depth":971,"text":829},{"id":858,"depth":971,"text":859},{"id":882,"depth":971,"text":883},{"id":916,"depth":971,"text":917},{"id":944,"depth":971,"text":945},"Engineering","2026-10-24","A transliteration engineer's look at converting Arabizi to Arabic: the information Latin script leaves out, why letter-by-letter mapping fails, and how a dictionary + lattice + lexicon ranking engine fixes it.","md","\u002Fblog\u002Fhow-arabizi-transliteration-works.webp","The Arabizi word 7abibi converted to the Arabic حبيبي","arabizi transliteration algorithm, arabizi to arabic conversion, how yamli works, arabic transliteration engine, franco to arabic algorithm, arabic nlp transliteration",{},true,"\u002Fblog\u002Fhow-arabizi-transliteration-works",11,{"title":5,"description":984},"How Arabizi to Arabic Transliteration Works",{"loc":991,"lastmod":983},"blog\u002Fhow-arabizi-transliteration-works",[998,999,1000,1001],"arabizi","transliteration","arabic nlp","franco arabic","GvZhfgIZL6yTbK3GiZY-eF52zCUR2ZqqvFl5Oxg9eGw",[1004,1011,1018],{"path":958,"title":1005,"category":1006,"tags":1007,"date":1009,"score":1010},"What Is Arabizi? The Complete Guide to the Arabic Chat Alphabet","Learn",[998,1008,1001,999],"arabic chat alphabet","2026-06-08",6,{"path":940,"title":1012,"category":1006,"tags":1013,"date":983,"score":1017},"Arabizi Across Dialects: Egyptian Franco, Levantine, Gulf and Moroccan Darija Compared",[998,1001,1014,1015,1016],"arabic dialects","darija","arabizi numbers",4,{"path":952,"title":1019,"category":1006,"tags":1020,"date":1021,"score":1017},"Arabizi Numbers Chart: What 2, 3, 5, 6, 7, 8 and 9 Mean in Arabic Texting",[1016,1001,1008,998],"2026-06-05",1792888365431]