TExcelTAD
Home › Basic Math & Pre-Algebra › Simple and Compound Interest

Simple and Compound Interest

Interest is what you pay to borrow money, or earn by lending or saving it. With simple interest you earn the same amount every period; with compound interest you also earn interest on earlier interest, so the balance grows faster and faster. This lesson gives both formulas, compares them, covers compounding frequency and APR vs APY, and builds an exact savings table with Decimal.

The words

Term Meaning
principal PP the amount borrowed or deposited at the start
rate rr interest per period, as a decimal (5% per year → r=0.05r = 0.05)
time tt number of periods (usually years)
interest II the money added on top
amount AA principal+interest\text{principal} + \text{interest} at the end

Simple interest

Interest is computed on the original principal only, the same amount every year:

I=P×r×tA=P+I=P×(1+r×t)\begin{aligned} I &= P \times r \times t \\ A &= P + I = P \times (1 + r \times t) \end{aligned}

1000 at 5% simple interest for 3 years: I=1000×0.05×3=150I = 1000 \times 0.05 \times 3 = 150, so A=1150A = 1150. The balance grows in a straight line: +50, +50, +50. Short loans and some bonds work this way.

Compound interest

Each year's interest is added to the balance, and next year's interest is computed on the new, larger balance. Each year multiplies the balance by (1+r)(1 + r), just like a repeated percent change:

A=P×(1+r)tA = P \times (1 + r)^t

1000 at 5% compounded yearly for 3 years:

year 1:1000.00×1.05=1050.00year 2:1050.00×1.05=1102.50year 3:1102.50×1.05=1157.625≈1157.63\begin{aligned} \text{year 1:}&\quad 1000.00 \times 1.05 = 1050.00 \\ \text{year 2:}&\quad 1050.00 \times 1.05 = 1102.50 \\ \text{year 3:}&\quad 1102.50 \times 1.05 = 1157.625 \approx 1157.63 \end{aligned}

7.63 more than simple interest. Small at first, but the gap widens with time because the growth is exponential:

python · try it yourself
P, r = 1000, 0.05
print("year   simple   compound")
for t in [1, 3, 5, 10, 20, 30]:
    simple = P * (1 + r * t)
    compound = P * (1 + r) ** t
    print(f"{t:4}  {simple:8.2f}  {compound:9.2f}")
year   simple   compound
   1   1050.00    1050.00
   3   1150.00    1157.63
   5   1250.00    1276.28
  10   1500.00    1628.89
  20   2000.00    2653.30
  30   2500.00    4321.94

After 30 years, compound interest has more than quadrupled the money; simple interest has only multiplied it by 2.5.

Compounding more often

Banks often compound monthly or daily. With a yearly rate rr compounded nn times a year, each period uses rate rn\frac{r}{n}, and there are n×tn \times t periods:

A=P×(1+rn)ntA = P \times \left(1 + \frac{r}{n}\right)^{nt}

The more often you compound, the more you earn, but the gain levels off. The yearly growth you actually get is the APY (annual percentage yield, or effective annual rate); the quoted rr is the APR (nominal rate):

APY=(1+rn)n−1\text{APY} = \left(1 + \frac{r}{n}\right)^n - 1
python · try it yourself
import math

r = 0.06
for name, n in [("yearly", 1), ("quarterly", 4), ("monthly", 12), ("daily", 365)]:
    apy = (1 + r / n) ** n - 1
    print(f"{name:10} APY = {apy:.4%}")
print(f"{'continuous':10} APY = {math.exp(r) - 1:.4%}")
yearly     APY = 6.0000%
quarterly  APY = 6.1364%
monthly    APY = 6.1678%
daily      APY = 6.1831%
continuous APY = 6.1837%

The limit as nn grows without bound is continuous compounding, A=P×ertA = P \times e^{rt}, where e≈2.71828e \approx 2.71828 is the number you will meet in Common and Natural Logs.

The rule of 72

How long does money take to double? Roughly 72÷(rate in percent)72 \div (\text{rate in percent}) years. At 6%, about 726=12\frac{72}{6} = 12 years (exactly: ln⁡2/ln⁡1.06≈11.9\ln 2 / \ln 1.06 \approx 11.9). It works for anything growing at a steady percentage: prices under inflation, user counts, even debt.

An exact savings table with Decimal

Real bank code rounds to cents every period, and that rounding must be exact and repeatable. Monthly deposits of 200 into an account paying 4.8% a year, compounded monthly (0.4% a month):

python · try it yourself
from decimal import Decimal, ROUND_HALF_EVEN

CENT = Decimal("0.01")
monthly_rate = Decimal("0.048") / 12          # exactly 0.004
balance = Decimal("0.00")

for month in range(1, 13):
    balance += Decimal("200.00")
    interest = (balance * monthly_rate).quantize(CENT, rounding=ROUND_HALF_EVEN)
    balance += interest
    if month in (1, 2, 3, 12):
        print(f"month {month:2}: interest {interest:>5}  balance {balance:>8}")

print("deposited:", 12 * Decimal("200.00"), " earned:", balance - 12 * Decimal("200.00"))
month  1: interest  0.80  balance   200.80
month  2: interest  1.60  balance   402.40
month  3: interest  2.41  balance   604.81
month 12: interest  9.81  balance  2463.33
deposited: 2400.00  earned: 63.33

In software

  • Fintech and banking: loan schedules, savings projections and credit-card interest are compound-interest loops with exact Decimal rounding at each period, written to match the bank's documented rules to the cent.
  • Growth modelling: user growth, storage growth and cloud costs that grow by a fixed percentage per month follow A=P(1+r)tA = P(1 + r)^t. Capacity planning uses it to predict when a disk fills up.
  • Retry back-off: exponential back-off (wait 1 s, 2 s, 4 s, …) is "compounding at 100% per retry".

Exercises

Exercise 1: Simple interest

You borrow 2400 at 6% simple interest for 18 months. How much interest do you pay?

Answer

216

Solution

18 months is t=1.5t = 1.5 years. I=P×r×t=2400×0.06×1.5=144×1.5=216I = P \times r \times t = 2400 \times 0.06 \times 1.5 = 144 \times 1.5 = 216.

Exercise 2: Compound by hand

5000 is invested at 4% compounded yearly. What is it worth after 2 years?

Answer

5408.00

Solution
year 1:5000×1.04=5200year 2:5200×1.04=5408\begin{aligned} \text{year 1:}&\quad 5000 \times 1.04 = 5200 \\ \text{year 2:}&\quad 5200 \times 1.04 = 5408 \end{aligned}

Or in one step: 5000×1.042=5000×1.0816=54085000 \times 1.04^2 = 5000 \times 1.0816 = 5408.

Exercise 3: Rule of 72

Prices rise 3% a year. Roughly how many years until they double? Compare with the exact value.

Answer

About 24 years (exactly about 23.45).

Solution

Rule of 72: 72÷3=2472 \div 3 = 24 years. Exactly, solve 1.03t=21.03^t = 2: t=ln⁡2/ln⁡1.03t = \ln 2 / \ln 1.03.

python · try it yourself
import math
print(round(math.log(2) / math.log(1.03), 2))
23.45

Exercise 4: When does the disk fill?

A database uses 300 GB and grows 8% per month. The disk holds 1000 GB. Write a loop that finds the first month in which usage exceeds the disk.

Answer

Month 16 (about 1027 GB).

Solution

Multiply by 1.08 each month until the value passes 1000. Check: 300×1.0815≈951.7300 \times 1.08^{15} \approx 951.7 and 300×1.0816≈1027.8300 \times 1.08^{16} \approx 1027.8.

python · try it yourself
usage, month = 300.0, 0
while usage <= 1000:
    month += 1
    usage *= 1.08
print(month, round(usage, 1))
16 1027.8

Test yourself

What is the simple interest on 800 at 5% per year for 4 years?

  1. 40
  2. 160
  3. 172.41
  4. 200

1000 at 10% compounded yearly for 2 years becomes…

  1. 1200
  2. 1210
  3. 1100
  4. 1020

A loan quotes 12% APR compounded monthly. The APY is…

  1. exactly 12%
  2. less than 12%
  3. about 12.68%
  4. 144%