Generating IRS-Ready Tax Reports from Beancount: Scripts and Workflows

One of the biggest wins of using Beancount is the ability to generate tax reports programmatically. Instead of manually categorizing a year’s worth of transactions, you can run a command and have everything organized.

I wanted to share the workflow I have developed over the years for generating reports my CPA can actually use.

Basic Tax Reports with bean-report

For a simple income/expense summary:

# Income statement for tax year 2025
bean-report ledger.beancount income -f 2025-01-01 -t 2025-12-31

# Export to CSV for spreadsheet work
bean-report ledger.beancount income -f 2025-01-01 -t 2025-12-31 --format csv > income_2025.csv

Custom Tax Summary Script

I wrote a Python script that generates a tax-form-friendly summary:

from beancount import loader
from beancount.query import query

ledger_file = "ledger.beancount"
entries, errors, options = loader.load_file(ledger_file)

# Query for Schedule C income
income_query = """
SELECT account, sum(position) 
WHERE account ~ 'Income:Business' 
AND year = 2025
GROUP BY account
"""

result = query.run_query(entries, options, income_query)
for row in result[1]:
    print(f"{row[0]}: {row[1]}")

Mapping Accounts to Tax Forms

The key is structuring your chart of accounts to align with tax forms:

Beancount Account Tax Form Line
Income:Business:Consulting Schedule C, Line 1
Expenses:Business:Advertising Schedule C, Line 8
Expenses:Business:CarAndTruck Schedule C, Line 9
Expenses:Business:Legal Schedule C, Line 17
Income:Investments:Dividends Form 1099-DIV
Income:Investments:Interest Form 1099-INT

Sharing with Your Accountant

Most CPAs do not want to learn Beancount. Here is what works:

Option 1: PDF Reports via Fava

  • Use Fava’s print view to generate clean PDFs
  • Income statement + Balance sheet are usually sufficient

Option 2: CSV Exports

  • Export register or trial balance to CSV
  • Import into Excel/Google Sheets
  • Add formulas to roll up into tax categories

Option 3: Static HTML with bean-bake

  • Generate a browsable HTML version of your ledger
  • Accountant can explore transactions without learning tooling
  • Read-only, so no risk of accidental changes

What Reports Does Your CPA Need?

In my experience, a good tax preparer needs:

  1. Income Summary: All income sources with totals
  2. Expense Summary: Business expenses by category
  3. Bank/Brokerage Statements: For verification
  4. 1099s and W-2s: Official forms you received
  5. Mileage Log: If claiming vehicle deduction
  6. Home Office Calculation: If applicable

Has anyone built more sophisticated tax reporting tools for Beancount? I am thinking about creating a proper Schedule C generator.

This is incredibly useful @practical_adviser! As a tax preparer who has worked with Beancount users, I can confirm that the CSV export approach works best for most CPAs.

What I Actually Need from Clients

When a client sends me their Beancount data, here is my ideal format:

1. Income Summary by Source

Source                    | Amount    | 1099 Received?
W-2 Employment            | 85,000    | Yes
1099-NEC Consulting       | 42,000    | Yes
1099-INT Bank Interest    | 234       | Yes
1099-DIV Dividends        | 1,250     | Yes

2. Business Expenses by Schedule C Line

Line 8 - Advertising      | 2,400
Line 9 - Car and Truck    | 3,150
Line 17 - Legal           | 500
Line 18 - Office          | 890
...

3. Supporting Documentation Index
A simple list matching expenses to receipt files is gold:

2025-03-15 | Office Depot | $249.99 | receipts/2025-03/office-depot.pdf

The 1099 Reconciliation Problem

One thing I always check: do the totals in Beancount match the 1099s the IRS received?

The IRS does automated matching. If your 1099-NEC shows $42,000 and you only reported $40,000, you will get a notice. Run this query and compare to your forms:

SELECT account, sum(position)
WHERE account ~ 'Income'
AND year = 2025
GROUP BY account

Would Love a Schedule C Generator

@practical_adviser - if you build that Schedule C generator, please share! I would happily test it with client data (anonymized, of course). The dream is a tool that outputs data in a format I can directly import into my tax software.

For my small business clients, I have found that Fava’s built-in reports cover most needs. Here is my typical tax-time workflow:

My Fava Tax Report Process

Step 1: Set the Date Range
In Fava, click the date range selector and choose “Year to Date” then adjust to the tax year (2025-01-01 to 2025-12-31).

Step 2: Income Statement Screenshot
The Income Statement view in Fava shows:

  • All income accounts with totals
  • All expense accounts with totals
  • Net income

I literally screenshot this or print to PDF. Most CPAs understand this format immediately.

Step 3: Drill Down for Details
Click on any account to see individual transactions. For business expenses, I export just that account’s transactions to CSV if the CPA needs receipt-level detail.

The Google Sheets Bridge

For clients who want something more formatted, I have a Google Sheet template that:

  1. Imports Beancount CSV exports
  2. Maps accounts to Schedule C lines using SUMIF
  3. Highlights any unmatched accounts that need attention
  4. Produces a print-ready summary

Happy to share the template if anyone wants it.

One Pain Point

The one thing I have not solved well: capital gains reporting. Tracking cost basis and calculating gains/losses for investment sales is complex in Beancount. I usually just export the transaction data and let the CPA or their software handle the calculations.

Does anyone have a good workflow for generating Schedule D / Form 8949 data from Beancount?

@bookkeeper_bob - for capital gains, there is a tool called TaxingLots that works with plain text accounting ledgers. I have had clients use it successfully.

Capital Gains Workflow

The challenge with Beancount is tracking lot identification (FIFO, LIFO, specific identification) for securities. Here is what works:

1. Track Each Purchase Lot Separately

2024-01-15 * "Buy AAPL"
  Assets:Brokerage:AAPL  10 AAPL {150.00 USD, 2024-01-15}
  Assets:Brokerage:Cash  -1500.00 USD

2024-06-20 * "Buy AAPL"
  Assets:Brokerage:AAPL  5 AAPL {175.00 USD, 2024-06-20}
  Assets:Brokerage:Cash  -875.00 USD

2. When Selling, Specify the Lot

2025-03-15 * "Sell AAPL - FIFO"
  Assets:Brokerage:Cash           1800.00 USD
  Assets:Brokerage:AAPL          -10 AAPL {150.00 USD, 2024-01-15}
  Income:Investments:Gains       -300.00 USD  ; Gain = 1800 - 1500

3. Query for Form 8949

SELECT date, narration, account, position, cost(position)
WHERE account ~ 'AAPL'
AND year = 2025

The Cryptocurrency Challenge

@bookkeeper_bob asked about Schedule D - this gets even more complex with crypto. Each trade, swap, or even staking reward is a taxable event.

For crypto, I honestly recommend using specialized software (CoinTracker, Koinly, etc.) and importing that data into your tax return. Then reconcile totals back to Beancount.

Trying to track thousands of micro-transactions in Beancount manually is not practical for most people.