Accrued Expenses in Beancount: A Practical Guide (with copy-paste ledger examples)
Accrued expenses sound abstract until month-end closes start piling up. They are a cornerstone of proper accrual accounting, ensuring your financial reports reflect economic reality, not just when cash changes hands. Here’s a clear, Beancount-first walkthrough of what they are, why they matter, and exactly how to book, reverse, and report them in your plain-text ledger.
TL;DR ⚡
- Accrued expenses are costs you’ve incurred this period but haven’t paid yet. They are recorded as a liability until the cash goes out.
- In Beancount, this is simple: you debit an
Expenses:
account and credit aLiabilities:Accrued:
account. Later, you clear the liability when you pay.- To report, you can see what you owe as of a specific date by running a
bean-query
withCLOSE ON
andCLEAR
to get a clean balance-sheet snapshot.
What is an Accrued Expense?
An accrued expense is a cost that a business has incurred, but has not yet paid. It's recorded when the service is received or the cost is incurred, even if the invoice hasn't arrived or the payment isn't due yet. This practice follows the matching principle of accrual accounting, which dictates that expenses should be recorded in the same period as the revenues they helped generate.
Common examples include:
- Wages earned by employees at the end of a month but paid in the next.
- Utilities (electricity, water) you used in December but won't be billed for until January.
- Interest on a loan that has accumulated over the month but has not yet been withdrawn from your account.
By recording these costs when they happen, you get a much truer picture of your company's financial performance for that period.
How Beancount Thinks About It (in 30 seconds)
Beancount is a plain-text, double-entry accounting system. Everything is a dated directive or transaction in a text file. The system is built on five core account types: Assets, Liabilities, Equity, Income, and Expenses.
Entries are always ordered by date. A key detail is that balance
assertions are checked before same-day transactions are processed. This is important to remember when you place checks and reversing entries.
Finally, the bean-query
language provides a powerful, SQL-like way to generate reports. With operators like OPEN ON
, CLOSE ON
, and CLEAR
, you can create precise "as-of" views for financial statements.
Your Chart of Accounts (Suggested)
A clean, hierarchical chart of accounts is your best friend. For accrued expenses, the structure is straightforward. You'll need:
- An expense account: e.g.,
Expenses:Utilities
,Expenses:Payroll:Wages
- A corresponding liability account: e.g.,
Liabilities:Accrued:Utilities
,Liabilities:Accrued:Payroll
- Your cash account: e.g.,
Assets:Bank:Checking
Beancount enforces the five top-level account types. Keeping your account names organized makes querying and reporting much easier down the road.
The Core Pattern (No Plugin, No Magic)
This is the most direct way to handle accruals in Beancount. It involves two steps: accruing the expense at month-end and clearing the liability when you pay.
Step 1: Accrue the Expense at Month-End
On the last day of the period, you record the expense and create the liability.
2025-02-28 * "Accrue February electricity" #accrual
Expenses:Utilities 120.00 USD
Liabilities:Accrued:Utilities
Step 2: Clear the Accrual When You Pay
When the bill comes and you pay it, you don't hit the expense account again. Instead, you debit the liability account to clear it out.
2025-03-05 * "Pay Feb electricity - City Power"
Liabilities:Accrued:Utilities 120.00 USD
Assets:Bank:Checking
This is the cleanest approach for small teams. It correctly places the expense in February and ensures you don't double-count it in March. Notice that in Beancount, leaving one amount blank lets the system balance the transaction for you automatically.
Alternative: Reversing Entry on Day 1
If you prefer the classic "auto-reverse" accounting style, you can post the opposite of your accrual entry on the first day of the next month. Then, you book the actual vendor bill to the expense account as you normally would.
Step 1: Accrue at Month-End (Same as before)
2025-02-28 * "Accrue February electricity" #accrual
Expenses:Utilities 120.00 USD
Liabilities:Accrued:Utilities
Step 2: Reverse on the First Day of the Next Month
2025-03-01 * "Reverse Feb electricity accrual" #reversal
Liabilities:Accrued:Utilities 120.00 USD
Expenses:Utilities
Step 3: Book the Payment as Usual
2025-03-05 * "City Power - February bill"
Expenses:Utilities 120.00 USD
Assets:Bank:Checking
Heads-up on checks: Remember that balance
assertions evaluate before same-day transactions. If you want to check your Liabilities:Accrued:Utilities
account balance, place the assertion on 2025-02-28
to confirm the accrual or on 2025-03-01
after the reversal transaction to confirm it's zero. Placing it before the reversal on 2025-03-01
will cause a false failure.