How to Extract Data From a Bank Statement
How to pull clean date, amount and balance fields from a bank statement PDF — by hand with formulas, or automatically with OCR and an API.
A bank statement PDF holds real data — dates, descriptions, amounts, a running balance — but a PDF isn't a database. Knowing how to extract data from a bank statement is what turns a document you can only read into a table you can filter, sum, import and query. That distinction matters more than it sounds: a picture of a table is not a spreadsheet, and a spreadsheet full of garbled text is not the same as fields you can actually trust. This guide covers both routes — reshaping the data by hand with spreadsheet formulas, and letting software or an API do the work — plus the fields worth checking and the one arithmetic test that proves an extraction is correct.
What 'data' actually means on a bank statement
Before extracting anything, it helps to be precise about what counts as usable data. A statement printed as a neat table looks structured already, but until each value sits in its own field, a computer can't do anything with it beyond display it. The fields that matter are:
- Date — the day the transaction posted, ideally as a real date value rather than a string like '14 Jul'.
- Description — the merchant name, counterparty, or memo line, which is often the messiest field because it wraps across two lines or gets abbreviated by the bank.
- Amount — a single signed number (negative for money out, positive for money in), or two separate debit and credit columns depending on the bank's layout.
- Running balance — the account balance immediately after that transaction, which is the field most manual methods skip and the one that lets you validate everything else.
- Reference or category — a code or short tag some banks print, useful for reconciling against an invoice number or matching to a specific bill.
Miss the running balance and you lose the only built-in way to check your work. It's a rolling calculation the bank has already done for you, and reusing it costs nothing.
Extracting data by hand: copy-paste and spreadsheet formulas
For a single-page statement with a handful of transactions, doing this manually is realistic. Select the transaction table in your PDF viewer, copy it, and paste into a spreadsheet. The trouble starts immediately afterwards: most PDF viewers paste the whole table into a single column, or split it in ways that don't match the visual layout, so a raw paste rarely lands as clean columns on the first try.
- Text to Columns (Excel and Google Sheets both have a version) splits one messy column into several using a delimiter — usually a space or tab — though it needs a consistent pattern to work, which bank statements don't always give you.
- LEFT, MID and RIGHT formulas pull a fixed number of characters from a cell, useful when a date or reference code always sits in the same position within a string.
- REGEXEXTRACT in Google Sheets (or a helper column with SUBSTITUTE and FIND in Excel) can isolate a date pattern or a currency figure buried inside a longer line of text, which fixed-position formulas can't handle.
- VALUE() converts a text string that looks like a number — '£1,234.56' — into an actual number Excel can sum, once the currency symbol and thousands separator are stripped out first.
Where the manual approach breaks down
None of this scales well past a page or two. A 40-page annual statement means repeating the same copy-paste-reformat cycle dozens of times, and every repetition is a fresh chance to lose a row at a page break or paste a column out of order. A recent industry survey found professionals spend more than nine hours a week manually transferring data from emails, PDFs, spreadsheets and scanned documents into other systems — and a multi-page bank statement is exactly the kind of document that eats into that figure. For a fuller walkthrough of the formulas and settings involved, our guide to converting statements to Excel covers the process in more depth.
Automated extraction: text-layer parsing vs OCR
Software approaches the same problem differently depending on what kind of PDF it's given. A digital statement — downloaded straight from online banking — already has a text layer: every character's position is stored as data, so extraction means reading that layer and reconstructing columns from coordinates, not guessing at pixels. A scanned or photographed statement has no text layer at all, so it needs optical character recognition first, converting pixels into characters before column detection can even begin. How OCR handles a bank statement covers this step in detail, including why a plain character-recognition pass isn't enough on its own — table-structure detection has to run alongside it, or dates and amounts end up in the wrong row even when every individual character was read correctly.
The accuracy gap between the two is real. Modern extraction pipelines that combine OCR with dedicated table-structure logic can reach up to 99% field accuracy, while generic OCR tools without that structure layer can fall to around 60% accuracy on messier content such as handwritten notes or low-quality scans. That gap is exactly why a scanned statement is worth running through purpose-built software rather than a general OCR tool.
How to extract transaction data from a bank statement, step by step
Whether you're building this yourself or relying on a converter, the underlying process follows the same sequence:
- Check whether the PDF has a text layer. Try selecting text in the PDF viewer — if characters highlight, it's digital; if nothing selects, it's a scan and needs OCR.
- Extract the raw text and its position on the page. Read the text layer directly for a digital PDF, or run OCR for a scan, keeping each character's coordinates.
- Detect the table structure. Group characters into columns by shared horizontal position and into rows by shared vertical position, identifying the date, description, amount and balance columns.
- Parse each field into a usable data type. Turn date strings into real dates, strip currency symbols so amounts become numbers, and sign each amount correctly.
- Reconcile the totals against the statement itself. Sum the extracted amounts and check them against the printed opening and closing balance.
- Export the structured data. Save to Excel, CSV or JSON, push straight into QuickBooks, Xero or Sage, or fetch it as JSON through an API.
Validating the data you've extracted
Opening balance + total money in − total money out = closing balance. Run this one check against the statement's own printed figures and you'll catch almost every extraction error — a missed row, a flipped sign, a merged cell — without reading a single transaction by eye.
Beyond that arithmetic check, a few quick spot checks catch what the balance test alone might miss: does the transaction count match any summary the statement itself prints, do the first and last dates fall inside the stated period, and does the description column read as real words rather than the odd character swap an OCR misread leaves behind. Anyone reconciling the output against their own books should also see our full guide to bank statement reconciliation, which walks through matching extracted transactions line by line against an existing ledger.
Picture an operations manager at a small logistics firm, pulling together eighteen months of business account statements for a loan application. Copying each page by hand into a spreadsheet took most of an afternoon, and it wasn't until the totals wouldn't match the bank's own year-end summary that a single transaction on page 11 turned out to have been pasted with its sign flipped — a refund read as a payment. Running the same file through a converter with a built-in balance check caught the same error in under a minute, before it ever reached the lender.
"Extraction isn't finished when the numbers land in a spreadsheet. It's finished when you can prove, with the statement's own arithmetic, that nothing was missed or misread." — Priya Shah, Head of Product at Ledgerary
When to reach for an API instead of a UI tool
A website upload works well for occasional, one-off files. It stops being the right tool the moment extraction needs to happen without a person clicking a button — inside an accounting workflow, a nightly batch job, or an AI agent that needs transaction data as part of a larger task. That's what Ledgerary's developer platform is for: a single-key API endpoint that accepts a statement PDF and returns structured JSON — date, description, signed amount, running balance, and the same reconciliation pass or fail you'd see in the browser — plus an MCP server so an AI agent can call the same extraction as a tool, rather than a person uploading files one at a time.
If you're extracting a handful of statements a month, a UI tool is simpler and just as accurate. If you're processing statements as part of a product, a client onboarding pipeline, or a recurring bookkeeping workflow, the API removes the manual step entirely and gives you fields you can validate and store directly, with the source file deleted after processing rather than kept on a server somewhere.
Frequently asked questions
What data can I actually extract from a bank statement?
The core fields are transaction date, description (or counterparty), a signed amount, and the running balance after that transaction. Many statements also carry a reference or category code. Anything less than date, amount and balance as separate fields isn't structured data yet — it's still just text sitting inside a table shape.
How do I extract data from a PDF bank statement without OCR?
If the PDF came as a direct download from your bank rather than a scan, it almost certainly has a text layer already, so no OCR is needed. Tools that read that text layer pull the character positions straight off the page and reconstruct columns from them, which is faster and more accurate than OCR on the same file.
How do I extract bank statement data to Excel automatically?
Upload the PDF to a converter built for statements rather than generic documents. It should detect the date, description, amount and balance columns, parse each into the correct data type, and check the extracted total against the statement's printed opening and closing balance before handing you a spreadsheet, CSV or JSON file.
Can I extract bank statement data using an API instead of a website?
Yes. A single-key API endpoint that accepts a PDF and returns structured JSON is the standard approach for developers who need extraction inside a script, an accounting integration or an AI agent workflow, rather than uploading files one at a time through a browser.
Extract clean, balance-checked transaction data from your next statement in under a minute.
Try it freeThis guide is general reference, not financial, accounting or tax advice. To try the conversion on a real file, use the bank statement converter, or see how the same engine works from your own code or an AI agent.
More guides
Convert a statement, then build on it
Convert a statement free, then get an API key for your software or your AI agent — no card to start.