A VAT number has a fixed format per country, and OCR can drop a digit or read a letter as a digit, which makes the number invalid for filing. The check is to read the number, test its format, and compare it with the printed invoice. This guide checks one VAT number.
Prerequisites
A scanned invoice PDF and an OCR tool. Note the expected VAT format for the supplier country before starting.
Steps
1. Run OCR on the invoice
Run OCR on the invoice and save the text. Expected result: the VAT number becomes selectable text.
2. Read the VAT number from the OCR text
Read the VAT number from the OCR text. Expected result: the number reads GB 842 1739 55.
3. Check the format for the country
Check the number against the UK VAT format: GB followed by nine digits. Expected result: the format is valid, with nine digits after GB.
4. Compare with the printed invoice
Compare the VAT number with the printed invoice. Expected result: the number matches the printed invoice character for character.
Practice check: fictional scanned invoice with UK VAT number
The table below is fictional practice material. It lists the VAT number check.
| Item | Value |
|---|---|
| VAT number | GB 842 1739 55 |
| Country prefix | GB |
| Digits | 9 |
| Format | Valid |
Expected result. the VAT number reads GB 842 1739 55, its format is valid for the UK, and it matches the printed invoice.
Limits
- A VAT number with a valid format can still be unregistered, so check it against the tax authority register when the invoice matters.
- UNTESTED – no OCR tool or AI tool was run; all results above are expected results. The practice file is fictional.
Sources
- Adobe Acrobat, Extract key data from scanned PDFs with OCR – Try to select a word first; OCR adds text you can search, select, copy and extract; tables can flatten, so compare totals with the original page. Checked 2026-11-29.
- Tesseract OCR Documentation, output formats – Tesseract supports plain text, searchable PDF, hOCR, TSV, ALTO and PAGE output; –psm sets the page segmentation mode. Checked 2026-11-29.
