# Spending Categorizer

Paste a bank or credit-card CSV export to auto-categorize every transaction by merchant keywords and summarize spending by category. Runs in your browser.

## Run it

- **CLI:** `gizza tool spending-categorizer "Date,Description,Amount
2024-01-05,WALMART SUPERCENTER,-52.30
2024-01-06,STARBUCKS #1234,-4.50
2024-01-10,ACME PAYROLL,2000.00"`
- **Web:** https://gizza.ai/tools/spending-categorizer/
- **Agents:** machine-readable descriptor (parameters JSON Schema) at https://gizza.ai/tools/spending-categorizer/tool.json

## Inputs

- `data` — Bank / credit-card CSV (with a header row) _(field)_
- `description_column` — Description / merchant column (blank = auto-detect) _(field)_
- `amount_column` — Signed amount column (blank = auto-detect) _(field)_
- `debit_column` — Debit / money-out column (if split into two) _(field)_
- `credit_column` — Credit / money-in column (if split into two) _(field)_
- `date_column` — Date column (blank = auto-detect) _(field)_
- `rules` — Your rules (one 'keyword = Category' per line) _(field)_
- `output` — Output _(field)_
- `currency` — Currency ($ prefix or USD suffix; blank = none) _(field)_
- `delimiter` — CSV delimiter _(field)_
- `invert_amount` — Invert amounts (bank exports spending as positive) _(field)_

## Output

- Spending summary (text)

## Query parameters

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

- `data` — Bank / credit-card CSV (with a header row)
- `description_column` — Description / merchant column (blank = auto-detect)
- `amount_column` — Signed amount column (blank = auto-detect)
- `debit_column` — Debit / money-out column (if split into two)
- `credit_column` — Credit / money-in column (if split into two)
- `date_column` — Date column (blank = auto-detect)
- `rules` — Your rules (one 'keyword = Category' per line)
- `output` — Output
- `currency` — Currency ($ prefix or USD suffix; blank = none)
- `delimiter` — CSV delimiter
- `invert_amount` — Invert amounts (bank exports spending as positive)

Example: `https://gizza.ai/tools/spending-categorizer/?data=Date%2CDescription%2CAmount%0A2024-01-05%2CWALMART%20SUPERCENTER%2C-52.30%0A2024-01-06%2CSTARBUCKS%20%231234%2C-4.50%0A2024-01-10%2CACME%20PAYROLL%2C2000.00&description_column=Description&amount_column=Amount&debit_column=Debit&credit_column=Credit&date_column=Date&rules=starbucks%20%3D%20Coffee%0Agym%20%3D%20Health%20%26%20Fitness&output=both&currency=%24&delimiter=auto&invert_amount=true`

---

## About this tool

Export your transactions from your bank or credit-card site as CSV, paste them above, and get
an instant picture of where the money went. Every row is matched against a built-in table of
merchant keywords — Groceries, Dining & Takeaway, Transport, Fuel, Shopping, Subscriptions &
Streaming, Utilities & Phone, Housing & Rent, Insurance, Health & Fitness, Entertainment,
Travel, Cash & ATM, Transfers, Fees & Interest — and money coming in is recognized as Income.
Anything unmatched lands in `Other`, and you can add your own `keyword = Category` rules
(checked before the built-ins) to route it wherever you want.

The summary shows each category's total, its share of overall spending, the transaction count
and a proportional bar, followed by total spending, income and net cash flow. Switch the output
to *Categorized CSV only* to download the original rows with a `Category` column appended —
ready for a spreadsheet or budgeting app. Everything runs locally in your browser; your
statement never leaves your machine.

### Worked example

Pasting this statement:

```
Date,Description,Amount
2024-01-05,WALMART SUPERCENTER,-52.30
2024-01-06,STARBUCKS #1234,-4.50
2024-01-07,SHELL GAS STATION,-48.90
2024-01-08,NETFLIX.COM,-15.99
2024-01-09,WALMART SUPERCENTER,-34.80
2024-01-10,ACME PAYROLL,2000.00
2024-01-11,CITY PARKING,-12.00
```

produces this summary (plus the categorized rows):

```
Spending by category
====================

Category                       Total   Share  Txns
--------------------------------------------------
Groceries                     $87.10   51.7%     2  ████████████████████
Fuel                          $48.90   29.0%     1  ███████████
Subscriptions & Streaming     $15.99    9.5%     1  ████
Transport                     $12.00    7.1%     1  ███
Dining & Takeaway              $4.50    2.7%     1  █
--------------------------------------------------
Total spending               $168.49  100.0%     6
Income                      $2000.00             1
Net cash flow              +$1831.51
```

### Formats and limits

- The first row must be the column headers. Description/merchant, amount and date columns are
  auto-detected from common header names — including European ones like `Beschreibung`,
  `Omschrijving`, `Libellé`, `Betrag`, `Bedrag`, `Montant`, `Datum` — and you can name them
  explicitly when detection guesses wrong.
- Works with one signed amount column (money out negative) **or** separate debit/credit
  columns. If your bank exports spending as positive numbers, tick *Invert amounts*.
- Amounts may use US (`1,234.56`) or European (`1.234,56`) separators, parentheses negatives
  (`(42.00)`), or trailing `DR`/`CR` markers.
- Comma, semicolon, tab and pipe delimiters are supported (auto-sniffed by default).
- At most **10 000 rows** per run; larger files are rejected with a clear error.
- Categorization is deterministic keyword matching, not machine learning: single-word keywords
  match whole words by prefix (so `rent` matches RENT and RENTAL but not PARENT), and rules
  you write match anywhere in the description.

## FAQ

<details>
<summary>Which bank exports does this work with?</summary>

Any bank or card provider that exports CSV. The tool auto-detects the usual header names —
`Description`/`Payee`/`Details`/`Memo` for the merchant, `Amount` (or `Debit`/`Credit`) for
the money, `Date`/`Posted` for the date — so most exports work as-is. If your bank uses
unusual headers, type them into the column fields; if it uses semicolons (common in Europe),
the delimiter is sniffed automatically.

</details>

<details>
<summary>How do I fix a transaction that lands in the wrong category (or in Other)?</summary>

Add a rule line like `costco = Wholesale` or `my landlord llc = Housing & Rent` in the rules
box. Rules are case-insensitive substring matches, checked before the built-in keyword table,
so they always win. One rule per line; `#` starts a comment. The category name is free text —
you can invent your own categories.

</details>

<details>
<summary>Why are my expenses showing up as income?</summary>

The tool expects money out to be negative and money in positive, which is what most banks
export. Some card statements export spending as positive numbers instead — tick *Invert
amounts* and the signs are flipped before categorizing. Statements with separate debit and
credit columns are handled automatically (debits are money out).

</details>

<details>
<summary>Is my bank data uploaded anywhere?</summary>

No. The categorizer is WebAssembly running entirely in your browser — the CSV is parsed,
categorized and summarized locally, and nothing is sent to a server. You can disconnect from
the network after the page loads and it keeps working.

</details>

<details>
<summary>Can I get the result into Excel or Google Sheets?</summary>

Yes — set *Output* to *Categorized CSV only* and use the download link under the result. You
get your original rows with a `Category` column appended, quoted as standard CSV, which
imports cleanly into any spreadsheet or budgeting app. The date column is passed through
exactly as your bank wrote it.

</details>

## Related tools

- [Extract Action Items from Meeting Notes](https://gizza.ai/tools/action-item-extractor/): Extract action items, owners, and decisions from meeting notes or daily notes with deterministic rules. Markdown checklist or JSON, private in-browser.
- [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.
- [Base Decoder](https://gizza.ai/tools/base-decoder/): Auto-detect and decode Base16, Base32, Base45, Base58, Base64, and Base85 text, including nested layers, locally in your browser.
- [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.
- [Preview a Bulk File Rename](https://gizza.ai/tools/bulk-file-renamer/): Preview old-to-new filename mappings with find/replace, regex, numbering, case conversion, prefix/suffix, and collision warnings.
