AI-based chart of accounts import

Upload any chart of accounts or P&L spreadsheet and let SparkReceipt's AI turn it into a structured category tree — no manual reformatting required.

ST
Written by SparkReceipt TeamUpdated Apr 27, 2026

If you already have a chart of accounts — exported from your accounting software, sent to you by your accountant, or kept in a spreadsheet — SparkReceipt can import it directly. You don't need to reformat the file: an AI step reads whatever structure the file has, extracts the categories and account codes, infers the parent–child hierarchy, classifies each row as expense or income, and writes a clean four-column CSV that you can review before importing. This is the third way to set up categories in SparkReceipt, alongside pre-defined templates and building the category tree by hand.

What it accepts

The AI importer accepts:

  • CSV files — any column layout. Account codes and names can be in any order, headers are optional, and the file can include subtotal or summary rows that the AI will skip automatically.
  • Excel spreadsheets (.xlsx) — exported chart of accounts or trial-balance reports work as well.

The file is processed up to a maximum of 2,000 lines after normalization, which is enough for a typical small-business chart of accounts. The AI is instructed to skip total/subtotal rows, profit/loss summary lines, metadata (dates, company names, column headers), and rows that don't actually represent a category — so you don't need to clean the file before uploading.

The maximum nesting depth is 5 levels (top-level category plus four levels of children).

How it works

The import runs in two stages:

  1. AI transformation. SparkReceipt reads your file, sends the contents to an AI model, and receives back a clean four-column CSV with one row per category: category name, category code, depth (the nesting level), and transaction type (expense or income). The AI extracts the name from cells that mix the code into the name (e.g. "3000 Sales, recurring billing"), uses account-code ranges and section headers to figure out the hierarchy, and infers expense vs. income from where each row sits in the report.
  2. Review and import. The transformed CSV is shown to you in two views — a Hierarchy preview that renders the tree the way it will appear in the app, and a Raw data view where every row is editable. Once you confirm, the categories are written to your account.

The whole flow is asynchronous: the import view shows progress while the AI is working, and you can leave the page and come back later — the most recent task is resumed automatically.

Using it in the web app

  1. Open Settings in the web app and go to the Categories tab.
  2. Click Import categories.
  3. Choose Import from a file.
  4. Drag a CSV or XLSX file into the dropzone (or click to pick one).
  5. Wait for the AI to process the file. A progress indicator runs while it works; very large files can take a few minutes.
  6. Review the result. Switch between the Hierarchy and Raw data tabs. In the raw view you can edit any cell — fix a misclassified row, change a depth, or correct a name — before importing.
  7. Choose whether to Replace existing categories. Leaving it on No, keep old categories adds the imported categories on top of what you already have. Yes, remove old categories swaps your chart of accounts wholesale.
  8. Click Import categories and confirm.

When you replace existing categories, documents in books that are still open are automatically re-categorized into the matching new accounts. Categories that are still referenced by documents in closed periods are archived (kept for historical reports) rather than deleted.

The AI import path is available to admins and accountants on the account.

The four-column format

If you ever want to skip the AI step and import a file that is already in SparkReceipt's expected format, the four columns are:

  1. Category name — the name shown in the app. Required.
  2. Category code — your account code. Optional; group headers can leave it blank.
  3. Depth — an integer from 0 (top-level) up to 5 (deeply nested). Depth values must be consecutive — you can't jump from 0 to 3 without rows at 1 and 2 in between.
  4. Transaction type — expense or income. When you select Expense & Income as the import target, this column decides which class each row goes into.

The same four-column CSV is what powers the pre-defined templates, so if you ever want to start from a template and customize it, you can apply one and then export-and-edit the result.

Limits and gotchas

  • File size. Up to 2,000 lines after the file is normalized. If your source file is larger, split it before uploading.
  • Usage limit. AI transformations are subject to a fair-use cap of 100 transformations per user over a 10-day rolling window. Most accounts will never come close to this — it exists to prevent runaway use.
  • AI couldn't extract anything. If the AI sees no recognizable category data (the file was empty, scrambled, or not a chart of accounts), the task is marked Failed. Check the file is what you intended and try again, or use a pre-defined template and edit it from there.
  • Always review before importing. The AI is good at common formats but not infallible. The review step exists for a reason — at minimum, scan the hierarchy preview before clicking Import.

Re-running and import history

The import view shows a Recent imports list at the bottom with the status, file name, and counts (added / removed) for each recent task. You can use this as a record of what was applied and when. If a task is still in progress when you reopen the page, polling resumes automatically.