
How text recognition works
To a computer, a photo is at first just an area of pixels. Text recognition finds the areas containing writing, breaks them down into lines, words and characters and assigns each character the most likely letter or digit. Earlier programmes compared characters with stored patterns. Today’s methods are based on machine learning and read whole lines at once, which works much better with untidy writing.
- Prepare the image
Straighten it, improve the contrast, correct shadows and distortions.
- Find the text
Recognise areas with writing and separate them from logos, lines and stamps.
- Read the characters
Translate lines into letters, digits and punctuation, with a confidence level for each character.
- Understand the structure
For receipt recognition: assign fields such as amount, date and supplier and check them.
Classic OCR and AI-assisted receipt recognition
Classic OCR delivers text but no meaning. A receipt (Quittung) becomes a string of characters with all its lines, and a person still has to pick out which of the five amounts is the total. Modern receipt recognition goes one step further: a model, often a language model that can understand images, reads the receipt as a whole and assigns the values to the right fields.
| Classic OCR | AI-assisted receipt recognition | |
|---|---|---|
| Result | Continuous text of all lines | Filled-in fields |
| Finding the total | Needs a person or a rule | The model recognises it from the context |
| Unknown layouts | Needs templates per supplier | Usually works without a template |
| Type of error | Misread characters | Wrongly assigned or invented values |
The last point is important: an AI model can not only misread a value but also fill in a missing value plausibly, a form of hallucination. Good programmes therefore show for each field how confident the recognition is and flag uncertain values for checking.
What is special about Swiss receipts
Many recognition programmes were trained mainly on receipts from Germany or the USA. Swiss receipts have their own features that a good system needs to know:
- Amounts: “CHF 1'249.00” with an apostrophe as the thousands separator and a point before the centimes (Rappen), rounded to 5 centimes for cash payments.
- VAT rates: 8.1%, 2.6% and 3.8% since 1 January 2024; older receipts still show 7.7%, 2.5% and 3.7%.
- UID: VAT numbers in the format CHE-123.456.789 MWST.
- QR-bill: the Swiss QR Code contains the IBAN, amount, reference and payee in machine-readable form. Whoever reads it does not need to guess the details through text recognition.
- Multilingualism: receipts in German, French and Italian, often mixed.
For a QR-bill (QR-Rechnung), reading the QR code is therefore the safer route than text recognition of the payment part. The data in the code follows a fixed standard from SIX and can be checked precisely [2].
PDF with text or image PDF
Not every PDF needs text recognition. Invoices generated by a programme already contain the text as text. You can tell because words in the PDF can be selected and copied. Such files can be evaluated exactly, without reading errors and without processing effort. Only scanned documents and photos saved as PDFs consist purely of pixels and have to be recognised.
In practice this means: ask suppliers to send invoices as a PDF by email rather than on paper. That saves postage and makes recording more reliable. With QR-bills as PDFs, the details can also be taken over directly from the QR code or the text.
How to take good photos of receipts
The best recognition is of little use with a poor photo. A few habits increase the hit rate considerably: lay the receipt flat on a dark, plain surface, photograph it in daylight or good lighting, get the whole receipt in the picture without fingers on the text, and photograph thermal paper receipts soon, before they fade.
For record keeping: a photo only replaces the paper receipt if the requirements of the Swiss Ordinance on Accounting Records (GeBüV) are met, in particular on integrity and legibility throughout the retention period [1]. More on this under retention obligation (Aufbewahrungspflicht). Text recognition itself is not decisive for this, but it is essential that the original image is stored unchanged.
Uses beyond receipts
Text recognition also helps with scanned contracts, suppliers’ delivery notes, business cards and old paper files. A searchable PDF can be found again later through the search function; a pure image PDF cannot. Anyone preparing documents for an AI system with search, for example for RAG, also needs recognised text, otherwise scanned pages remain invisible.
A practical example
Example: a fitter with expense receipts in Solothurn
A fitter at the fictitious ventilation firm Lüftungstechnik Muster AG in Solothurn collects around a dozen receipts a week: petrol station, car park, small materials from the DIY store, lunch. Instead of collecting them in the glovebox, he photographs each receipt with his phone straight after the purchase.
Receipt recognition fills in the date, amount, VAT rate and supplier and suggests a category. On a crumpled car park receipt, the amount is flagged as uncertain. The fitter corrects it from CHF 8.00 to CHF 6.00 and confirms. At the end of the month the list of business expenses (Spesen) is complete, without anyone having to type up receipts.
Invented example.
How VoxCRM helps
yesReceipt recognition in VoxCRM reads the amount, date, supplier, VAT, payment method, QR reference, IBAN and due date. It evaluates PDFs with text directly and photos with AI. Every field shows how confident the recognition is, and without AI you can still enter details by hand. More under expenses.
