Introduction
Ledger is a command-line accounting tool that reads plain-text journal files and produces financial reports. It implements full double-entry bookkeeping without requiring a database, GUI, or proprietary file format, making it ideal for developers and power users who prefer text-based workflows.
What Ledger Does
- Parses plain-text journal files with double-entry transaction records
- Produces balance reports, registers, budgets, and custom queries from the command line
- Supports multiple currencies, commodities, and automatic currency conversion
- Handles lot tracking for stocks and other investments with cost basis calculations
- Integrates with version control for complete audit history of financial changes
Architecture Overview
Ledger is written in C++ for performance and reads journal files in a simple indentation-based format. Each transaction must balance to zero across its postings. The reporting engine applies filters, groupings, and format expressions to produce customizable output. The parser supports includes, automated transactions, and periodic entries.
Self-Hosting & Configuration
- Install via package managers on Linux, macOS, or build from source
- Store journal entries in plain text files managed by any text editor
- Use version control (Git) to track changes and maintain an audit trail
- Configure default file paths and display options via environment variables
- Automate imports from bank CSVs using companion tools like ledger-autosync
Key Features
- Plain-text storage that is human-readable, greppable, and version-control friendly
- Extremely fast report generation even with years of transaction history
- Flexible reporting with custom format strings and expression-based filters
- Multi-currency and commodity tracking with automatic lot matching
- No lock-in: data is portable text that can be processed by any tool
Comparison with Similar Tools
- GnuCash — GUI-based with database storage; Ledger is text-based and terminal-native
- Beancount — Similar plain-text approach in Python; Ledger is faster (C++) with different syntax
- hledger — Haskell reimplementation with web UI; Ledger is the original with C++ performance
- YNAB — Commercial budgeting SaaS; Ledger is free, private, and infinitely customizable
FAQ
Q: Is the plain-text format standardized? A: The format originated with Ledger and has influenced hledger and Beancount, though each has variations.
Q: Can Ledger handle business accounting? A: Yes, it supports invoicing workflows, tax reporting, and multi-entity tracking through accounts.
Q: How do I import bank transactions? A: Use tools like ledger-autosync or reckon to convert CSV/OFX bank exports into Ledger format.
Q: Does Ledger have a GUI? A: No, but Emacs ledger-mode and other editor integrations provide syntax highlighting and completion.