Why Arabic documents are harder to read than they look
A successful OCR test on a clean English invoice gives an incomplete picture of the documents a multilingual business receives. Identity cards, business licenses, tenancy contracts, and supplier invoices may mix Arabic and English, use several fonts, and arrive as phone photos. An extraction test needs examples of each kind of document the business expects to process.
The Unicode Standard describes the way Arabic letters join. "The Arabic script is cursive, even in its printed form." The same letter takes different shapes depending on how it joins its neighbors, and most letters have four forms (isolated, initial, medial and final). Several letters differ only in their dots, such as ب, ت and ث, so a speck of dust or a low-resolution photo can turn one letter into another. Short vowel marks exist, but in normal writing they are left out, so the same written word can stand for several readings. Printers also stretch words with a joining stroke (tatweel) to justify text, which adds characters that carry no meaning.
An Arabic document can use ASCII digits (0 to 9) or Arabic-Indic digits (٠ to ٩), and Unicode has a separate extended set used for Persian and Urdu. An invoice can use more than one digit set on the same page. For text direction, distinguish storage from display. Unicode stores Arabic in logical order (the order it is read), while the Bidirectional Algorithm decides how it is displayed, with numbers kept in left-to-right order inside a right-to-left line. Text pulled straight from a PDF sometimes comes out in display order instead, which is why copied Arabic can appear reversed, with dates and amounts out of place.
Use Arabic text, mixed digits, and real photos in the first test so you can identify these errors before selecting an extraction service.
Documents to include in your test
Most extraction projects start with a short list of document types. Each has its own difficulties.
Identity cards are small, laminated and often photographed under office lights, so glare and blur are common. The front and back carry different fields, and if you accept cards issued over several years, your test set should include each design you actually receive. On bilingual cards, names may appear in both Arabic and English.
Business licenses may come from several issuing authorities, each with its own layout. Activity descriptions can be long, bilingual and close to one another on the page. A license can list several partners or managers, each with a name in both scripts and a nationality.
Invoices and tax documents range from clean digital PDFs to handwritten receipts. Arabic supplier names, Arabic-Indic digits in totals and mixed-language line descriptions are common. The general method for invoice extraction (field specification, per-field accuracy, review thresholds) is in our guide to invoice extraction with human review. This guide adds what changes when Arabic is involved.
Tenancy contracts, certificates and letters are often scans of printed forms with handwritten or typed entries, sometimes with stamps across the text. They need the most review.
Pair Arabic and English fields
On a bilingual document, the same field often appears twice: the Arabic label and value on the right, the English label and value on the left. Treat the pair as one field with two values, not as two unrelated fields, and store both exactly as printed.
A synthetic bilingual license record, as extracted and stored
| Field | Arabic as printed | English as printed |
|---|---|---|
| Trade name | شركة المثال للتجارة العامة | Example General Trading Co. |
| License number | ١٢٣٤٥٦ | 123456 |
| Manager name | محمد أحمد مثال | Mohammed Ahmed Mithal |
| Expiry date | ٢٠٢٧/٠٣/١٥ | 15/03/2027 |
The pairing rule should check that the two halves agree where they can. A license number in Arabic-Indic digits should equal its equivalent in ASCII digits once both are normalized. A date printed in two orders should resolve to the same day. When the halves disagree, the field goes to review, because either the document or the extraction has an error.
Do not translate one half to fill the other. If the English trade name is missing or unreadable, leave it empty and send it for review. Machine translation of a company or personal name produces a third spelling that matches nothing.
Names, transliteration and matching
The same Arabic name can be written in English in many ways. Mohammed, Muhammad and Mohamed are the familiar case, and family names with "Al", "Al-" or "El" vary just as much. A customer's passport, identity card, business license, and bank letter may each use a different English spelling, and all of them are correct for that document.
An exact comparison between the English name on a business license and the English name in the CRM can score two valid spellings as a mismatch. Use the following matching rules.
- Use a verified identity or registration number as the main key if you are authorized to do so and the number is suitable for that use.
- Compare Arabic names in Arabic, after normalization, rather than comparing English transliterations.
- When you must compare English spellings, use a similarity measure and send near matches to a person instead of rejecting them.
- Keep every spelling you have seen for a customer, linked to the document it came from.
Normalization before comparing is essential, and it should be the same in every part of the system. Common Arabic normalization steps include treating the alef forms أ, إ and آ as ا, removing tatweel and short vowel marks, and deciding how to treat ة and ه, and ى and ي, at the end of words. Convert all digits to one set. Record the rules, because a reviewer needs to know why two strings were treated as equal.
Scans, photos and the intake step
Check the image before sending it to OCR. A tilted photo, glare, or a tight crop can obscure the dots and strokes needed to distinguish Arabic letters.
At upload, ask the user to frame the card, avoid glare, and check that the text is sharp before submitting. Reject images below a minimum size and ask again rather than reading a poor image and guessing. For scanned paper, set the scanner to a resolution that keeps the dots on small Arabic letters clear, and avoid aggressive compression.
Keep the original file, with an ID, for as long as your retention policy allows. Reviewers need the original to resolve a doubtful field, and you need it to test the system again later.
Test on your own samples, not a vendor's benchmark
Public Arabic OCR benchmarks and vendor claims can help you form a shortlist. They do not tell you how a product reads your photos of identity cards or your suppliers' invoices. Treat any accuracy figure from a vendor as a claim about its own test data.
Build a test set from documents you have permission to use for that purpose. Label the correct value of every field in both languages. Include phone photos, stamps over text, Arabic-Indic digits, handwritten entries, and older card designs. If you need examples for demonstrations, training or vendor trials outside your own systems, use synthetic documents with invented data, never real customers' IDs.
What an Arabic extraction test should measure
- Accuracy per field and per scriptArabic and English values scored separately
- Digit handlingArabic-Indic and ASCII digits normalized and compared
- Pair agreementHow often the two halves of a bilingual field match
- Image quality groupsResults for scans, clean photos and poor photos shown separately
- Name matchingFalse mismatches against your customer records
- Review rateShare of documents that need a person, and why
Score Arabic values after normalization, and record the normalization version with the result. Otherwise a vendor that drops a vowel mark and one that keeps it will look different when both are right.
Personal data: collect less and keep less
Identity cards, passports, and business licenses that name individuals contain personal data. An extraction system can become a second store of identity documents without anyone deciding whether the business needs it. List the data you need for the service. Check the lawful basis, notice and access requirements, and whether files or results may be transferred to the locations where your provider operates. Confirm these requirements with a qualified advisor.
Extract only the fields the process needs. Decide whether to retain the image after verification and for how long. Mask identity numbers on screens and in logs that need only a partial value. Restrict the review queue to authorized staff. Ask the OCR vendor where it processes and stores documents, whether it uses them to train models, and how it deletes them. Delete test copies after vendor trials, subject to any record you are required to keep.
Questions to ask an Arabic OCR vendor
Vendor demonstrations usually run on clean, well-lit samples. These questions get closer to how the product will behave on your documents.
Which Arabic fields does the product extract as structured fields, and which only as raw text? Many products read Arabic text but return named fields only for the English side. Does it return both Arabic and English values for the same field, and does it link them? How does it output Arabic-Indic digits, and can you choose the output format? Does it return text in logical order, so that what you store can be searched and compared? Does it give a confidence score for Arabic fields, and how does it behave on stamps and handwriting?
Then ask about data. Where are documents processed and stored, for how long, and are they used to improve the vendor's models? Can processing stay in a region you choose? Can you delete documents on request? Get the answers in writing, then run your own test set through a trial account before you sign. A vendor that will not run a trial on your samples, under an agreement that covers the data, is asking you to accept its benchmark on trust.
When verified digital data can replace OCR
Check whether a trusted identity provider, registry, or document issuer can supply the required fields directly. For a portal, a sign-in may identify a returning account, while verified claims or documents are needed to confirm the user's legal name, an identity number, or registration. Confirm what the provider actually verified and the assurance required for your process.
OpenID Connect lets an application authenticate an account and request approved claims. The provider can return a name or other attributes if the account, scope, and agreement permit them. Ask whether it can supply names in both scripts and whether the values come from verified evidence or from the account profile. Only use claims that the application is authorized to receive. Confirm the exact fields using test accounts.
Documents sometimes arrive as verifiable credentials rather than images. The W3C credential data model describes how an issuer can make claims that a holder presents and a verifier checks. Your system still needs to trust the issuer for the relevant claim, validate the credential for the use, and check what data it may retain. Confirm which issuers, attributes, and formats your integration can use.
Plan for both routes. Offer verified digital data when it meets the process requirements. Keep an upload and review route for users or documents the provider cannot cover. Our digital identity sign-in guide for business portals explains the first route. Our document extraction and review service covers the upload route.
Questions buyers ask
How can we tell if an OCR API reads our identity cards reliably?
Quality depends on the document version, image and fields. Test the API on an approved set of samples you expect to receive. Check each field in each script and include the images that usually cause problems. If an approved identity service already supplies the verified fields, see whether the process can use those directly.
Why does Arabic text come out reversed or jumbled from a PDF?
Arabic is stored in logical order and displayed right to left, with numbers displayed left to right inside the line. Some PDFs store text in display order or with letters in joined shapes, so copied or extracted text appears reversed or broken. OCR of the rendered page or a PDF library that handles bidirectional text can often solve this.
Should we store names in Arabic, English or both?
Store both exactly as printed, and record which document supplied each value. Transliterations of the same Arabic name can vary across documents. Use a permitted and verified identity or registration number as the main key when it is available and appropriate.
Can we keep a copy of every identity document we receive?
First check whether you need the image, which lawful basis applies, and how long it can be retained. Many processes can keep the minimum verified fields and a verification record. Ask a qualified advisor about obligations for collection, access, transfer, retention, and deletion.