The short answer
- AI document extraction turns documents such as invoices and delivery notes into structured fields, using OCR, layout-aware models or vision-language models.
- Validate every extracted value with rules, such as checking that line totals add up and that VAT is at a valid UK rate, before trusting any confidence score.
- Link each value to the place on the page it came from, so a reviewer can check it at a glance and you can measure accuracy over time.
AI document extraction is the process of reading documents such as invoices, delivery notes, tenders and forms and turning their contents into structured data, such as a supplier name, a date, line items and totals, that software can use. A dependable system combines a reading method, which can be OCR, a layout model or a vision-language model, with a fixed schema, validation rules and human review for anything uncertain. The model reads the document, and the rules and the review decide what is trusted.
Three ways to read a document
OCR
Optical character recognition (OCR) converts an image of a page into text, with the position of each word. It is mature, cheap and fast, and it understands nothing. It can tell you that “1,240.00” appears near the bottom right of the page, but not that it is the total. Older extraction systems paired OCR with a template for each supplier’s layout, which works for a few fixed formats and breaks when a supplier changes theirs.
Layout models
Layout models, sometimes sold as document AI, use both the text and its position on the page to find fields, tables and key-value pairs. Cloud services from Google, Amazon and Microsoft offer pre-built models for common documents such as invoices and receipts, and most can be customised for your own. They return the position of each field and a confidence score, which makes review easier.
Vision-language models
General-purpose multimodal language models can look at a page image and return the fields you ask for in the format you specify. They handle unfamiliar layouts, handwriting and unusual documents without training, and can follow instructions such as “the delivery address, not the invoice address”. They can also return a confident value that is not on the page, and they do not reliably say where on the page a value came from.
| Method | Strengths | Weaknesses | Suits |
|---|---|---|---|
| OCR with templates | Cheap, fast, gives word positions | No understanding; a template per layout | A few fixed layouts at high volume |
| Layout model | Fields, tables and positions, with confidence scores | Pre-built models cover common document types, and others need training | Invoices, receipts and forms from many suppliers |
| Vision-language model | Handles new layouts and follows instructions without training | Can invent values; positions unreliable; slower per page | Varied documents, tenders and one-off forms |
| Combined | A model extracts, and OCR locates each value on the page | More to build | Anything where values must be checked and traced |
Defining a schema
A schema is the exact list of fields you want, with the type and format of each. Defining it first turns a vague request into something you can check. For a supplier invoice it might include these fields.
- Supplier name, and the supplier’s VAT registration number if shown.
- Invoice number, invoice date and due date, as ISO 8601 dates such as 2026-03-14.
- Purchase order number, if quoted.
- Line items, each with a description, quantity, unit price, VAT rate and line total.
- Net total, VAT total and gross total, held in pence to avoid rounding errors.
- Whether the invoice states that the VAT domestic reverse charge applies.
Many model providers can force output to match a JSON schema, which removes a whole class of formatting errors. It does not make the values correct.
Validation rules for extracted data
Every extracted value should pass rules before it is trusted. Rules are cheap, explainable and consistent.
- Arithmetic. Each line total equals quantity times unit price. The lines add up to the net total. Net plus VAT equals gross, within a penny for rounding.
- VAT rates. Each line is at one of the UK rates of 20%, 5% or 0%, or is marked as exempt or outside the scope of VAT.
- VAT numbers. A UK VAT registration number usually has nine digits after the GB prefix, and HMRC offers a service to check whether one is valid.
- Dates. The invoice date is not in the future, and the due date falls after it.
- Duplicates. The same supplier and invoice number have not been processed before.
- Matching. The purchase order exists and is open, the supplier matches it, and the quantities agree with what the delivery note says arrived. Checking the order, the delivery note and the invoice against each other is known as three-way matching.
Construction adds its own rules. A subcontractor’s invoice under CIS has to separate labour from materials, because the deduction applies only to labour, and an invoice for many construction services between VAT-registered businesses may need to show the reverse charge. These rules are described in CIS, reverse charge and payment notices.
Confidence and human review
Treat confidence as one signal among several. Layout models return a confidence score for each field. Language models can be asked for one, but a model’s own estimate of its confidence is not a dependable measure of accuracy. A better approach combines four questions for each field.
- Did the value pass every validation rule?
- Was the value found on the page, in the OCR text?
- Do two methods agree, such as a layout model and a vision model?
- Is an error in this field costly, as it would be for the total or the bank details?
Documents where every field passes go straight through. Documents with a failed rule or a missing value go to a review queue, with the problem fields highlighted. Bank details deserve their own rule. A change to a supplier’s bank details on an invoice is a known sign of invoice fraud, and it should always be confirmed with the supplier by phone, using a number you already hold.
Linking every value to its source
Each extracted value should carry the page number and the area of the page it came from. When a vision-language model does the extraction, ask it to return the exact text it read for each field, then find that text in the OCR output to get its position. If the text cannot be found on the page, flag the field, because the model may have produced the value without reading it.
This brings three benefits. A reviewer sees the document beside the fields, with each value highlighted where it appears, and can confirm it at a glance. An auditor can trace any number in your accounts back to the document. And every correction a reviewer makes becomes a labelled example, which gives you a running measure of accuracy by field, supplier and document type.
Working out the cost per document
The cost of extraction per document is the sum of three parts. Work each out with your own volumes and your provider’s current rates.
| Part | How to calculate it |
|---|---|
| Reading | Pages × the per-page rate of an OCR or layout service |
| Model calls | (Input tokens × input rate) + (output tokens × output rate), where input includes the page images, instructions and schema |
| Review | Share of documents reviewed × minutes per review × staff cost per minute |
Here is an example, with figures you should replace with your own. Suppose 3,000 invoices a month, one in five needs review, a review takes two minutes, and staff time costs £30 an hour, or £0.50 a minute. Review then averages 0.2 × 2 × £0.50 = £0.20 per invoice, or £600 a month. The reading and model costs come from your provider’s price list. Providers count page images as tokens in different ways, so measure a few real documents before you estimate.
The review line is often the largest of the three. That is why time spent on validation rules and source highlighting usually saves more than time spent finding a cheaper model. The same sum for any AI feature is explained in what an AI feature costs per call.
Questions people ask
How accurate is AI invoice extraction?
It depends on the documents, the method and the field, so measure it on your own. Take a few hundred real documents, record the correct values and compare field by field. Accuracy on clean, typed invoices is usually much higher than on photographed or handwritten delivery notes.
Can AI read handwritten delivery notes?
Vision-language models and modern OCR can often read clear handwriting, but accuracy drops with poor photos, carbon copies and hurried figures. Send handwritten fields to review more readily, and have a person confirm quantities and signatures.
Can AI extract requirements from tender documents?
Yes, though tenders are harder than invoices because they are long and every one is different. Extraction there means finding the deadline, submission method, evaluation criteria and required forms, each with a page reference. It works best combined with search over the document, so a person can ask follow-up questions and see the source.
Is it safe to send invoices to an AI provider?
Invoices often contain personal data, such as a sole trader’s name and address, so UK GDPR applies. Use a provider that acts as your processor under a written contract, check where the data is processed and whether it is used for training, and keep the original documents for as long as HMRC requires, which for VAT records is generally six years. Our guide to AI and UK GDPR covers the rest.