Receipt Scanner to CSV
Operator: Abdulla Al Fahad. How tools are built and checked
A drawer of paper receipts or a phone gallery full of them is an expense report waiting to be typed, and every figure typed is one that can be mistyped. Reading them with OCR removes most of the typing, but only if you can see what the software read and correct it fast.
This page straightens each photo, reads it with OCR, and shows a row per receipt next to the receipt image. Clicking into a field outlines the exact line it came from, so a wrong total is a two-second fix.
Everything you correct goes into a CSV or XLSX, and the images can be saved under names like 2026-03-04_Corner-Cafe_8.37.jpg.
Key features
- Photos in PNG, JPG, WEBP, GIF or BMP, and PDFs in which each page counts as one receipt but only the first 10 pages of a PDF are read, with up to 60 receipts in a session
- Straightening of tilted photos and a contrast boost, each switchable, and per-receipt crop percentages with rotate and read-again
- Merchant, date, total, tax, currency, last four card digits and a category suggested from editable keyword rules
- A day-first or month-first setting for ambiguous dates, and a choice of OCR language
- CSV, XLSX and a ZIP of renamed images, with the first columns matching what Expense Report Maker writes in its export
How each receipt field is picked from the OCR text
The total is the largest amount found near a line containing GRAND TOTAL, TOTAL DUE, AMOUNT DUE, BALANCE DUE or TOTAL, tried in that order of preference, and lines that mention SUBTOTAL, CHANGE, CASH, TIP, TENDER, DISCOUNT, SAVINGS or POINTS are skipped. An amount is a number with exactly two decimals, so '4.50' and '9,50' count and '8%' does not. A space between a quantity and a price is not a thousands separator, so '3 107.00' is a quantity of 3 and a price of 107.00, while a space before a decimal comma is, so '1 234,56' is 1234.56. A total printed without decimals, such as 'TOTAL 25' or '合計 ¥1,200', is read when it is the last figure on a total line. Tax comes from a line with TAX, VAT, GST, HST, TVA, IVA or similar words.
Dates are matched as year-month-day, day-month-year with slashes, dots or dashes, and with a month name such as 14 Mar 2026. A date whose day and month can both be read either way is read by your setting and carries a warning that says which way it went. A date before 1995 or after next year is rejected as an OCR error.
The currency comes from a code (USD, EUR, GBP and others) or a symbol on the receipt. A bare '$' is reported as USD with a note that it may be CAD or AUD, and a receipt with no sign at all is left blank with a 'No currency found' warning rather than guessed.
How it works
A photo is drawn to a canvas, its skew is measured and removed, contrast is stretched, and the result goes to the OCR engine, which downloads its engine and language data from a CDN the first time and caches it. The recognised lines keep their boxes, which is how a field can be tied to the line it came from.
The parser works on those lines only. The merchant is the first line that is not a phone number, address or 'thank you', rewritten from capitals to title case when the line is shouting.
When to run it
- A freelancer photographs 25 taxi and meal receipts at the end of a trip and gets 25 rows to paste into the claim form.
- A small shop owner has a month of supplier slips scanned into one 38-page PDF. Only 10 pages of a PDF are read, so she splits it into four PDFs of ten pages or fewer, drops them together and exports one XLSX of date, merchant, total and tax for the accountant.
- A sole trader works through a quarter's 60 thermal slips, the limit for one session, then clears the list and starts the next batch.
- A traveller back from Paris has euro slips dated 03/04/2026, which means 3 April. She sets Day first and gets 2026-04-03, with the warning confirming which way it was read; a slip dated 14.03.2026 reads as 14 March with total 44.00 EUR and tax 4.00 under either setting, because 14 cannot be a month.
Running a check
- Choose the date order and the receipt language, then drop the photos or PDFs.
- Wait for each row to turn from Reading to a set of fields; open 'Recognised text' under a row to see the raw OCR lines.
- Fix any field by typing; focus a field to see its source line outlined on the image.
- Press CSV, XLSX or Renamed images (ZIP).
Example
An illustrative receipt image generated for this page, tilted 3 degrees: CORNER CAFE, Date 03/04/2026 08:41 AM, Latte 4.50, Muffin 3.25, Subtotal 7.75, Tax 0.62, TOTAL USD 8.37, VISA ending 4242
Month first, English, straighten on, saved as corner-cafe.jpgRow in receipts.csv
1, 2026-03-04, Corner Cafe, Meals, (empty note), 8.37, USD, 0.62, 4242, corner-cafe.jpg, 'The date 03/04/2026 is ambiguous; it was read as month/day'. The image is renamed 2026-03-04_Corner-Cafe_8.37.jpg. With Day first the same receipt reads 2026-04-03 and the warning says day/month.Limits
OCR can turn rows of asterisks and faded thermal print into other characters, so the card digits and the cents are the values most worth glancing at.
The rules are written for Latin-script receipts with English or common European labels; other scripts read as text but the total and date rules will not find their labels.
A receipt with several totals (a split bill, a pre-tip and a post-tip line) can pick the wrong one; the highlighted line shows which was used.
Only the first 10 pages of any PDF are read, with a note naming the file; a longer scan needs splitting before it is dropped.
Rows hold one amount and one currency, so a receipt in two currencies needs a manual edit, and the Sum of totals stat shows 'mixed currencies' instead of adding them.
- Lay the receipt on a dark surface and fill the frame: borders and shadows cost more accuracy than a slight tilt does.
- Edit the category rules before the first batch; the first rule with a keyword in the merchant or the top lines wins, so order them from specific to general.
Common errors and how to fix them
- "No date found"
- The date line was not read or is outside the accepted range. Open the recognised text, find the date, and type it as YYYY-MM-DD in the field.
- "The date 03/04/2026 is ambiguous; it was read as month/day"
- Switch 'Ambiguous dates' to Day first and read the receipts again if they come from a day-first country.
Best practices
- Sort the sheet by the Check column before importing: the rows with a warning are the ones where the page guessed a date order, a currency or a missing total.
Where the exported columns go
The CSV columns are #, Date, Merchant, Category, Note, Amount, Currency, Tax, Card last 4, Source file and Check. The first six headings after # match the ones Expense Report Maker writes in its own export, so the rows line up when you paste them over; that page has no CSV import.
Frequently asked questions
Why did a PDF of 14 pages give only 10 rows?
Each PDF page is treated as one receipt and only the first 10 pages of a PDF are read, so split longer PDFs first.
How does the image get its new name?
The date, merchant and total are joined with underscores, runs of anything that is not a letter or digit in the merchant become one hyphen, and the original extension is kept. A receipt with no date is named 'undated' and one with no total 'unknown'.
Why is the currency blank on a plain US receipt?
The receipt printed only numbers such as 8.37 with no $ sign or code, so nothing on the page says which currency it is. The page leaves the cell empty and warns instead of assuming; type USD in the field, or fill the column in the sheet.