GitHub
Double entry, account types and signs

Double entry, account types and signs

General educational material, not professional advice. See Not professional advice.

Double-entry bookkeeping (every transaction has two sides)

Double entry means every transaction moves value from at least one account to at least one other, and the amounts add up to zero. Money doesn’t appear or vanish. It comes from one account and goes to another. Buying groceries with a debit card lowers your bank balance and raises what you have spent on groceries by the same amount.

This rule catches mistakes. If a transaction doesn’t balance, something is missing, and hledger refuses to load it.

2026-03-02 Corner Grocery
    expenses:food:groceries         $84.20
    assets:bank:checking           $-84.20

Each line is a posting. The two postings sum to zero, so the transaction balances. hledger lets you leave one amount blank and fills it in, so assets:bank:checking with no amount would mean the same thing.

The five account types (assets, liabilities, equity, revenue, expenses)

Every account belongs to one of five types:

TypeWhat it holdsExamples
AssetsWhat you own or are owedBank accounts, cash, money customers owe you, equipment, investments
LiabilitiesWhat you owe othersCredit cards, loans, bills not yet paid, sales tax collected
EquityThe owner’s stake: assets minus liabilitiesOpening balances, owner contributions and draws, retained earnings
Revenue (income)What you earned in a periodSales, salary, interest, dividends
ExpensesWhat you used up in a periodRent, groceries, software, wages, depreciation

Assets, liabilities and equity describe what you have on a single date. They make up the balance sheet. Revenue and expenses describe what you earned and spent between two dates. They make up the income statement, also called the profit and loss statement or P&L.

hledger has a few subtypes on top of these. Cash is an asset you can spend right away, such as a bank account, and the cash flow report follows it. Conversion is an equity account that records currency exchanges. See Account types for how Ledgeline decides each account’s type.

The accounting equation (assets = liabilities + equity)

One equation ties the five types together:

Assets = Liabilities + Equity

What you own is financed either by what you owe or by your own stake. Revenue raises equity and expenses lower it, so over time the equation becomes:

Assets = Liabilities + Equity + (Revenue − Expenses)

Because every transaction balances, the equation always holds. When Ledgeline’s balance sheet checks that the two sides agree, it is checking this equation.

Debits and credits, in plain words

Debit and credit are the traditional names for the two sides of a posting. A debit is an entry on the left, and a credit is an entry on the right. They don’t mean “good” or “bad”, and “credit” on your bank statement uses the bank’s point of view, not yours.

What a debit or credit does depends on the account type:

Account typeA debit…A credit…
Assetsincreases itdecreases it
Expensesincreases itdecreases it
Liabilitiesdecreases itincreases it
Equitydecreases itincreases it
Revenuedecreases itincreases it

Every transaction has equal debits and credits. Paying rent from your bank is a debit to rent expense and a credit to the bank.

How hledger shows debits and credits (positive and negative amounts)

hledger doesn’t use the words debit and credit. A positive amount is a debit and a negative amount is a credit. The rule that every transaction sums to zero is the rule that debits equal credits.

2026-03-01 Monthly retainer from Acme
    assets:bank:checking          $2,000.00
    revenue:consulting           $-2,000.00

2026-03-05 Office rent
    expenses:rent                 $1,200.00
    assets:bank:checking         $-1,200.00

2026-03-09 Laptop stand on the credit card
    expenses:office supplies         $45.00
    liabilities:credit card         $-45.00

hledger balance on this journal shows the bank at $800, revenue at $-2,000, and the credit card at $-45. The negative numbers aren’t errors. Revenue and the credit card are credit-balance accounts, so their balances are negative in hledger.

Normal balances (why revenue and liabilities are negative in hledger)

An account’s normal balance is the side its balance is usually on:

So a healthy bank account is positive, a credit card you owe money on is negative, and a month of sales is negative. If you see the opposite, such as a positive credit card or a negative grocery total, it usually means a refund, an overpayment, or a posting on the wrong side.

hledger’s financial statement commands, balancesheet, incomestatement and cashflow, flip the sign of credit-balance accounts so they read as positive. Ledgeline’s reports do the same. hledger balance and the Journal tab show the raw signs.

Splitting one transaction across several accounts

A transaction can have more than two postings, as long as they sum to zero. A paycheck is a common example. Gross pay, minus taxes and deductions, arrives as net pay.

2026-03-31 Paycheck
    assets:bank:checking            $3,410.00
    expenses:tax:income               $820.00
    expenses:insurance:health         $270.00
    revenue:salary                 $-4,500.00

The salary is recorded at its full amount, and the taxes and insurance show up as expenses. Your books then show what you earned and where it went, not only the deposit.