Dijit.app
OCR

Optical character recognition: what it is and how it works

Optical character recognition, OCR, is the technique that turns the image of a document into text: a photographed invoice or a scanned PDF become letters and numbers a program can search and copy. This page explains how it works, what comes out of an OCR, which documents it reads best and where its job ends.

  • From image to text
  • Four stages
  • Which document it reads best
  • Where OCR ends
Paper documents photographed on a warehouse table, ready to go through optical character recognition

What optical character recognition is

An image can be seen. Text can be searched, copied and added up. OCR turns the first into the second.

When an invoice is scanned or photographed, the result is an image: a grid of coloured dots that means nothing to a program. You cannot search for an amount or copy an invoice number. Optical character recognition, OCR, goes over that image, locates the areas with text and recognises each letter and each digit.

The result is text with position: which words are on the page and where they are. It is the first step of any document digitisation. What comes next, knowing which of those texts is the supplier, which the date and which the total, is no longer recognition: it is interpretation.

An image goes in

A scanned PDF, a photo taken with a phone or a digitised copy. Pixels with no text behind them.

OCR does its work

It cleans the image, locates the lines of text, separates the characters and recognises each one.

Text comes out

Letters and numbers with their position on the page, ready to search, copy or pass on to the next phase.

How optical character recognition works

Four stages, from image to text. Each one corrects what the previous one could not resolve.

StageWhat it doesWhat it solves
Image preparation It straightens the page, corrects the skew, raises the contrast and removes marks and shadows. A skewed or poorly lit document becomes legible before anything is recognised.
Text location It separates the text from the background and finds the blocks, lines and words. It tells a table from a paragraph and a stamp from a logo. That the amounts column does not get mixed up with the quantities column.
Character recognition It compares each shape with what it has learnt from millions of letters and digits in different typefaces and decides which character it is. That an 8 is not read as a B and a 1 is not confused with an l.
Text with position It returns the text ordered by lines, with the coordinates of each word on the page. That the next phase knows a number sits next to the word total or in the header.

Which document OCR reads best

Accuracy depends on how the document comes in. Improving the source solves more than correcting the result.

PDF generated by the issuer

The text is already embedded in the file. OCR has nothing to recognise.

Scanned PDF

It needs recognition. With a clean scan, in black and white and not skewed, it reads well.

Photograph

Sensitive to framing, lighting and shadows. The quality of the photo is what most affects how much has to be corrected afterwards.

Thermal receipt or degraded photocopy

The worst case: the original has already lost information. Thermal paper fades with time and heat.

Four things help with a photo: even light, because a shadow over half the page takes whole lines with it; flat paper, because a folded document distorts the numbers; all four edges in the frame, because if the foot is cut off the totals are lost; and a sharp photo, because a blurred one means typing in what cannot be read.

Dijit

Dijit: specialised OCR and generative AI for invoices and packing slips

Dijit's OCR is trained on commercial documents, and the generative AI interprets what the OCR reads: what each piece of data is, line by line.

A packing slip open in Dijit with its lines read, item, quantity and price, and the original image alongside
  • Ultra-accurate and ultra-fast. Up to 99 % accuracy on good-quality PDFs and photos, and under 3 seconds per page on files under 3 MB.
  • No templates per supplier. The generative AI interprets each piece of data by its context. The first invoice from a new supplier is read the same as the hundredth.
  • Header and lines. Issuer, dates, numbers, net amounts, taxes and totals, and each line with its item, quantity, price and discount.
  • Checked before approval. Net plus taxes equals the total, the lines add up to the net and the document is not a duplicate. Each document carries its status.
  • Data in the European Union. The models run on Microsoft Azure, on European servers. Your documents are not used to train models.
  • Free trial. 14 days and 20 credits, no card. One credit is one page.
After OCR

Where OCR ends and data extraction begins

OCR delivers words and numbers. Turning them into the fields of an invoice is another job.

Interpretation

The generative AI decides that the nine-digit number next to the company name is the tax ID, and that the figure at the foot is the total and not a page number.

Validation

It is checked that net plus taxes gives the total, that the lines add up to the net and that the document is not a repeat. The result is the document's status.

Classification

The expense account, the supplier account and the VAT sub-accounts are assigned based on what was done before with that issuer.

Output

The data goes to the accounting software or the ERP by direct posting or by file, or to an Excel file with whatever columns are needed.

Frequently asked questions

What is optical character recognition?

It is the technique that turns the image of a text into actual text. A scanner or a camera produces an image made of pixels. OCR, optical character recognition, locates the lines, words and letters in that image and returns the text with its position on the page.

What is the difference between scanning a document and running OCR on it?

Scanning produces an image: it can be seen, but not searched or copied. OCR turns that image into text. A scanned PDF without OCR is a photo; with OCR, it is a document in which you can search for a word or an amount.

What comes out of an OCR?

Text with position: each word and each number, and where on the page they are. OCR does not know what each thing is. For a program to know which is the supplier, which the date and which the total, one more step is needed, data extraction, which today is done by generative AI.

Which documents does OCR read best?

A PDF generated by the issuer's software already carries the text embedded and needs no recognition. A clean scanned PDF reads well. A photograph depends on framing, light and shadows. A faded thermal receipt or a degraded photocopy is the worst case, because the original has already lost information.

Does OCR read handwritten text?

Yes, with conditions. Accuracy on handwriting depends on the handwriting itself, the format of the form and the quality of the digitised copy. Handwritten job sheets and production sheets are handled with prior tuning on real documents from the business.

Why is OCR alone not enough for an invoice?

Because it returns words and numbers without knowing what they are. A nine-digit number next to a company name is a tax ID, and the figure at the foot is the total and not a page number, but that is decided by interpretation, not recognition. That is why OCR is combined with generative AI, which interprets each piece of data by its context with no templates per supplier.

How accurate is Dijit's OCR with AI?

Up to 99 % accuracy on good-quality PDFs and photos, in under 3 seconds per page on files under 3 MB. On photos four things help: even light, flat paper, all four edges in the frame and a sharp photo.

How much does reading documents with Dijit's OCR cost?

The entry plan costs €40 a month for 100 credits, with no commitment. One credit is one page. The free trial is 14 days and 20 credits, no card.

Free trial

Try Dijit's OCR with AI on your invoices and packing slips

14 days and 20 credits. No card, no commitment and nothing to install.

Two people from the admin team go over the supplier invoice folders at the meeting table