Sub topic 7
Posting Journal Entries to Ledger Accounts
This chapter assumes you know the accounting equation, the five account types (assets, liabilities, equity, revenue, expenses), and that debits and credits must be equal in every entry. It covers the posting step itself: how a journal line becomes a ledger entry.
What posting is
Posting is the transfer of each line of a journal entry to the matching account in the general ledger. The journal records transactions in date order. The ledger groups them by account. Posting connects the two, so you can see everything that changed Cash, for example, in one place.
The rule is simple: a debit line goes to the debit side of its account, and a credit line goes to the credit side. The amount is copied unchanged.
The steps
- Take the next journal entry, in date order.
- For each line, find the account in the ledger.
- Copy the amount to the same side (debit or credit) of that account.
- Repeat until every line of the entry is posted.
Worked example
On January 15 a business pays 1,200 rent. The journal entry is:
Journal entry (January 15): Debit Rent Expense 1,200; Credit Cash 1,200Cash already has 10,000 and 1,500 on its debit side from earlier entries. Posting adds 1,200 to the credit side of Cash and 1,200 to the debit side of Rent Expense:
Cash Rent Expense
------------------------- -------------------------
10,000 | 1,200 | 1,200 |
1,500 | | |
------------------------- -------------------------
Bal 10,300 (debit) Bal 1,200 (debit)Each balance is the larger side minus the smaller side. For Cash, 11,500 − 1,200 = 10,300, and the larger side is the debit side.
Posting in code
The script below does what a bookkeeper does by hand. It checks that each entry balances, posts each line to a per-account debit or credit list, and then prints a trial balance.
from collections import defaultdict
# Each journal entry: (date, memo, [(account, side, amount_in_whole_dollars), ...])
journal = [
("2026-01-02", "Owner invests cash",
[("Cash", "debit", 10000), ("Owner's Capital", "credit", 10000)]),
("2026-01-05", "Buy supplies on credit",
[("Supplies", "debit", 800), ("Accounts Payable", "credit", 800)]),
("2026-01-09", "Services for cash and on account",
[("Cash", "debit", 1500), ("Accounts Receivable", "debit", 2500),
("Service Revenue", "credit", 4000)]),
("2026-01-15", "Pay rent",
[("Rent Expense", "debit", 1200), ("Cash", "credit", 1200)]),
]
# Post: copy each line to the debit or credit side of its ledger account.
ledger = defaultdict(lambda: {"debit": [], "credit": []})
for date, memo, lines in journal:
total_debits = sum(a for _, side, a in lines if side == "debit")
total_credits = sum(a for _, side, a in lines if side == "credit")
assert total_debits == total_credits, f"Unbalanced entry on {date}: {memo}"
for account, side, amount in lines:
ledger[account][side].append(amount)
# Balance each account and build the trial balance.
debit_column = credit_column = 0
for account, sides in ledger.items():
net = sum(sides["debit"]) - sum(sides["credit"])
if net >= 0:
debit_column += net
print(f"{account:<22}{net:>8}{'':>8}")
else:
credit_column += -net
print(f"{account:<22}{'':>8}{-net:>8}")
print(f"{'Totals':<22}{debit_column:>8}{credit_column:>8}")
assert debit_column == credit_columnThe totals line shows 14,800 in each column. Note that the balance check happens before posting, so an unbalanced entry never reaches the ledger.
Common mistakes
- Posting an amount to the wrong side. A debit copied to the credit side changes the balance by twice the amount.
- Posting to the wrong account, such as Supplies instead of Supplies Expense.
- Skipping a line, so only half of an entry is posted.
- Posting an entry twice.
Exercise
A journal entry reads: Debit Supplies 300; Credit Accounts Payable 300. Which ledger account receives a debit posting, and on which side of Accounts Payable does the 300 go?
Show answer
Supplies receives the 300 on its debit side. Accounts Payable receives the 300 on its credit side.
Exercise
Cash has debits of 5,000 and 2,000 and credits of 1,800 and 700. After posting, what is the balance and on which side is it?
Show answer
Debits total 7,000 and credits total 2,500, so the balance is 4,500 on the debit side.