Skip to main content
Q&A Guide

How to extract text from Urdu Nastaliq documents using OCR?

Complete guide to Urdu Nastaliq OCR. Extract text from scanned Urdu books, poetry, and documents using FastOCR.

Drop your file here

PDF, PNG, JPG, WebP, BMP, HEIC

PDF up to 1 GB · images up to 20 MB

Tips for a clear photo
  • Lay the page flat.
  • Use even light, with no shadows.
  • Turn off the flash to avoid glare.
  • Fill the frame with the page.
Direct Answer
Extracting text from Urdu Nastaliq script requires vision models trained on cursive, connected letters. FastOCR reads printed books and historical lithographs, but accuracy depends on the scan and the script, so check the result. It is built to handle diagonal word slopes, stacked letters, and dots (nuqte) without breaking words apart, exporting clean UTF-8 Urdu text or searchable PDFs.

Why Standard OCR Engines Fail on Urdu Nastaliq Typography

Unlike Arabic Naskh which flows along a flat horizontal line, Urdu Nastaliq is a cursive, hanging script with complex calligraphic rules. Most general OCR tools fail on Nastaliq because of three major differences:

  • Diagonal Word Slopes: Words in Nastaliq slope diagonally downward from top-right to bottom-left. Characters stack on top of one another rather than sitting side-by-side along a flat baseline.
  • Over 28,000 Letter Combinations (Ligatures): While English OCR only needs to recognize 26 letters and Arabic Naskh uses ~500 glyph shapes, Nastaliq uses more than 28,000 unique joined letter combinations. Characters change shape dramatically based on their position in a word.
  • Dot Placement (Nuqte) Determines Meaning: In Urdu, many letters share the exact same base shape and are distinguished only by dots. For example, a single curved stroke can represent Be (ب) with 1 dot below, Pe (پ) with 3 dots below, Te (ت) with 2 dots above, Tte (ٹ) with a small toey above, or Se (ث) with 3 dots above. Basic OCR engines often mistake these dots for scanner noise or dust, transposing character identities completely.

When fed Nastaliq text, generic Western OCR engines produce broken, unreadable output.

Historical Lithographed Books vs. Modern Digital Nastaliq

Urdu document collections generally fall into two categories:

  1. Historical Lithographed Books (Sangi Kutub): Published from the mid-19th century through the late 20th century (such as Naval Kishore editions, Dars-e-Nizami madrasa treatises, and older newspapers). These books were hand-written by master scribes (*katibs*) onto stones before printing. Faded ink, paper yellowing, and irregular spacing make them difficult for standard tools. FastOCR is built to read aged scans of historic lithographs, though results vary with the condition of the page.
  2. Modern Computer-Typeset Nastaliq: Created with software like InPage or modern digital fonts (Jameel Noori Nastaliq, Mehr Nastaliq, Faiz Lahori). These documents feature consistent character shapes, which makes them the easier case.

FastOCR vs. Alternative OCR Engines for Urdu

Feature & MetricFastOCRGoogle Drive OCRTesseract 5 (urd)ABBYY FineReader
Right-to-Left (RTL) Unicode OutputNative RTLInconsistentLeft-to-right bugsGood
Dual-Layer Searchable PDF ExportYes (up to 1GB)Text onlyCLI onlyPaid License
Free Web Access (No Signup Required)YesGoogle accountOpen SourcePaid Trial Only

Step-by-Step: How to Digitize Urdu Books and Documents

  1. Scan at good quality: For best results on older Urdu books or newsprint, scan at 300 to 400 DPI in grayscale or high-contrast color.
  2. Upload to FastOCR: Open the Urdu OCR Tool or the Urdu Homepage. Drag and drop your image (JPG, PNG, WebP) or multi-page scanned PDF.
  3. Automatic AI Processing: FastOCR automatically detects columns, reads Nastaliq ligatures, aligns dots, and preserves right-to-left order in 2 to 5 seconds per page.
  4. Export Clean Text: Copy clean Unicode text directly into MS Word, Google Docs, InPage 3, or WhatsApp, or download a dual-layer Searchable PDF for archiving.

Preserving Urdu Poetry (Ghazals & Nazms) Layouts

Urdu poetry requires careful layout handling. A couplet (*Sher*) is usually arranged into two half-verses (*Misra-e-Oola* and *Misra-e-Saani*) placed side-by-side with empty space between them. Standard OCR tools read straight across the page, jumbling the two lines together. FastOCR uses column-aware layout detection that recognizes the center gutter, keeping each poetic verse intact and properly ordered.

Developer API Integration for Urdu Digital Libraries

Universities, archival foundations, and institutions digitizing large Urdu book collections can automate batch ingestion using the FastOCR Developer API. FastOCR provides asynchronous document processing, status polling, clean UTF-8 text extraction, and dual-layer searchable PDF generation. Check our API Pricing for details on free evaluation quotas.

Frequently Asked Questions

Does FastOCR output Unicode Urdu text compatible with InPage and MS Word?

Yes. FastOCR outputs standard UTF-8 Unicode Urdu text. You can copy and paste the extracted text directly into Microsoft Word, Google Docs, InPage 3 (which natively supports Unicode), web browsers, and messaging apps like WhatsApp without any font converter tools.

Can FastOCR digitize old lithographed (Kitabat/Sangi) Urdu books?

Yes. FastOCR is trained on historical South Asian printings, including 19th and 20th-century lithographic books (Sangi Kutub), Dars-e-Nizami madrasa texts, and historical newspapers. Accuracy depends on the condition of the scan, so check the result.

How does FastOCR handle Urdu poetry (Ghazals & Nazms)?

FastOCR incorporates column-aware reading order algorithms that identify the central gutter between hemistichs (Misra-e-Oola and Misra-e-Saani), preventing words from different poetic lines from being merged together.

Can I create searchable PDFs from scanned Urdu books?

Yes. FastOCR creates dual-layer searchable PDFs where the visual image of each original page scan is preserved, with an invisible, selectable Unicode text layer underneath for full-text searching inside Adobe Acrobat and PDF viewers.

What is the difference between Urdu Nastaliq OCR and Arabic Naskh OCR?

Arabic Naskh flows horizontally across a flat baseline with ~500 ligatures, making it easier for traditional OCR. Urdu Nastaliq slopes diagonally downward from right to left with over 28,000 complex ligatures and cascading letter stacks, requiring deep vision transformer models to separate characters properly.

Can I process multi-page Urdu books in bulk?

Yes. FastOCR accepts multi-page PDF documents up to 1GB in size, processing entire volumes page by page with a visual progress bar.