Sub topic 9
How the Equation Leads to Debits and Credits
What you need first
This chapter assumes you have read the earlier chapters of this tutorial. You should be able to:
- Classify items as assets, liabilities, or equity.
- State Assets = Liabilities + Equity.
- Analyze a transaction as changes to those three elements.
- Use the expanded equation, in which equity is increased by revenues and decreased by expenses and distributions to owners.
You should also be able to read a short Python program. The code uses only dictionaries, functions, and assert.
Why the equation needs a bookkeeping rule
In transaction analysis you wrote each event as a set of signed changes to assets, liabilities, and equity. That works for a handful of events. A real business records thousands of events a month, and each one touches several named accounts such as Cash, Equipment, Bank Loan, and Rent Expense. Tracking a plus or minus sign for each account by hand invites mistakes.
Double-entry bookkeeping replaces the signs with one uniform rule. Every transaction is recorded as at least two entries, and the total of one kind of entry must equal the total of the other kind. The two kinds are called debits and credits. They are not new ideas. They come directly from the shape of the accounting equation, and you can derive them in three steps.
Step 1: Give the equation two sides
Write the equation as two columns:
| Left side | Right side |
|---|---|
| Assets | Liabilities + Equity |
A T-account is a ledger account drawn as the letter T. The account name sits on top. The left column holds the entries on the left, and the right column holds the entries on the right.
A debit is an entry on the left side of an account. A credit is an entry on the right side. The abbreviations are Dr and Cr. The words come from Latin (debere, to owe, and credere, to trust). In modern bookkeeping they mean only "left" and "right". They do not mean "bad" and "good", and they do not mean "increase" and "decrease".
An account's balance is the difference between its two sides. Whichever side holds the larger total is the side the balance sits on.
Step 2: Increase an account on its own side
Assets sit on the left of the equation. The natural way to record an increase in an asset is on the left, so an increase in an asset is a debit and a decrease is a credit.
Liabilities and equity sit on the right. By the same reasoning, an increase in a liability or an equity item is a credit, and a decrease is a debit.
| Account type | Equation side | Increase | Decrease | Normal balance |
|---|---|---|---|---|
| Asset | Left | Debit | Credit | Debit |
| Liability | Right | Credit | Debit | Credit |
| Equity | Right | Credit | Debit | Credit |
The normal balance is the side on which an account usually ends up. Cash normally has a debit balance. A bank loan normally has a credit balance.
Why the rule keeps the equation balanced
Take any transaction that keeps the equation in balance. It changes the equation in one of a few ways:
| Pattern | Example | Debit | Credit |
|---|---|---|---|
| One asset up, another asset down | Buy equipment for cash | Equipment | Cash |
| Asset up, liability up | Borrow from the bank | Cash | Bank Loan |
| Asset down, liability down | Repay part of a loan | Bank Loan | Cash |
| One right-side item up, another right-side item down | Convert a payable into owner capital | Accounts Payable | Owner Capital |
In every row, the amount debited equals the amount credited. The first row moves value within the left side. The last row moves value within the right side. The middle rows change both sides by the same amount. Because a balanced equation stays balanced whenever the changes are equal, the rule "total debits = total credits" is the equation's balance condition in a different form.
Step 3: Extend the rule to revenues, expenses, and distributions
The expanded equation splits equity into parts:
Assets = Liabilities + Contributed Capital + Beginning Retained Earnings + Revenues − Expenses − Distributions
Revenues, expenses, and distributions are accounts in their own right, so each needs a side. Their sides follow from what they do to equity:
- Revenues increase equity. Equity increases with credits, so revenues are credits.
- Expenses decrease equity. Equity decreases with debits, so expenses are debits.
- Distributions (owner withdrawals or dividends) decrease equity, so they are debits.
Now move the two subtracted terms to the left of the equation:
Assets + Expenses + Distributions = Liabilities + Contributed Capital + Beginning Retained Earnings + Revenues
Every account on the left has a debit normal balance, and every account on the right has a credit normal balance. The rule now covers all six account types:
| Account type | Increase | Decrease | Normal balance |
|---|---|---|---|
| Asset | Debit | Credit | Debit |
| Expense | Debit | Credit | Debit |
| Distribution | Debit | Credit | Debit |
| Liability | Credit | Debit | Credit |
| Equity (capital, retained earnings) | Credit | Debit | Credit |
| Revenue | Credit | Debit | Credit |
An expense is debited when it increases, even though it lowers equity. This is the part learners find confusing. The expense account sits on the left of the rearranged equation, so a larger expense is a larger left-side amount. The reduction in equity is already built into the rearrangement.
Revenue, expense, and distribution accounts are temporary. At the end of a period their balances are transferred ("closed") into retained earnings, and they start the next period at zero. Asset, liability, and equity accounts are permanent and carry their balances forward.
A worked example in code
The program below keeps a ledger as two running totals per account, one for debits and one for credits. Each journal entry must have equal debit and credit totals, or the program rejects it. After the entries are posted, the program rebuilds the expanded equation from the account balances.
from collections import defaultdict
NORMAL = {
"asset": "debit",
"expense": "debit",
"distribution": "debit",
"liability": "credit",
"equity": "credit",
"revenue": "credit",
}
ACCOUNTS = {
"Cash": "asset",
"Bank Loan": "liability",
"Owner Capital": "equity",
"Service Revenue": "revenue",
"Rent Expense": "expense",
"Owner Distributions": "distribution",
}
debits = defaultdict(int)
credits = defaultdict(int)
def journal(description, *lines):
"""Post one entry. Each line is (side, account, amount); side is 'Dr' or 'Cr'."""
total_dr = sum(amt for side, _, amt in lines if side == "Dr")
total_cr = sum(amt for side, _, amt in lines if side == "Cr")
if total_dr != total_cr:
raise ValueError(f"{description}: debits {total_dr} != credits {total_cr}")
for side, account, amt in lines:
if account not in ACCOUNTS:
raise KeyError(f"Unknown account: {account}")
(debits if side == "Dr" else credits)[account] += amt
def balance(account):
"""Balance shown on the account's normal side (positive means normal)."""
net = debits[account] - credits[account]
return net if NORMAL[ACCOUNTS[account]] == "debit" else -net
def total(kind):
return sum(balance(a) for a, k in ACCOUNTS.items() if k == kind)
journal("Owner invests cash", ("Dr", "Cash", 20000), ("Cr", "Owner Capital", 20000))
journal("Borrow from bank", ("Dr", "Cash", 5000), ("Cr", "Bank Loan", 5000))
journal("Repay part of loan", ("Dr", "Bank Loan", 2000), ("Cr", "Cash", 2000))
journal("Cash service revenue", ("Dr", "Cash", 4000), ("Cr", "Service Revenue", 4000))
journal("Pay rent", ("Dr", "Rent Expense", 1500), ("Cr", "Cash", 1500))
journal("Owner withdraws cash", ("Dr", "Owner Distributions", 1000), ("Cr", "Cash", 1000))
for name in ACCOUNTS:
print(f"{name:20} {balance(name):>7} ({NORMAL[ACCOUNTS[name]]})")
# Trial balance: total debits must equal total credits.
sum_dr = sum(debits.values())
sum_cr = sum(credits.values())
print("Total debits:", sum_dr, "Total credits:", sum_cr) # 32500 and 32500
assert sum_dr == sum_cr
# Expanded equation: Assets = Liabilities + Capital + Revenues - Expenses - Distributions
left = total("asset")
right = (total("liability") + total("equity") + total("revenue")
- total("expense") - total("distribution"))
print("Assets:", left, "Right side:", right) # 24500 and 24500
assert left == rightCash ends at 24,500 (20,000 + 5,000 − 2,000 + 4,000 − 1,500 − 1,000). The bank loan is 3,000. The program checks the books in two ways, and the two checks agree:
- Trial balance: total debits equal total credits (32,500 each).
- Expanded equation: assets of 24,500 equal liabilities and equity of 3,000 + 20,000 + 4,000 − 1,500 − 1,000 = 24,500.
The first check is about entries. The second is about balances. The debit-credit rule makes the first check imply the second.
The trial balance and its limits
A trial balance is a list of every account with its balance, split into a debit column and a credit column. The two columns must have equal totals. For the example above:
| Account | Debit | Credit |
|---|---|---|
| Cash | 24,500 | |
| Rent Expense | 1,500 | |
| Owner Distributions | 1,000 | |
| Bank Loan | 3,000 | |
| Owner Capital | 20,000 | |
| Service Revenue | 4,000 | |
| Total | 27,000 | 27,000 |
The totals here are 27,000, not 32,500 as in the program's output. The program's 32,500 sums every debit and credit entry, including the ones that were later offset, such as the cash received and then paid. The trial balance sums the net balances. Both totals are equal on each side, which is what matters.
A trial balance that agrees proves only that debits equal credits. It does not prove the books are right. It catches:
- An entry recorded on only one side.
- An entry posted with debit and credit amounts that differ.
- A balance copied to the wrong column.
- A digit transposition in one amount (for example 540 posted as 450). The difference is always divisible by 9.
It does not catch:
- A transaction that was never recorded, because both sides are missing.
- An entry posted to the wrong account of the right type, such as Rent Expense instead of Utilities Expense.
- An entry posted with the right amounts on the wrong sides in both lines, for example debiting and crediting the right accounts but reversed.
- Two separate errors that offset each other.
- The same wrong amount posted on both sides.
Common mistakes
Treating debit as "increase" and credit as "decrease." This holds only for asset, expense, and distribution accounts. Paying off a loan debits the liability, and it decreases it. Receiving revenue credits the revenue account, and it increases it.
Reading your bank statement as if it were your own books. When a bank says it has "credited your account" after a deposit, the bank is recording a liability, because it owes you that money. Your own books record the same event as a debit to Cash. The same event is a credit on the bank's books and a debit on yours, because each of you sits on a different side of it.
Assuming a balance on the wrong side is always an error. An asset account with a credit balance, such as a bank account that is overdrawn, is unusual and deserves a look. It is sometimes a real situation and sometimes a posting mistake. In a trial balance it simply appears in the opposite column.
Forgetting contra accounts. A contra account is an account that sits within one category but carries the opposite normal balance. Accumulated depreciation is the standard example. It reduces the equipment asset, so it is credit-normal while sitting under assets. Increasing it is a credit, and the matching depreciation expense is a debit.
Entering one-sided transactions. Every transaction needs at least one debit and at least one credit. A compound entry has more than two lines, such as buying equipment for 10,000 by paying 4,000 cash and borrowing 6,000. The debit to Equipment of 10,000 equals the credits to Cash (4,000) and Bank Loan (6,000).
Where this leaves you
The debit and credit rules are the accounting equation turned into a procedure. Left-side accounts grow with debits and right-side accounts grow with credits. Because every entry has equal debits and credits, the equation stays in balance after every transaction. The rest of bookkeeping, including journals, ledgers, adjusting entries, and closing entries, builds on this one rule.
Exercise
A company pays 3,000 cash to buy supplies, and later pays 800 cash for the month's utilities. Write each as a journal entry (account and Dr or Cr), taking Supplies as an asset and Utilities Expense as an expense. Say how each entry affects the equation.
Show answer
Supplies purchase: Dr Supplies 3,000, Cr Cash 3,000. One asset rises and another falls by the same amount, so total assets, liabilities, and equity are unchanged. Utilities: Dr Utilities Expense 800, Cr Cash 800. The expense is debited because expenses are on the left of the rearranged equation. Assets fall by 800 and equity falls by 800 through the expense, so the equation still balances.
Exercise
A trial balance has debit total 41,250 and credit total 41,520. Suggest the most likely type of error and the first check to make.
Show answer
The difference is 270, which is divisible by 9, so a transposition error is likely (for example 4,520 posted as 4,250, or 3,450 posted as 3,720 in the wrong direction). Check amounts that have two adjacent digits swapped, and compare the posted amounts against the journal entries and source documents.
Exercise
A customer pays 1,200 in advance for services you have not yet performed. Which accounts do you debit and credit, and why is the credit not a revenue account?
Show answer
Dr Cash 1,200, Cr Unearned Revenue 1,200. You have received cash (an asset, debited), but you now owe the customer a service, which is an obligation (a liability, credited). Revenue is recorded only when the service is performed, at which point you debit Unearned Revenue and credit Service Revenue.