OCR (optical character recognition) is the technology that reads the text in an image or a scanned document and turns it into digital text you can search, copy or pass to another program. Modern engines use machine learning and recognise printed text and, in some languages such as English and Spanish, handwriting too.
In practice
Microsoft sums it up like this: OCR extracts printed or handwritten text from posters, labels or documents such as forms and invoices, and removes or greatly reduces the need for manual data entry. Its engine returns pages, lines and words with their position and a confidence score.
In a small business it is used to:
- Search scanned deeds, contracts or meeting minutes by what they say, not by the file name.
- Read paper invoices or scanned PDFs before they go to the accounts.
- Pull the date from a scanned certificate to send a reminder before it expires.
- Prepare old documents so that an assistant using RAG can look things up in them.
OCR only gives you the text. Pulling out specific fields, such as the tax ID or the total on an invoice, is a further step: Microsoft calls it intelligent document processing and builds it on top of OCR. A language model can also do that step. Anthropic explains that when you send Claude a PDF, it converts each page into an image and passes the extracted text alongside. For invoices, Spanish law gives you the list of fields: number and series, date, the issuer's tax ID (NIF), tax rate and tax amount, among others (Royal Decree 1619/2012, the invoicing regulation, art. 6).
Where it runs matters. Tesseract is an open-source engine (Apache 2.0 licence) that recognises more than 100 languages and runs on your own computer. Microsoft's engine runs in its cloud or in a container installed on your servers. If a provider runs OCR in its cloud on documents that contain personal data, it is your data processor.
There are more examples in automating business processes with AI and AI for property managers in Spain.
Common mistakes
- Poor scans. Tesseract's documentation says it works best at 300 dpi or more, that a skewed page makes results much worse and that dark scanner borders can be read as extra characters.
- Taking the text at face value. An 8 read as a 3 changes an amount. Combine OCR with rules that check what can be checked, such as the net amount plus VAT equalling the total, and send anything that does not add up to a person.
- Forgetting that scanned text is third-party content too. Anthropic lists the OCR output of an uploaded file among the routes for prompt injection: a document can carry orders aimed at the model that reads it later.