Simple Interest vs Compound Interest: The Fundamental Difference
Simple interest calculates interest only on the original principal. Compound interest calculates interest on both the principal and all previously earned interest. This distinction seems minor for short time periods but produces dramatically different outcomes over decades.
| Year | Simple Interest (10%) | Compound Interest (10%) |
|---|---|---|
| 0 | $10,000 | $10,000 |
| 5 | $15,000 | $16,105 |
| 10 | $20,000 | $25,937 |
| 20 | $30,000 | $67,275 |
| 30 | $40,000 | $174,494 |
Starting from $10,000 at 10% annual interest: after 30 years, simple interest yields $40,000. Compound interest yields $174,494 — more than four times as much. The extra $134,000 is earned entirely by interest accruing on interest.
This is why financial advisers emphasise starting early: an extra 10 years at the beginning of a compounding curve is worth far more than an extra 10 years at the end.
The Compound Interest Formula
The standard compound interest formula is:
A = P × (1 + r/n)^(n×t)
Where:
- A — final amount (principal + interest)
- P — principal (initial investment)
- r — annual interest rate as a decimal (e.g. 7% = 0.07)
- n — number of times interest is compounded per year
- t — time in years
Example: $5,000 invested at 6% annual interest, compounded monthly, for 10 years:
A = 5000 × (1 + 0.06/12)^(12×10) A = 5000 × (1.005)^120 A = 5000 × 1.8194 A = $9,096.98
The total interest earned is $9,096.98 − $5,000 = $4,096.98 — nearly doubling the original investment without a single additional contribution.
For continuous compounding (the mathematical limit as n → ∞), the formula simplifies to:
A = P × e^(r×t)
Continuous compounding is used in certain financial derivatives and theoretical models; real-world savings accounts and investments use discrete compounding (daily, monthly, or annually).
Compounding Frequency: How Often Matters
The variable n — the number of compounding periods per year — has a real but often overestimated effect on final returns. More frequent compounding is always better for an investor, but the difference between monthly and daily compounding is small. The difference between annual and monthly compounding is more meaningful.
| Frequency | n | $10,000 at 8% for 20 years |
|---|---|---|
| Annually | 1 | $46,609.57 |
| Quarterly | 4 | $48,010.21 |
| Monthly | 12 | $48,454.49 |
| Daily | 365 | $49,020.00 |
| Continuous | ∞ | $49,021.28 |
Going from annual to monthly compounding on a $10,000 investment over 20 years gains you ~$1,845. Going from monthly to daily gains you only another ~$565. Time in the market matters far more than compounding frequency.
For credit card debt and loans, the logic is inverted — more frequent compounding hurts the borrower. A credit card with 24% APR compounded daily has an effective annual rate (EAR) of (1 + 0.24/365)^365 − 1 = 27.11%, significantly higher than the advertised 24%.
The Rule of 72: Mental Math Shortcut
The Rule of 72 lets you estimate the doubling time of an investment without a calculator:
Years to double ≈ 72 / annual interest rate (%)
Examples:
- At 6%: 72 / 6 = 12 years to double
- At 8%: 72 / 8 = 9 years to double
- At 12%: 72 / 12 = 6 years to double
- At 1% (savings account): 72 / 1 = 72 years to double
The Rule of 72 is an approximation — it is most accurate for rates between 6% and 10%. For higher rates, use the Rule of 70 or the Rule of 69.3 (which is exact for continuous compounding).
You can also use it in reverse: if you want your money to double in 10 years, you need an annual return of 72/10 = 7.2%.
And for inflation: if inflation runs at 3%, purchasing power halves in 72/3 = 24 years. A dollar today buys 50 cents' worth of goods in 2049 at 3% inflation.
Code Examples: Compound Interest in Python and JavaScript
These implementations handle the general compound interest formula and generate a year-by-year amortization schedule.
def compound_interest(principal, rate, n, years):
"""
principal: initial amount
rate: annual rate as decimal (e.g. 0.07 for 7%)
n: compounding periods per year (12 = monthly)
years: investment duration
"""
amount = principal * (1 + rate / n) ** (n * years)
interest = amount - principal
return round(amount, 2), round(interest, 2)
def amortization_table(principal, rate, n, years):
"""Generates year-by-year growth table."""
rows = []
for year in range(1, years + 1):
amount, interest = compound_interest(principal, rate, n, year)
rows.append({
'year': year,
'balance': amount,
'interest_earned': interest,
})
return rows
# Example: $10,000 at 7% compounded monthly for 20 years
amount, interest = compound_interest(10_000, 0.07, 12, 20)
print(f"Final amount: ${amount:,.2f}")
print(f"Total interest: ${interest:,.2f}")
table = amortization_table(10_000, 0.07, 12, 20)
for row in table[::5]: # print every 5th year
print(f"Year {row['year']:2d}: ${row['balance']:>12,.2f}")/**
* Calculates compound interest.
* @param {number} principal - Initial amount
* @param {number} rate - Annual rate as decimal (0.07 = 7%)
* @param {number} n - Compounding periods per year
* @param {number} years - Duration in years
*/
function compoundInterest(principal, rate, n, years) {
const amount = principal * Math.pow(1 + rate / n, n * years);
return {
amount: Math.round(amount * 100) / 100,
interest: Math.round((amount - principal) * 100) / 100,
};
}
function ruleOf72(rate) {
return 72 / (rate * 100); // rate as decimal
}
// Year-by-year schedule
function amortizationSchedule(principal, rate, n, years) {
return Array.from({ length: years }, (_, i) => {
const { amount, interest } = compoundInterest(principal, rate, n, i + 1);
return { year: i + 1, balance: amount, interestEarned: interest };
});
}
// Example
const { amount, interest } = compoundInterest(10_000, 0.07, 12, 20);
console.log(`Final: $${amount.toLocaleString()}`);
console.log(`Interest: $${interest.toLocaleString()}`);
console.log(`Rule of 72 (7%): doubles in ~${ruleOf72(0.07).toFixed(1)} years`);Common Compound Interest Calculation Mistakes
- Using the rate as a percentage instead of a decimal. Plugging 7 instead of 0.07 into the formula produces wildly wrong results. Always convert: rate% ÷ 100 = rate decimal.
- Confusing APR and APY. APR (Annual Percentage Rate) does not account for compounding within the year. APY (Annual Percentage Yield) does. When comparing savings accounts or loans, always compare APY — it is the true effective annual rate. A 12% APR compounded monthly equals a 12.68% APY.
- Ignoring inflation. A 7% nominal return in a 3% inflation environment is a real return of approximately 3.88% (not simply 4%). Use the Fisher equation for real returns:
real rate = (1 + nominal) / (1 + inflation) − 1. - Assuming taxes away. Investment gains are typically taxable events. A 7% gross return becomes 5.6% net in a 20% capital gains tax environment. Tax-advantaged accounts (401k, IRA, ISA, ELSS) change this calculation significantly.
- Forgetting fees. A 1% annual management fee on a fund compounding at 8% will consume roughly 12.5% of your 20-year return.
(1.08/1.01)^20 = 3.87×vs(1.08)^20 = 4.66×— the fee eats $0.79 of every $4.66 earned.