Sub topic 11
Calculating account balances
This chapter assumes you know the accounting equation, the five account types, and how debits and credits are posted to T-accounts. Here you will turn the posted amounts in each account into one balance.
What a balance is
An account balance is the difference between the total debits and the total credits posted to the account. You find it in three steps:
- Add the amounts on the debit side.
- Add the amounts on the credit side.
- Subtract the smaller total from the larger. The balance sits on the side with the larger total.
A balance on the debit side is a debit balance. A balance on the credit side is a credit balance. Normally an account ends up with the balance on its normal side. Assets and expenses normally have debit balances. Liabilities, equity, and revenue normally have credit balances.
Worked example
Use the January entries for a small service business. Cash received 10,000 from the owner and 1,500 from a customer, and paid 1,200 in rent.
Cash Rent Expense
------------------------- -------------------------
10,000 | 1,200 | 1,200 |
1,500 | | |
------------------------- -------------------------
Bal 10,300 (debit) Bal 1,200 (debit)For Cash, the debits total 11,500 and the credits total 1,200. The difference is 10,300, so Cash has a debit balance of 10,300. Rent Expense has one debit of 1,200 and no credits, so its balance is a debit of 1,200.
Calculating balances in code
The same rule works in a short script. This version reads the balance from the sign of the net amount.
from collections import defaultdict
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)]),
]
ledger = defaultdict(lambda: {"debit": [], "credit": []})
for date, memo, lines in journal:
for account, side, amount in lines:
ledger[account][side].append(amount)
for account, sides in ledger.items():
net = sum(sides["debit"]) - sum(sides["credit"])
kind = "debit" if net >= 0 else "credit"
print(f"{account:<22}{abs(net):>8} {kind}")Running it prints Cash as 10,300 debit, Rent Expense as 1,200 debit, and Service Revenue as 4,000 credit.
Zero balances and abnormal balances
An account with equal debits and credits has a zero balance. You usually show it as zero and do not list it as either a debit or a credit.
An abnormal balance is a balance on the side opposite the account's normal side. Some are valid. A Cash account with a credit balance means the bank account is overdrawn. Many are warning signs. A credit balance in Rent Expense, or a debit balance in Accounts Payable, usually points to a posting mistake or a payment recorded twice. Check the entries before you accept it.
Common mistakes
- Subtracting in the wrong direction. Always take the smaller total from the larger.
- Putting the balance on the wrong side. The balance goes on the side with the larger total.
- Leaving out an amount when adding. Recheck each total against the journal.
- Reading a revenue account's credit balance as a loss. For revenue, a credit balance is normal.
Exercise
Accounts Payable has credits of 800 and 350, and a debit of 500 for a partial payment. What is its balance, and is it normal?
Show answer
Credits total 1,150 and debits total 500. The balance is 650, a credit balance. This is normal, because liabilities normally have credit balances.
Exercise
After posting, Service Revenue shows debits of 300 (a refund) and credits of 4,000. What is the balance?
Show answer
The credits (4,000) are larger than the debits (300). The balance is a credit of 3,700, which is normal for revenue.