BroadRouter
Get started

Optical character recognition (OCR)

Updated

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.

Also called: optical character recognition, text recognition, image to text, document OCR, scanned text extraction

OCR is the step that turns a photo of a receipt into text a program can search, store or check.

How it works

A classic OCR engine finds text regions on the page, splits them into lines, and recognises the characters in each line. Tesseract, the best-known open-source engine, added an LSTM neural network in version 4 that recognises whole lines, and it can “recognize more than 100 languages” out of the box. Output comes as plain text, hOCR (HTML), PDF, invisible-text PDF, TSV, ALTO or PAGE, so you also get word positions.

Classic OCR stops at characters. To know which number is the total or which line is the supplier name, you add rules or a second model.

Vision-language models take another route. Hugging Face’s image-text-to-text task page describes document question answering as “an OCR-free approach”: the document image goes straight to a vision-language model, which reads it and answers. You can ask for fields directly and get them back as structured output.

Classic OCR (e.g. Tesseract) Vision LLM
Output characters plus positions answers, summaries or JSON fields
Layout understanding limited, needs rules reads tables and labels in context
Runs locally, no per-call fee usually an API, billed per token
Risk misread characters misread characters and invented values

Why it matters

  • Cost. An image sent to an LLM API is billed as input tokens. Local OCR has no per-call charge but needs servers and upkeep.
  • Accuracy checks. A vision model can return a plausible total that is not on the page. Ask it to quote the source text and check sums in code.
  • Arabic. Right-to-left text, joined letter forms and a mix of Arabic and Latin digits all add difficulty. Test any engine or model on your own scans.

On BroadNet Inference

BroadNet does not document a separate OCR endpoint. Its docs show reading an invoice by sending the image as a data: URL to a chat model whose model row lists images or vision, such as DeepSeek V4.1 Flash, BroadNet Gemma 4 VL 26B or Qwen3.8 27B. On a pay-as-you-go key the image counts as input tokens at the model’s input price ($0.10 per 1M on Gemma), and larger images use more tokens. Walk through it in the Arabic invoice guide, and see Arabic OCR with vision LLMs for when classic OCR is still the better tool.

Questions

What is the difference between OCR and a vision LLM?

OCR returns the characters it finds and where they are. A vision LLM reads the image and can answer a question, such as "what is the invoice total?", or return named fields as JSON.

Does BroadNet have an OCR endpoint?

No separate OCR endpoint is documented. You send the image to a vision-capable chat model on /v1/chat/completions and ask for the text or fields you need.

Is classic OCR still worth using?

Yes, for large volumes of clean printed pages where you only need the text and its position. It runs locally with no per-call fee. Vision models are better when you need fields, tables or answers rather than raw characters.

Read as MarkdownAsk ChatGPTAsk ClaudeAsk Perplexity