---
title: "Arabic OCR vs vision LLM for invoices and documents | BroadRouter"
description: "When to use classic OCR and when a vision LLM for Arabic invoices, receipts and forms: accuracy traps, JSON output, cost per page and a validation pipeline."
url: https://broadrouter.com/blog/arabic-ocr-vision-llm/
lang: en
updated: 2026-11-14
publisher: BroadRouter (a BroadNet site); API by BroadNet Inference, https://inference.broadnet.ai
---

# Arabic OCR vs vision LLMs: reading Arabic documents and invoices

By the BroadNet Inference team · 5 min read · Published 2026-11-14

Classic OCR turns Arabic page images into raw text; a vision LLM reads the image and returns the fields you ask for, such as vendor, date and total, as JSON. For invoices and receipts a vision LLM usually saves the parsing step. On BroadNet Inference, Qwen3.8 27B, DeepSeek V4.1 Flash and BroadNet Gemma 4 VL 26B accept images.

## Key takeaways

-   Arabic OCR is hard because letters join, change shape by position and depend on dots; mixed Arabic and English lines add bidirectional ordering problems.
-   Classic OCR gives you text and positions. A vision LLM gives you meaning: named fields, translated labels, structured JSON.
-   Always validate numbers in code: totals equal line sums, VAT matches the rate, dates parse.
-   On pay-as-you-go an image is billed as input tokens, so resize large photos before sending.
-   Use OCR when you need full-text search of long scanned books; use a vision LLM for documents you need to act on.

**On this page**

1.  Why is Arabic OCR hard?
2.  OCR or vision LLM: what does each give you?
3.  How do you read an Arabic invoice with a vision LLM?
4.  How do you catch misread numbers?
5.  Which vision model should read Arabic documents?
6.  What does a vision LLM cost per page?
7.  When does classic OCR still win?
8.  Privacy

_[image: Parcels on a conveyor labelled "FRAGILE", "ZERBRECHLICH" and "取扱注意", with the text "From printed text to useful data."]_

For Arabic invoices, receipts and forms you need to act on, use a [vision LLM](https://broadrouter.com/glossary/vision-language-model/): it reads the image and returns the fields you ask for, such as vendor, VAT number, date and total, as JSON. Use classic [optical character recognition (OCR)](https://broadrouter.com/glossary/ocr/) for full-text search of long scanned pages or offline work. Either way, check numbers in code.

Arabic makes both routes harder than they are for English, for the reasons below.

## Why is Arabic OCR hard?

-   **Connected script.** Arabic letters join, and most have up to four shapes (isolated, initial, medial, final). OCR engines must segment a word they cannot see the edges of.
-   **Dots carry meaning.** ب ت ث ن ي share one base shape and differ only by dots. A low-resolution scan or a crease can turn one letter into another.
-   **Two directions on one line.** An invoice line such as “المجموع: 1,250.00 SAR” mixes right-to-left Arabic with left-to-right numbers and Latin text. OCR output often comes back in the wrong visual order, which the [Unicode bidirectional algorithm](https://www.unicode.org/reports/tr9/) then reorders again when displayed.
-   **Two digit sets.** Gulf and Egyptian documents often print Eastern Arabic numerals (٠١٢٣٤٥٦٧٨٩) instead of 0–9, sometimes both on the same page.
-   **Fonts and stamps.** Decorative Naskh and Ruq’ah headings, company stamps over the total and thermal-receipt fading all hurt recognition.

## OCR or vision LLM: what does each give you?

|  | Classic OCR | Vision LLM |
| --- | --- | --- |
| Output | Raw text, often with word positions | Whatever you ask for: fields, JSON, a summary, a translation |
| Layout understanding | You write rules or templates | The model infers it (“the total is at the bottom right”) |
| New invoice layouts | New template or rule | Usually works without changes |
| Translation | Separate step | Same request |
| Predictability | Deterministic for the same input | Can vary; validate outputs |
| Hallucination risk | Low (misreads, but does not invent) | Real: can produce a plausible but wrong value |
| Best for | Full-text search of long scanned documents, archives | Invoices, receipts, IDs, forms you need to act on |

The key trade-off: OCR misreads but does not invent. A vision LLM understands, but can [hallucinate](https://broadrouter.com/glossary/hallucination/) a plausible value. A good pipeline uses the LLM for understanding and code for checking.

## How do you read an Arabic invoice with a vision LLM?

Send the image as a base64 data URL inside the message content and ask for exactly the fields you want. The [vision invoice guide](https://broadrouter.com/guides/read-arabic-invoices-with-vision/) has the full walk-through; the core looks like this:

```python
import base64, json, os
from openai import OpenAI

client = OpenAI(base_url="https://inference.broadnet.ai/v1", api_key=os.environ["BROADNET_API_KEY"])
image = base64.b64encode(open("invoice.jpg", "rb").read()).decode()

prompt = """Read this invoice. Reply with JSON only, using these keys:
vendor_name (as written, Arabic script if Arabic), vendor_vat_number, invoice_number,
invoice_date (YYYY-MM-DD), currency (ISO code), subtotal, vat_amount, total,
line_items (list of {description, quantity, unit_price, amount}).
Convert Eastern Arabic numerals to Western digits. Use null for anything you cannot read."""

r = client.chat.completions.create(
    model="broadnet/qwen3.8-27b",
    max_tokens=3000,  # reasoning comes first
    messages=[{"role": "user", "content": [
        {"type": "text", "text": prompt},
        {"type": "image_url", "image_url": {"url": "data:image/jpeg;base64," + image}},
    ]}],
)
data = json.loads(r.choices[0].message.content)
```

Three details that save debugging time:

1.  **Say which numeral system you want.** “Convert Eastern Arabic numerals to Western digits” avoids a mix of ١٢٥٠ and 1250 in your database.
2.  **Ask for `null`, not a guess.** Models are more likely to invent a value when every key must be filled.
3.  **Keep names in the original script.** Transliterating “مؤسسة النور للتجارة” into Latin letters invites spelling variants. Store the Arabic and translate separately if you need English.

If the model returns an empty answer, it ran out of `max_tokens` while reasoning; see [reasoning tokens and empty responses](https://broadrouter.com/guides/reasoning-tokens-empty-response/). For a stricter JSON shape, see [structured output with JSON schema](https://broadrouter.com/blog/structured-output-json-schema/); the free [JSON schema generator](https://broadrouter.com/tools/json-schema-generator/) builds a schema from a sample invoice.

## How do you catch misread numbers?

Treat every extracted value as a claim to check in code, not as data. Line items must sum to the subtotal, subtotal plus VAT must equal the total, dates must parse and not be in the future, and the currency should match the vendor’s country. Saudi VAT numbers have a fixed length and format, which makes a cheap extra check. A misread digit almost always breaks a sum, so arithmetic checks catch most of the errors that matter. Anything that fails goes to a human review queue with the image beside the extracted fields.

The full pipeline, with a Pydantic schema, arithmetic validators, one retry with the error message and a review queue, is in [extract invoice and receipt data to JSON with a vision LLM](https://broadrouter.com/blog/extract-data-from-documents-with-vision-llm/).

## Which vision model should read Arabic documents?

Three chat models on BroadNet Inference accept images:

| Model | Input / output per 1M tokens | Context | Notes |
| --- | --- | --- | --- |
| [Qwen3.8 27B](https://broadrouter.com/models/qwen3.8-27b/) | $0.175 / $2.17 | 262,144 | The model BroadNet tested in Arabic |
| [DeepSeek V4.1 Flash](https://broadrouter.com/models/deepseek-v4.1-flash/) | $0.175 / $0.52 | 1,048,576 | Also on unlimited flat plans |
| [BroadNet Gemma 4 VL 26B](https://broadrouter.com/models/gemma-4-vl-26b/) | $0.10 / $0.22 | 32,768 | Cheapest of BroadNet’s vision models; works on free credit and the $0.50 hourly key |

BroadNet reports that Qwen3.8 27B wrote fluent Arabic, understood Gulf and Egyptian dialects and translated Arabic and English accurately in its tests. BroadNet does not publish an OCR or document-extraction benchmark, so measure field accuracy on your own documents. A practical setup is Gemma 4 VL 26B for simple receipts and a second pass with Qwen3.8 27B for anything that fails validation. The [Gemma 4 VL 26B vs Qwen3.8 27B comparison](https://broadrouter.com/compare/gemma-4-vl-26b-vs-qwen3.8-27b/) sets the two side by side.

## What does a vision LLM cost per page?

On pay-as-you-go keys an image is billed as input tokens at the model’s input price, and larger images use more tokens. Resize phone photos to roughly 1,500–2,000 pixels on the long side: Arabic dots need enough resolution, but a 12-megapixel photo mostly adds cost. Read `usage.prompt_tokens` on a few real images to get your cost per page. On an unlimited DeepSeek V4.1 Flash plan, BroadNet’s docs say images are part of the plan’s unlimited use. The token math per image and per page is worked out in [vision LLM cost per image](https://broadrouter.com/blog/cheapest-vision-llm-api/).

## When does classic OCR still win?

-   **Long scanned books and archives** where you need every word for search, not a few fields.
-   **Strict reproducibility,** where the same input must always produce the same text.
-   **Offline or on-device** processing with no network.

Open-source engines such as [Tesseract](https://tesseract-ocr.github.io/tessdoc/Data-Files-in-different-versions.html) list Arabic (`ara`) trained data and run offline. A hybrid also works well: OCR the page for searchable text, and send the image to a vision LLM for the fields you act on. Which cloud OCR APIs list Arabic, printed and handwritten, and what each costs per 1,000 pages is in the [Arabic OCR API comparison](https://broadrouter.com/blog/arabic-ocr-api-comparison/).

## Privacy

Invoices and IDs contain names, tax numbers and bank details. BroadNet Inference does not retain images, prompts or answers after the request; see [zero data retention](https://broadrouter.com/zero-data-retention/). Apply the same rule to your own storage: keep the extracted fields you need and delete images you no longer have to keep.

Free tools for this

-   [Arabic token counter](https://broadrouter.com/tools/arabic-token-counter/) Arabic vs English token counts per tokenizer: the "Arabic tax" in tokens and money.
-   [Arabic text normalizer](https://broadrouter.com/tools/arabic-text-normalizer/) Tashkeel, tatweel, alef, ya, ta marbuta, digits and invisible characters, with a matching Python function.
-   [Speech-to-text cost calculator](https://broadrouter.com/tools/speech-to-text-cost-calculator/) Hours, calls or voice notes to a monthly transcription bill, against your current provider.

[All free tools](https://broadrouter.com/tools/)

## Terms in this article

[Token](https://broadrouter.com/glossary/token/)

A token is the unit of text a language model reads and writes: a word, part of a word, a punctuation mark or a byte sequence produced by the model's tokenizer. LLM APIs count, limit and usually bill usage in tokens.

[Hallucination](https://broadrouter.com/glossary/hallucination/)

A hallucination is output from a language model that sounds plausible but is false, made up or not supported by the input it was given, such as an invented citation, a wrong number or a fabricated API. It comes from the model predicting likely text rather than checking facts.

[JSON Schema](https://broadrouter.com/glossary/json-schema/)

JSON Schema is a vocabulary, written in JSON, for describing and validating the structure of JSON data: types, required fields, allowed values and nesting. The current version is 2020-12. LLM APIs use it to define tool parameters and the exact shape a structured output must follow.

[Optical character recognition (OCR)](https://broadrouter.com/glossary/ocr/)

Optical character recognition (OCR) is technology that detects and converts printed or handwritten text in an image, scan or PDF into machine-readable characters. Classic OCR outputs text and its position on the page; vision-language models can read text and answer questions about it directly.

[Vision-language model](https://broadrouter.com/glossary/vision-language-model/)

A vision-language model (VLM) is a model that takes images and text together as input and produces text, so it can describe pictures, answer questions about them and read documents, charts or screenshots. VLMs are also called image-text-to-text or multimodal models.

[Input and output tokens](https://broadrouter.com/glossary/input-and-output-tokens/)

Input tokens are the tokens a language model reads in a request, including the system prompt, conversation history, tool definitions and images. Output tokens are the tokens it generates in reply, including any reasoning. LLM APIs usually price them separately, and output usually costs more.

[Pay-as-you-go](https://broadrouter.com/glossary/pay-as-you-go/)

Pay-as-you-go is a pricing model in which you pay only for what you use, metered per unit such as tokens, requests or audio minutes, with no subscription or minimum commitment. Most LLM APIs bill this way, from a prepaid balance or a periodic invoice.

[Reasoning tokens](https://broadrouter.com/glossary/reasoning-tokens/)

Reasoning tokens are tokens a reasoning model generates to work through a problem before it writes its visible answer. They are usually billed as output tokens, count toward the output limit and the context window, and may be hidden or summarized by the API.

## Questions

### Is a vision LLM more accurate than OCR for Arabic?

It depends on the document. Vision LLMs are usually better at understanding layout and pulling named fields from invoices and receipts. Dedicated OCR can be more predictable on long, clean printed pages. Test both on a sample of your documents.

### Can vision LLMs read handwritten Arabic?

Sometimes, on clear handwriting. Accuracy drops quickly with cursive or rushed writing. Route low-confidence handwritten fields to a human reviewer.

### Which BroadNet model is cheapest for reading images?

BroadNet Gemma 4 VL 26B, at $0.10 per 1M input tokens. It also works on the free starting credit and with a flat-price hourly key.

### How do I convert Eastern Arabic numerals to Western digits?

Ask the model to return Western digits, then enforce it in code. In Python, text.translate(str.maketrans("٠١٢٣٤٥٦٧٨٩", "0123456789")) converts any Eastern Arabic digits that slip through. Persian digits (۰–۹) use different code points, so add them if your documents come from Iran or Afghanistan.

### Can the model translate the Arabic labels to English?

Yes. Ask for English keys and keep the original Arabic values, or ask for both. Keep names in the original script to avoid transliteration errors.

## Keep reading

-   [Extract invoice, receipt and form data to JSON with a vision LLM](https://broadrouter.com/blog/extract-data-from-documents-with-vision-llm/)
-   [Cheapest vision LLM API: cost per image and per page, worked out](https://broadrouter.com/blog/cheapest-vision-llm-api/)
-   [Choosing an LLM API for Arabic: what to test](https://broadrouter.com/blog/choosing-an-llm-for-arabic/)
-   [JSON mode vs json\_schema: structured output that holds up](https://broadrouter.com/blog/structured-output-json-schema/)
-   [Add diacritics to Arabic text with an LLM: prompt, checks, DER](https://broadrouter.com/blog/arabic-diacritization-llm/)
-   [Arabic grammar and spelling correction with an LLM: a how-to](https://broadrouter.com/blog/arabic-grammar-spelling-correction-llm/)
-   [Guide: Read Arabic invoices and receipts with a vision model](https://broadrouter.com/guides/read-arabic-invoices-with-vision/)
-   [Guide: Why a reasoning model returns an empty answer](https://broadrouter.com/guides/reasoning-tokens-empty-response/)

Try it on your real workload. New accounts start with $5 of credit for Gemma and transcription. DeepSeek, GLM and Qwen3.8 need a top-up.

[Get started](https://inference.broadnet.ai/account/?utm_source=broadrouter&utm_medium=referral&utm_campaign=blog-arabic-ocr-vision-llm&utm_content=page-cta) ·

**Sources**

-   [BroadNet Inference API reference: chat with an image, images on plans (fetched 2026-11-14)](https://inference.broadnet.ai/docs?utm_source=broadrouter&utm_medium=referral&utm_campaign=blog-arabic-ocr-vision-llm&utm_content=sources)
-   [BroadNet Inference machine-readable prices, pricing.json (fetched 2026-11-14)](https://inference.broadnet.ai/pricing.json?utm_source=broadrouter&utm_medium=referral&utm_campaign=blog-arabic-ocr-vision-llm&utm_content=sources)
-   [Tesseract documentation, trained data files by language including Arabic (fetched 2026-11-14)](https://tesseract-ocr.github.io/tessdoc/Data-Files-in-different-versions.html)
-   [Unicode Standard Annex #9, Unicode Bidirectional Algorithm (fetched 2026-11-14)](https://www.unicode.org/reports/tr9/)
