Skip to content

Why Nastaliq is the hardest script for OCR

By Tabish Zaidi, Founder, Arabian AI Lab, Dubai — Last updated: 23 October 2026

Nastaliq is the hardest script for OCR because it breaks almost every assumption that OCR was built on. Most OCR was designed for Latin script: letters that sit on a baseline, keep their shape, and separate cleanly into words. Nastaliq does none of those things reliably. It slopes, stacks, joins in context-dependent ways, and uses dots and marks that change meaning entirely if they are lost. That is why a tool that reads English or even Arabic Naskh well can still fail badly on Urdu Nastaliq — and why LexaOCR gives Nastaliq its own dedicated reader.

It slopes and stacks

In Naskh, and in Latin script, text runs along a baseline. In Nastaliq, the line slopes downwards from right to left, and words stack vertically as well as running horizontally. A line of Nastaliq is not a row of letters; it is a cascade.

For OCR, that means the first step — finding lines and words — is already hard. A system that cuts a page into horizontal strips will cut through words, merge lines, or both. LexaOCR's layout step has to understand the slope and the stacking before any letter can be read, and columns, headings and verse must come back in reading order, not in the order a naive strip-cutting algorithm found them.

Letters change shape, and dots change meaning

Like other Arabic-script writing, Nastaliq letters join and change shape depending on their neighbours. Unlike Naskh, the joins are more fluid, and the same letter can look very different in different positions and in different typefaces.

Worse for OCR, meaning often hangs on a dot. The dots that separate similar letters are small, and in old or low-resolution prints they fade, merge or disappear. A scanner that smooths an image — a common default — can erase exactly the information that distinguishes one word from another. That is why LexaOCR straightens and cleans pages without smoothing filters: the dots must survive.

Words are not separated the way OCR expects

Latin OCR assumes words are separated by spaces. Nastaliq, like other Arabic-script writing, joins letters within words, and word boundaries in print can be ambiguous, especially in older books with tight typesetting. A system trained on Latin spacing will either split words that should stay together or join words that should stay apart, and both errors then cascade: a dictionary check on a wrongly split word will fail, and a human reviewer will have to fix a problem the OCR created, not a problem in the original.

Typefaces and print quality vary enormously

Urdu printing spans a century of typefaces, from crisp modern Nastaliq fonts to old lithographic prints with uneven ink, broken type and bleed-through. A model trained on one clean modern font will not generalise to the others. This is also why a single accuracy number for "Urdu OCR" is meaningless without a sample set: accuracy depends on the print, the scan and the typeface, not just on the tool.

LexaOCR's answer to that variation is redundancy, not a single clever reader: several independent readers read every line, a dictionary checks every word (146,000 Urdu words), and a linguist agent resolves disagreements. Where the readers agree, the word is almost certainly right. Where they disagree, the word is flagged for a human eye — and that flagged set is small enough to review.

What this means in practice

If you are digitising Urdu books, three things matter more than the choice of OCR tool alone:

  1. Scan well. 300 DPI or higher, flat pages, even light, no smoothing. A good scan is worth more than a better model on a bad scan.
  2. Use the quality check. LexaOCR's free quality check forecasts accuracy page by page before anything is processed. Rescan low-scoring pages first.
  3. Review the flagged words, not the whole book. If you are proofreading every word, the OCR has not done its job. The flagged-word workflow is the test of whether a Nastaliq OCR system actually works.

Frequently asked questions

Is Nastaliq harder than Naskh for OCR? Yes, in practice. Naskh sits on a baseline and is closer to the assumptions Latin OCR was built on. Nastaliq slopes, stacks and joins more fluidly, which makes line-finding, word segmentation and dot preservation harder.

Can LexaOCR read handwritten Nastaliq? Not yet. LexaOCR is built for printed text only.

What does LexaOCR return for a Nastaliq book? Editable text in the original layout, a clean Word file, a review edition with each page beside its text, a searchable PDF and plain text, plus listen-aloud audio and one-click hand-off to LEXA Translate.

Is LexaOCR free? LexaOCR is free during the beta. The plans that follow are on the pricing page.

Try it

Upload one page of a printed Urdu book, run the free quality check, and look at two things: the forecast for that page, and how many words are flagged afterwards. Those two numbers tell you more about Nastaliq OCR than any marketing claim.

Related