The ledger account tree
5 min read

The ledger account tree

The ledger account tree
Photo by Adarsh Kummur / Unsplash

I explained why software engineers should know the double-entry accounting design pattern in the previous issue. The basics of double-entry accounting are relatively simple: all journal entries are balanced. But how are you going to translate a financial fact from the business domain to journal entries? That's today's topic!

In the examples of the previous issue, I used a special notation for ledger accounts called a materialized path: balance_sheet.current_assets.accounts_receivable. Ledger accounts are structured like a tree. When accounting displays journal entries, it often only says "Accounts receivable". I find it easier to see the exact path of a ledger account in the tree. Let me explain the shape of the tree.

Report types

It all starts with report types in the first level. There are roughly two types of reports in accounting: balanced-based and totals-based. The two most common examples are a balance sheet (balance-based) and a profit-loss statement (totals-based).

You can compare this with your bank account. The balance of your account is an accumulation of all transactions since the start of the account. If you never switch banks as I do, this goes back to the first guldens I received as a baby from my parents.

You have a totals-based report if you want to know how much you deposited last year. This type always spans a fixed period. The result is the sum of all entries in the period.

Balance sheet and profit-loss are the highest levels in the ledger account tree.

Balance sheet: assets, liabilities, and equity

Let's zoom in on the balance sheet. A balance sheet has two sides: a side with assets and a side with liabilities.

Assets                  | Liabilities and Equity
Current Assets          | Current Liabilities
Non-current Assets      | Non-current Liabilities
                        | Equity

Assets are things a company owns. There is a distinction between current and non-current assets. Current assets are readily available, like cash and inventory. Non-current assets are fixed and cannot easily be made liquid, like property or long-term investments.

Liabilities describe how the business is financed. These can be current liabilities that need to be resolved soon, like accounts payable and short-term loans. Non-current liabilities are long-term financial obligations, like mortgages and leases.

Like everything in double-entry accounting, the balance sheet also needs to be balanced. Equity therefore equals assets - liabilities. Equity describes the net worth of the company. Equity also contains the YTD profit of the business.

The second level in the ledger account tree are the items on the balance sheet:

-- balance_sheet ----
                    |- current_assets
                    |- non_current_assets
                    |- current_liabilities
                    |- non_current_liabilities
                    |- equity

Debit- and credit-default ledger accounts

Before continuing the profit-loss items, let me explain debit- and credit-default ledger accounts. The balance sheet has both a debit and a credit side.

You can see this on the bank accounts in current assets. When money is deposited (debit), the balance increases, thus the current assets of the company increase. Assets are debit-default.

On the other side of the balance, the opposite is happening. Ledger accounts for liabilities and equity are credit-default. A loan is entered with a credit amount instead of a debit amount. You can see this in the journal entries for a new loan. Receiving the money from a loan increases the assets in the bank account. To be balanced, it increases the liabilities by a credit booking on the loan ledger account.

│ Ledger account                            │ Debit │ Credit │
│ balance_sheet.current_assets.bank_account │ 100.0 │    0.0 │
│    │   0.0 │  100.0 │
│                                           │ 100.0 │  100.0 │

Liabilities and equity are credit-default. To increase them, you need to enter a credit amount. To decrease them, you need to enter a debit amount.

Profit & loss: revenue and expenses

The profit & loss statement is totals-based. It contains all revenue and expenses of a business. Like the balance sheet, the profit & loss report includes several items.

Revenue is the first item on the report. It contains all revenue for the business. It is followed by direct costs (or costs of goods sold), describing a company's costs to deliver the revenue. When you sell goods, the purchase price of these goods is direct costs. Therefore, direct costs are often directly related to the revenue.

Expenses are the next item. It describes all other business expenses, like office, loans, hosting, and legal expenses. The last item is other income and expenses,  which consists of income and expenses a business occurs by doing business, but is not part of the primary business. Examples are gains from foreign exchanges or expenses from interests.

The formula to calculate profit is: revenue - direct_costs - expenses + other_income_and_expenses.

Remember, the YTD profit is part of equity on the balance and, therefore, credit-default. This means an increase in revenue is entered in as a credit amount. Expenses are entered in debit. Credit revenue and debit expenses can be counter-intuitive at first. An example of journal entries of a sale:

│ Ledger account                                   │ Debit │ Credit │
│ balance_sheet.current_assets.accounts_receivable │ 100.0 │    0.0 │
│ profit_loss.revenue.consultancy                  │   0.0 │  100.0 │
│                                                  │ 100.0 │  100.0 │

So far, the entire tree of balance sheet and profit-loss ledger accounts looks like this:

-- balance_sheet ----
                    |- current_assets
                    |- non_current_assets
                    |- current_liabilities
                    |- non_current_liabilities
                    |- equity
-- profit_loss   ----
                    |- revenue
                    |- direct_costs
                    |- expenses
                    |- other_income_expenses

Ledger accounts

So far, we have the first two levels of the ledger accounts tree. These upper branches are often similar, although different countries can have different standards for items on the balance sheet and profit-loss statement. The lower branches vary more from company to company.

You will find the most variation in profit_loss.revenue. Each business has different products and services. Companies create a ledger account structure that resembles this to keep track of the revenue for these products and services. In my personal holding I have one revenue ledger account management. In the bookkeeping of Moneybird, we have many revenue ledger accounts like Revenue plan A, Revenue transactions, Revenue print services.

Most ledger accounts trees have 2 or 3 additional levels below the reports and report items. These levels allow for subaccounts and for even more granularity in reporting. An example is bank accounts on the balance: balance_sheet.current_assets.bank_accounts.bank_account_a. By creating an extra level, you can display the total balance for all bank accounts and the balances of specific bank accounts.

The specific structure of ledger accounts is often already determined within a business. When you start to journalize your financial facts, it can be wise to ask about the current structure, so you can reuse it instead of having to map it later on.

Translate your financials facts to the ledger

Now you know about the types of ledger accounts. The ledger account tree gives some pointers to translating financial facts into journal entries. Let's take some examples.

  • An Invoice in a SaaS tool generates revenue and raises the business's assets by increasing the accounts receivable. When taxes are involved, a liability to pay these taxes is created.
  • A Purchase in an expense management tool creates new expenses and means the business has a new liability to pay the creditor.
  • A Payment for an invoice is only a shift in assets—the bank account asset increases. The accounts receivable assets decrease.

There are many more examples. I will do a deep dive in Payment Service Provider and multi-sides marketplaces journal entries with more complex examples in upcoming issues.

For now, you know how the ledger account tree is structured. I find it helpful to always display the full path of the ledger account in the tree. This method makes understanding journal entries much more straightforward. In the next issue, I'll explain more about sub-ledgers in double-entry accounting. With ledger account types and the introduction, this covers the basics so we can do a deep dive into more complex examples. Subscribe to Balanced to receive future issues in your mailbox.

I'd love to hear from you! Let me know what you think or if you have questions. Do you already use double-entry accounting? Are you going to use it in the future? Please shoot me an e-mail at