PTA: Plain Text Accounting

Recently I learned about PTA: Plain Text Accounting. You can record income and expenses with plain text, gather data programmatically, then calculate and visualize. Ledger, hledger, and Beancount are software tools that provide a way to express double-entry bookkeeping in plain text. They use similar plain-text DSLs, though Beancount is not directly source-compatible with the others.

Here’s a small example of Beancount syntax (Assume these accounts were opened earlier):

2026-08-03 * "Employer" "Salary"
  Assets:Bank                 300000 JPY
  Income:Salary

2026-08-04 * "Cafe" "Coffee"
  Expenses:Food                  600 JPY
  Assets:Bank

What does it mean

PTA provides a shared style of notation for expressing accounting activities in plain text. This is handy common knowledge in case we want to write down transactions quickly in a text file or even on a whiteboard. Similar to the benefit of UML.

Plain text may be a mediocre UI. While it’s easy to write, it’s also easy to make mistakes. The ledger written in PTA is not as readable as a dedicated GUI view. However, since PTA is plain text, LLMs can read and process it as-is. I don’t think I can always write it with valid syntax, and I don’t think it’s very readable, but I can have AI write it, run validation, process, and integrate with other tools. LLMs are often reliable enough, at least for mechanical operations.

So a PTA journal can serve as a portable and inspectable intermediate format that humans, deterministic tools, and AI agents can all work with.

Quick Beancount Hands-on

Let’s say we have an example ledger as follows.

option "title" "PTA Sandbox"

; this is a comment;
; Beancount requires opening every account first
2026-08-01 open Assets:Bank JPY
2026-08-01 open Liabilities:Card JPY
2026-08-01 open Equity:Opening-Balances JPY
2026-08-01 open Income:Salary JPY
2026-08-01 open Expenses:Food JPY

; record an opening balance of 100,000 yen
; the amount of the balancing posting can be omitted
2026-08-02 * "Opening balance"
  Assets:Bank                 100000 JPY
  Equity:Opening-Balances

2026-08-03 * "Employer" "Salary"
  Assets:Bank                 300000 JPY
  Income:Salary

2026-08-04 * "Cafe" "Coffee"
  Expenses:Food                  600 JPY
  Assets:Bank

2026-08-05 * "Supermarket" "Groceries"
  Expenses:Food                 5000 JPY
  Liabilities:Card

2026-08-10 * "Credit-card payment"
  Liabilities:Card              5000 JPY
  Assets:Bank

You can read it with Fava like below. Fava provides a web interface for Beancount.

docker run --rm -it \
  -p 5000:5000 \
  -v "$(pwd):/work" \
  -w /work \
  python:3.13-slim \
  sh -lc '
    pip install --no-cache-dir fava &&
    bean-check ledger.beancount &&
    exec fava --host 0.0.0.0 ledger.beancount
'

Journal:

Income statement:

Trial balance:

Gentaro "hibariya" Terada

Otakanomori, Nagareyama, Chiba, Japan
Email me

Likes Ruby, Internet, and Programming.