# Reconcile bank statement and ledger CSVs

Match bank-statement CSV rows to ledger rows by date, signed amount, and fuzzy memo similarity, with unmatched and suggested matches.

## Run it

- **CLI:** `gizza tool bank-statement-reconcile "date,amount,memo
2024-01-02,-42.50,COFFEE SHOP
2024-01-05,-1200.00,RENT PAYMENT" 'ledger_csv=date,amount,memo
2024-01-02,-42.50,Coffee Shop downtown
2024-01-05,-1200.00,January rent'`
- **Web:** https://gizza.ai/tools/bank-statement-reconcile/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/bank-statement-reconcile/tool.json

## Inputs

- `statement_csv` — Bank statement CSV _(field)_
- `ledger_csv` — Bookkeeping ledger CSV _(field)_
- `stmt_date` — Statement date column _(field)_
- `stmt_amount` — Statement amount column _(field)_
- `stmt_memo` — Statement memo column _(field)_
- `ledger_date` — Ledger date column _(field)_
- `ledger_amount` — Ledger amount column _(field)_
- `ledger_memo` — Ledger memo column _(field)_
- `date_tolerance_days` — Date tolerance (days) _(field)_
- `amount_tolerance` — Amount tolerance _(field)_
- `memo_threshold` — Memo match threshold _(field)_
- `delimiter` — CSV delimiter _(field)_
- `output` — Output format _(field)_

## Output

- Reconciliation report (text)

## Query parameters

Open the tool pre-filled and auto-run via URL:

- `statement_csv` — Bank statement CSV
- `ledger_csv` — Bookkeeping ledger CSV
- `stmt_date` — Statement date column
- `stmt_amount` — Statement amount column
- `stmt_memo` — Statement memo column
- `ledger_date` — Ledger date column
- `ledger_amount` — Ledger amount column
- `ledger_memo` — Ledger memo column
- `date_tolerance_days` — Date tolerance (days)
- `amount_tolerance` — Amount tolerance
- `memo_threshold` — Memo match threshold
- `delimiter` — CSV delimiter
- `output` — Output format

Example: `https://gizza.ai/tools/bank-statement-reconcile/?statement_csv=date%2Camount%2Cmemo%0A2024-01-02%2C-42.50%2CCOFFEE%20SHOP%0A2024-01-05%2C-1200.00%2CRENT%20PAYMENT&ledger_csv=date%2Camount%2Cmemo%0A2024-01-02%2C-42.50%2CCoffee%20Shop%20downtown%0A2024-01-05%2C-1200.00%2CJanuary%20rent&stmt_date=date&stmt_amount=amount&stmt_memo=memo&ledger_date=date&ledger_amount=amount&ledger_memo=memo&date_tolerance_days=3&amount_tolerance=0.01&memo_threshold=70&delimiter=comma&output=markdown`

---

## About this tool

Bank Statement Reconcile compares a bank-statement CSV with a bookkeeping ledger
CSV. It matches transactions by **signed amount** and **date window**, then uses a
fuzzy token score on the memo/description fields to separate confident matches
from suggested matches that need review.

Use it when exported bank transactions and accounting rows use slightly different
memos such as `COFFEE SHOP` versus `Coffee Shop downtown`, or when ledger entries
land a few days away from the bank posting date.

### Worked example

Statement CSV:

```csv
date,amount,memo
2024-01-02,-42.50,COFFEE SHOP
2024-01-05,-1200.00,RENT PAYMENT
```

Ledger CSV:

```csv
date,amount,memo
2024-01-02,-42.50,Coffee Shop downtown
2024-01-05,-1200.00,January rent
```

With a three-day date tolerance and a moderate memo threshold, the tool lists the
coffee row as a match and the rent row as a lower-scoring suggested match for
human review.

## Limits & edge cases

- Each CSV is capped at **1000 data rows** to keep the O(statement × ledger)
  matching pass bounded.
- Dates can be `YYYY-MM-DD`, `YYYY/MM/DD`, or common slash/dot/dash dates with an
  optional time part ignored.
- Amounts may include currency symbols, thousands separators, signs, or
  accounting parentheses like `(1,234.56)`.
- Matching is one-to-one and greedy in statement row order: each ledger row can be
  claimed once.
- Memo similarity is token-based. It is useful for descriptions, not a guarantee
  that two transactions are semantically identical.

## FAQ

<details>
<summary>Do amounts need to be signed the same way on both files?</summary>

Yes. The matcher compares signed amounts. If the statement exports debits as
negative values but your ledger stores expenses as positive values, normalize one
file first or use a CSV calculation tool before reconciling.

</details>

<details>
<summary>What is the difference between matched and suggested matches?</summary>

Both pass the amount and date tolerance gates. A matched row also reaches the
memo similarity threshold. A suggested match has the right amount and date but a
weaker memo score, so it is listed separately for manual review.

</details>

<details>
<summary>Can I use column numbers instead of header names?</summary>

Yes. Every date, amount, and memo column field accepts a header name or a 1-based
index such as `1`, `2`, or `3`. Header names are usually clearer for saved URLs
and CLI commands.

</details>

<details>
<summary>Why did one obvious match remain unmatched?</summary>

A ledger row can only be claimed once. If duplicate amounts and dates exist, the
greedy pass picks the best memo score in statement order. Tighten the date window,
review the suggested matches, or split duplicate-heavy periods into smaller
batches.

</details>

## Related tools

- [Amazon Order Analyzer](https://gizza.ai/tools/amazon-order-analyzer/): Paste an Amazon order-history CSV export to summarize total spend by month, top items, and category breakdowns. Browser-only, private, with Markdown or JSON output.
- [Avro to JSON Converter](https://gizza.ai/tools/avro-to-json/): Decode Apache Avro Object Container Files (.avro / OCF) to JSON, NDJSON, or the embedded schema — no .avsc needed, free and private in your browser.
- [Bencode decoder](https://gizza.ai/tools/bencode-decoder/): Decode bencode (the BitTorrent / .torrent serialization format) into readable JSON, and re-encode JSON back into canonical bencode — in your browser. Nothing is uploaded.
- [Budget Planner](https://gizza.ai/tools/budget-planner/): Plan a monthly budget from take-home pay: 50/30/20 needs/wants/savings targets with custom splits, or a zero-based plan showing what's left to allocate.
- [CAMT.053 Statement Parser](https://gizza.ai/tools/camt053-parse/): Parse a camt.053 (or camt.052/054) ISO 20022 bank statement XML into JSON or CSV in your browser: balances, dates, counterparties, references. No upload.
