CRM & SaaS development

Bank Reconciliation Automation: Bank vs Ledger Matching

How to automate bank reconciliation in custom software: normalizing imports, tiered exact/strong/fuzzy matching, variance tracking and a verify-then-lock workflow.

By Devang GandhiUpdated Nov 3, 20267 min read

Reconciling a bank statement against a ledger is one of those jobs that looks mechanical but eats hours. Someone exports two spreadsheets, sorts both by amount, and ticks lines off one by one. Bank reconciliation automation takes that routine matching off people's plates so they can focus on the lines that genuinely do not agree.

I built a reconciliation module as part of an audit portal for an Australian accounting firm, used to reconcile estate agents' trust accounts. This post covers the parts that make automated matching accurate: clean imports, tiered matching rules, variance tracking and a lock step that makes the result auditable.

TL;DR

Import bank and ledger lines from CSV or XLSX through a column mapper, normalize everything, then match in tiers: exact first, strong next, fuzzy last as suggestions only. Track what remains unmatched as variances with explanations. When the numbers agree, a reviewer verifies and locks the reconciliation so it cannot change.

key takeaways

  • Most reconciliation pain comes from messy imports, so normalize dates, amounts and references before attempting any match.
  • Tiered matching (exact, strong, fuzzy) lets software clear the obvious pairs while humans review only the uncertain ones.
  • Fuzzy matches should be suggestions that a person confirms, never automatic final matches.
  • A verify-then-lock step turns a reconciliation into an auditable record that cannot drift after sign-off.

Step one: imports that do not lie

Every bank exports statements differently. One puts debits and credits in separate columns, another uses a single signed amount, a third adds a running balance and a header block. Ledgers from accounting software have their own quirks. If you match on raw imported data, you will get false mismatches all day.

A practical import pipeline looks like this:

  1. Upload a CSV or XLSX file per side (bank, ledger) for the period.
  2. Map columns: the user picks which column is date, description, reference, debit, credit or signed amount. Save the mapping per source so next month is one click.
  3. Normalize: parse dates into one format, convert amounts to integer cents with consistent signs, trim and uppercase references, collapse whitespace in descriptions.
  4. Validate: reject rows with unparseable dates or amounts and show them, rather than silently dropping them.
  5. Check totals: compare the sum of imported lines with the statement's opening and closing balances when available.

Step five catches more problems than any matching algorithm. If imported totals do not equal the statement movement, the file is incomplete, and matching it is pointless.

For XLSX parsing in Node, libraries such as SheetJS handle most real-world workbooks; see the SheetJS documentation for parsing options like date handling.

Step two: tiered matching rules

The core idea is to clear high-confidence matches automatically and push everything else to a review queue, sorted by how likely it is to be a match.

Tier Rule What happens
Exact Same amount, same date, same normalized reference Matched automatically
Strong Same amount, date within a small window (for example 1 to 3 days), reference or description overlap Matched automatically or with one-click confirm, depending on firm policy
Fuzzy Same amount, wider date window, partial text similarity Suggested only, reviewer accepts or rejects
Unmatched No candidate above threshold Goes to variance list

Why order matters

Run tiers in order and remove matched lines from the pool after each tier. If you run fuzzy matching first, a loose rule might grab a line that had a perfect exact partner elsewhere. Exact first means the safest pairs lock in before any guessing starts.

One-to-one, then one-to-many

Start with one-to-one matches. Then handle the common many-to-one case: several receipts in the ledger deposited as one bank credit. A simple approach looks for small groups of ledger lines on the same day whose sum equals a single bank line. Cap the group size, because subset-sum search explodes quickly, and always present these as suggestions.

Scoring fuzzy candidates

For fuzzy candidates, compute a score from a few signals: amount equal (required), days apart (penalty per day), and text similarity between references and descriptions, for example token overlap after removing common words like "TRANSFER" or "DEPOSIT". Show the score and the reasons in the UI. Reviewers trust suggestions they can understand.

Step three: variances, verification and lock

Whatever remains unmatched is a variance. Variances are not failures. They are often timing differences: a deposit recorded in the ledger on the 30th that clears the bank on the 2nd, or unpresented payments.

Track each variance with a type (timing, error, unexplained), a note and who classified it. The reconciliation screen should always show:

  • Bank closing balance
  • Ledger closing balance
  • Total of explained variances
  • Remaining unexplained difference

When the unexplained difference is zero, or within the firm's tolerance, a reviewer verifies the reconciliation. Then it is locked: no more imports, no re-matching, no edits. If something must change later, an authorized user reopens it and the reopening is recorded. This verify-then-lock workflow is what turns a working spreadsheet into evidence.

Storage and data model

The data model is small but deliberate. A Reconciliation belongs to an engagement and a period and has a status (draft, in review, verified, locked). BankLine and LedgerLine rows belong to it with normalized fields plus the raw imported row for traceability. A Match links one or more bank lines to one or more ledger lines, with a tier, a score and who confirmed it. A relational database fits this well, since matches are many-to-many and totals need consistent aggregation; see the PostgreSQL aggregate functions docs for the summing patterns involved.

How I built this in practice

The reconciliation module lives inside the audit portal described in the audit portal case study, which I built solo for an Australian accounting firm. Auditors import bank and ledger lines from CSV or XLSX, the system auto-matches them at exact, strong and fuzzy levels, tracks variances, and moves each reconciliation through verify and then lock.

It runs on Azure PostgreSQL with Prisma as the ORM, on Azure App Service in Australia East, with GitHub Actions for CI/CD. Reconciliation sits alongside the rest of the audit workflow: document review, sampling of around 5% of properties, an audit programme of tests with evidence, and the final report and audit pack in PDF or Excel. Because reconciliation results live in the same database, they feed straight into that final audit pack instead of being pasted in from a separate workbook.

Common mistakes

  • Matching on raw imported data before normalizing dates, signs, amounts and references.
  • Skipping the import totals check against the statement's opening and closing balances.
  • Running fuzzy rules before exact ones, so loose matches steal lines from perfect pairs.
  • Auto-accepting fuzzy matches instead of keeping them as reviewer suggestions.
  • Discarding the raw imported row, which makes it impossible to trace a line back to the source file.
  • Leaving reconciliations editable after sign-off instead of locking them.

keep reading

FAQ

Can bank reconciliation be fully automated?+

Not completely. Software can clear most exact and near-exact pairs, but timing differences, split payments and unclear references still need a person. The goal is to shrink manual review to the exceptions.

What file formats should a reconciliation tool accept?+

CSV and XLSX cover nearly every bank export and accounting ledger. Build a column-mapping step so users can tell the importer which column holds the date, amount, description and reference.

How does fuzzy matching work for bank transactions?+

It scores candidate pairs on amount equality, date proximity and text similarity between descriptions or references. Pairs above a threshold are suggested, and a reviewer accepts or rejects each one.

Is it better to connect bank APIs than to import statements?+

Bank feeds are convenient where available, but many firms and auditors work from exported statements for a fixed period. A file import path is usually needed either way, so build it first.

Devang Gandhi

AI & full stack developer at Passdn, building CRMs, SaaS, AI agents and Flutter apps for clients in the US, UK, Australia, UAE and India. More about me

Read next

More in CRM & SaaS development