Beancount.io LogoBeancount.io

Cheatsheet

Comprehensive Beancount cheatsheet with account structures, transaction syntax, commands, and practical examples for plain text accounting and financial record keeping.

Account Structure

Account Types and Signs

Type          Sign    Example
------------------------------------------------
Assets        (+)     Assets:US:BofA:Checking
Liabilities   (-)     Liabilities:Credit:Amex
Income        (-)     Income:Salary:Gross
Expenses      (+)     Expenses:Food:Restaurant
Equity        (-)     Equity:Opening-Balances

Commodity Format

# Financial
USD, EUR, CAD, AUD     # Standard currencies
GOOG, AAPL, VTI       # Investment vehicles
BTC, ETH              # Cryptocurrencies
 
# Custom tracking
HOURS                 # Time tracking
AIRMILES             # Rewards points
HOME_MAYST           # Property

Directive Syntax

Account Management

# Opening accounts
2024-01-01 open Assets:Checking            # Simple
2024-01-01 open Assets:Investing USD,GOOG  # With constraints
 
# Closing accounts
2024-12-31 close Assets:Old:Account

Commodity Declaration

2024-01-01 commodity VTSAX
    name: "Vanguard Total Stock Market Index"
    asset-class: "equity"

Transaction Recording

# Basic transaction
2024-01-15 * "Grocery Store" "Weekly shopping"
    Assets:Checking     -100.00 USD
    Expenses:Food:Groceries
 
# With metadata and tags
2024-01-15 * "Restaurant" "Business dinner" #work ^invoice-123
    id: "T-1234"
    receipt: "path/to/receipt.pdf"
    Expenses:Meals      80.00 USD
    Liabilities:Credit

Posting Specifications

# Basic amount
Assets:Cash              100.00 USD
 
# Cost basis tracking
Assets:Invest:VTSAX      10 VTSAX {100.00 USD}        # Per-unit
Assets:Invest:VTSAX      10 VTSAX {{1000.00 USD}}     # Total cost
Assets:Invest:VTSAX      10 VTSAX {100.00 # 9.95 USD} # With fees
 
# Price specifications
Assets:Forex            1000.00 USD @ 0.85 EUR        # Per-unit
Assets:Forex            1000.00 USD @@ 850.00 EUR     # Total price
 
# Dated lots
Assets:Invest:VTSAX      10 VTSAX {100.00 USD, 2024-01-15}

Balance Verification

# Balance assertion
2024-01-31 balance Assets:Checking  1000.00 USD
 
# Balance padding
2024-01-01 pad Assets:Checking Equity:Opening-Balances

Metadata Tracking

# Note attachment
2024-01-15 note Assets:Checking "Called bank about fee"
 
# Document linking
2024-01-15 document Assets:Checking "path/to/statement.pdf"
 
# Price recording
2024-01-15 price VTSAX  100.00 USD

Event Recording

# Location tracking
2024-01-15 event "location" "New York, USA"
 
# Property changes
2024-01-15 event "address" "123 Main Street"

Tag Management

# Tag scope control
pushtag #vacation
2024-01-15 * "Hotel"
    Expenses:Travel:Lodging   200.00 USD
    Assets:Credit
poptag #vacation

Configuration Options

# Basic settings
option "title" "Personal Finance Ledger"
option "operating_currency" "USD"
 
# Account naming
option "name_assets" "Assets"
option "name_liabilities" "Liabilities"
option "name_income" "Income"
option "name_expenses" "Expenses"
option "name_equity" "Equity"
 
# Document handling
option "documents" "/path/to/docs"

Comments and Organization

; Single line comment
 
* Section Header
** Subsection
; Transaction block follows...
 
; Account grouping
; Assets
2024-01-15 ...
 
; Expenses
2024-01-16 ...

This reference provides a complete overview of Beancount's syntax elements with practical examples.