Plain-text Accounting with hledger
2026-02-11 WedIf there’s one thing I love, it’s a system. I live and die by my to-do list. I have a system for my calendar, my journal, tracking my habits, meal planning, workouts, budgeting and so on. The beauty of these systems, although seemingly rigid, is that I can adapt and change them to my needs overtime. For budgeting, I’m currently using YNAB (You Need a Budget) but when I caught wind of hledger, a CLI accounting software, I wanted to give it a try.
hledger is a plain-text accounting and CLI tool which enforces double-entry accounting - each transaction always touches two accounts and the net difference will always be zero. In other words, every credit will have an associated and equal debit and vice-versa. YNAB, on the other hand, encourages envelope budgeting and is a single-entry system.
hledger uses \*.journal files to hold transactions. A transaction is a text
entry that may look like this:
2023-03-20 Grocery store
expenses:food:groceries $100
assets:cash $-40
assets:checking $-60
Which means I spent $100 at the grocery store, paid $40 in cash and $60 with debit card. The net difference is $0 as seen in double-entry accounting.
This post isn’t meant to be a full setup overview but I want to cover my initial thoughts as I get more and more familiar with the tool:
- It is helpful to think of transactions as simply changes in each account rather than inflows or outflows. Everything is an account.
- The process is much more manual than with YNAB. I do have CSV imports set up but I’ll still need to verify the files are imported correctly.
- Envelope budgeting is possible, but a little hacky. You would need to set up a
corresponding budget account for your expenses. For example:
expenses:grocerieswould need anassets:checking:budget:groceriesaccount to balance. This effectively doubles the number of accounts you have to keep track of. - The forecasting views are much more useful in hledger.
- I decided to balance my stock portfolio
assets:investmentsas a whole againstequity:gains/losses. hledger has extensive documentation on tracking investments and stock sales but I wanted to keep things simple. This is also similar to what I did in YNAB where I would just periodically reconcile the investment accounts.
I still have my YNAB subscription for a few more months so I have time to decide whether I want to ditch it in favor of hledger. So far, I’m having fun setting this up and curious to see what benefits or valuable insights it can provide me over YNAB.