Skip to content

Why OCR mangles bank statements

OCR is a character recogniser pointed at a table. It reads where things are rather than what they are, so the characters come out right and the structure comes out wrong — which is why an OCR'd statement has the right numbers attached to the wrong rows.

Position is not meaning

A statement is a table with no borders drawn. The bank relies on you knowing that the left column is a date and the right column is an amount — nothing in the file says so. OCR inherits exactly that problem: it sees text at coordinates, not fields.

Reading the statement semantically is the other approach: work out that this token is a date, this is a description, and this is an amount, then group them into a transaction. The coordinates never enter into it.

The four failures you will see

  • A wrapped description becomes two transactions. The second line of “DIRECT DEBIT 4471 / ACME INSURANCE LTD” sits below the first, so it is read as a new row.
  • The amount joins the wrong row. When a description wraps, the amount lines up with the continuation rather than with the transaction it belongs to.
  • Debit and credit columns collapse. Two narrow columns close together are read as one, and the sign of the amount is lost.
  • The totals block becomes transactions. “Opening balance”, “Closing balance”, and “Total debits” are printed like rows, so they are read like rows.

What to do instead

If the statement came from your bank’s website, it already contains text — no recognition is needed, only structure. That is what extractiondoes, and it is why a bank-generated PDF converts cleanly while a photograph of the same page does not.

Frequently asked questions

Does OCR always fail on bank statements?

It recognises characters well and reconstructs tables badly. A statement that is one column of text survives; a statement with a description column, a debit column, and a credit column usually does not.

Is OCR the same as text extraction?

No. OCR turns an image into characters. Text extraction reads a PDF that already contains characters and asks what each one is — a date, a description, an amount.

What about a photo of a statement?

A photo has no text layer, so OCR is the only option. Treat the result as a draft: check the wrapped descriptions and the debit/credit sides before trusting the file.

How do I avoid OCR altogether?

Download the statement from your bank’s site rather than photographing a printed copy. Bank-generated PDFs contain real text, so nothing has to be recognised.