5 minute quick start
1. Record transactions
hledger reads transactions from a journal file -
usually ~/.hledger.journal
, or C:\Users\USER\.hledger.journal
, or whatever you've set LEDGER_FILE to.
Transactions are recorded like this:
2025-04-10 MyGas
Expenses:Automotive $20
Liabilities:Acme Credit Card
A date and description, followed by several indented account postings, with two or more spaces between each account name and its amount. Colons indicate subaccounts. Here are the parts in more detail:
A transaction is a movement of money between accounts. So the amounts in a transaction must add up to zero. If you leave one amount blank, it will be calculated automatically ($-20 in this case).
A positive amount means "added to this account", a negative amount means "removed from this account" (debit and credit).
Here's the start of a journal, with comments. To follow along with these examples, save this as your journal file. You can use a text editor; or you could run hledger add or hledger web and enter these transactions interactively (no need to enter the comments).
2023-01-01 opening balances ; <- First transaction sets starting balances.
assets:bank:checking $1000 ; <- Account names can be anything.
assets:bank:savings $2000 ; <- Colons indicate subaccounts.
assets:cash $100 ; <- 2+ spaces are required before the amount.
liabilities:credit card $-50 ; <- A debt; these are negative.
equity:opening/closing $-3050 ; <- Starting balances come from equity.
; Equity is also usually negative.
; (Reports can show as positive when needed.)
2023-02-01 GOODWORKS CORP ; <- Date order is recommended but optional.
assets:bank:checking $1000
income:salary ; <- $-1000 is inferred here to balance the txn.
; Income amounts are negative.
2023-02-15 market
expenses:food $50
assets:cash ; <- $-50 is inferred here.
Some people record all transactions by hand in this way. But you can also import them from bank data, as we'll see below.
2. Add declarations
Transaction entries like the above are all you need to get started, so feel free to skip this step till later. But we usually add some declarations at the top of the file to enable more error checking.
First, declare your currencies/commodities, and their display style. In this case there's only one, $
:
commodity $1000.00
or it could be:
commodity $ 1.000,00
Now, you can check that all amounts have a valid commodity symbol:
$ hledger check commodities
$
Next, declare your top level accounts and their type, eg like this (or in other languages: ar da de en es fr ja ko no pt se zh ...):
account assets ; type:A
account liabilities ; type:L
account equity ; type:E
account income ; type:R
account expenses ; type:X
account assets:bank ; type:C
account assets:cash ; type:C
account equity:conversion ; type:V
This helps reports show the right accounts. It also sets their preferred display order.
If you'd like more error checking, declare all account names, not just the top-level ones:
account assets ; type:A
account assets:bank ; type:C
account assets:bank:checking
account assets:bank:savings
account assets:cash ; type:C
account liabilities ; type:L
account liabilities:credit card
account equity ; type:E
account equity:conversion ; type:V
account equity:opening/closing
account income ; type:R
account income:salary
account income:gifts
account expenses ; type:X
account expenses:rent
account expenses:food
account expenses:gifts
Then you can check that all transactions use valid account names:
$ hledger check accounts
$
You can also use strict mode,
which enables both of these checks,
by adding -s
to any command (or to your config file).
Here's the above journal in full.
3. Run reports
Now you can see reports, such as...
A list of accounts, showing the hierarchy and types detected:
$ hledger accounts --tree --types
assets ; type: A
bank ; type: C
checking ; type: C
savings ; type: C
cash ; type: C
liabilities ; type: L
credit card ; type: L
equity ; type: E
conversion ; type: V
opening/closing ; type: E
income ; type: R
salary ; type: R
gifts ; type: R
expenses ; type: X
rent ; type: X
food ; type: X
gifts ; type: X
A balance sheet, showing what you own and owe:
$ hledger bs
Balance Sheet 2023-02-15
|| 2023-02-15
=========================++============
Assets ||
-------------------------++------------
assets:bank:checking || $2000
assets:bank:savings || $2000
assets:cash || $50
-------------------------++------------
|| $4050
=========================++============
Liabilities ||
-------------------------++------------
liabilities:credit card || $50
-------------------------++------------
|| $50
=========================++============
Net: || $4000
An income statement (AKA profit and loss report), showing what you received and spent:
$ hledger is -MTA
Income Statement 2023-01-01..2023-02-28
|| Jan Feb Total Average
===============++==============================
Revenues ||
---------------++------------------------------
income:salary || 0 $1000 $1000 $500
---------------++------------------------------
|| 0 $1000 $1000 $500
===============++==============================
Expenses ||
---------------++------------------------------
expenses:food || 0 $50 $50 $25
---------------++------------------------------
|| 0 $50 $50 $25
===============++==============================
Net: || 0 $950 $950 $475
An account register, showing the transactions and running balance in a particular account:
$ hledger aregister checking
Transactions in assets:bank:checking and subaccounts:
2023-01-01 opening balances as:ba:savings, as:.. $1000 $1000
2023-02-01 GOODWORKS CORP in:salary $1000 $2000
Congratulations, you can now begin to track your daily finances with hledger!
Docs has more detailed help.