OnSumo Tools

The Compound Interest Formula: How to Calculate It Step by Step

The compound interest formula is A = P(1 + r/n)^(nt). Each variable does exactly one thing. Understanding what each represents makes the formula straightforward to apply and easy to check for errors.

The formula

A = P x (1 + r/n)^(nt)

Where:

  • A = the final amount after interest
  • P = principal (your starting amount)
  • r = annual interest rate as a decimal (8% = 0.08)
  • n = number of compounding periods per year
  • t = time in years

What each variable does

P (principal) is your starting balance. A $5,000 savings deposit means P = 5,000. For a loan, P is the amount borrowed at origination.

r (annual rate) is the stated annual interest rate converted to a decimal. A 6.5% rate becomes 0.065. This is always the annual rate. The formula adjusts it for compounding frequency using n.

n (compounding periods per year) sets how often interest is calculated and added to your balance. Standard values:

  • 1 = annually
  • 4 = quarterly
  • 12 = monthly
  • 365 = daily

Most savings accounts compound monthly (n = 12). Some online banks compound daily. Mortgages in the US typically compound monthly.

t (time in years) is the duration. A 30-year mortgage has t = 30. A 6-month CD has t = 0.5. The formula expects decimal years, not months.

The exponent (nt) is the total number of compounding periods across the full time horizon. Monthly compounding over 10 years: 12 x 10 = 120 periods total.

How to calculate it step by step

Example: $8,000 deposited at 6% annual interest, compounded quarterly, for 5 years.

Values: P = 8,000 | r = 0.06 | n = 4 | t = 5

  • Step 1: Calculate r/n — 0.06 / 4 = 0.015
  • Step 2: Add 1 — 1 + 0.015 = 1.015
  • Step 3: Calculate nt — 4 x 5 = 20
  • Step 4: Raise to the power of nt — (1.015)^20 = 1.3469
  • Step 5: Multiply by P — 8,000 x 1.3469 = $10,775

Total interest earned: $10,775 - $8,000 = $2,775.

You can verify this in the Compound Interest Calculator: enter $8,000 principal, $0 monthly contribution, 6% rate, 5 years, quarterly compounding.

The formula extended for regular contributions

The basic formula handles a single lump sum deposited once and left alone. Most investors also add money regularly: a 401(k) deposit every payday, a monthly savings transfer, a recurring brokerage investment. The extended formula accounts for this:

A = P x (1 + r/n)^(nt) + PMT x [((1 + r/n)^(nt) - 1) / (r/n)]

Where PMT is the periodic payment amount per compounding period.

Example: $5,000 starting balance, $300 per month added, 7% annual rate, monthly compounding, 15 years.

Values: P = 5,000 | PMT = 300 | r = 0.07 | n = 12 | t = 15 | nt = 180

Principal portion: 5,000 x (1.005833)^180 = 5,000 x 2.8499 = $14,250

Contribution portion: 300 x [(1.005833)^180 - 1] / 0.005833 = 300 x 1.8499 / 0.005833 = 300 x 317.1 = $95,130

Total: $14,250 + $95,130 = $109,380

Amount contributed: $5,000 + (300 x 180) = $59,000. The remaining $50,380 is interest earned.

The Rule of 72: a fast doubling-time estimate

Divide 72 by the annual interest rate to estimate how many years it takes to double your money.

  • At 6%: 72 / 6 = 12 years to double
  • At 8%: 72 / 8 = 9 years to double
  • At 10%: 72 / 10 = 7.2 years to double

The Rule of 72 is an approximation. For rates between 6% and 10% it is accurate to within about half a year. Below 4% or above 15%, the approximation degrades.

Common mistakes that produce wrong answers

Using the rate as a percentage instead of a decimal. If your rate is 7%, use r = 0.07, not 7. Plugging in 7 gives a result approximately 42 billion times too large.

Getting the compounding period wrong. If your account compounds monthly and you set n = 1, you underestimate the final balance. If you set n = 12 when the account actually compounds annually, you overestimate it. The compounding frequency is in your account agreement.

Confusing APR with APY. APR (Annual Percentage Rate) is the nominal rate. APY (Annual Percentage Yield), also called EAR, already accounts for the effect of compounding. If you use APY as r and also set n = 12, you are double-counting the compounding effect and will overstate the result. The formula expects APR as r. Under the Truth in Savings Act, US depository institutions must disclose both APR and APY for savings products, per Consumer Financial Protection Bureau rules.

Forgetting to convert time to years. If your account is a 6-month CD, t = 0.5, not 6. A 3-year investment is t = 3, not 36. The formula expects years.

Using PMT at the wrong frequency. In the extended formula, PMT should match the compounding period. If compounding monthly and you contribute $3,600 per year, the monthly PMT is $300 (3,600 / 12), not $3,600.

When to use which version

Use A = P(1 + r/n)^(nt) when:

  • You are calculating a single lump-sum deposit or loan with no ongoing payments
  • You want to know what a balance will be worth at a fixed future date

Use the extended PMT version when:

  • You make regular periodic deposits (retirement savings, savings plans)
  • You are modeling a loan with regular payments and want to track the balance over time

The Compound Interest Calculator applies the extended formula automatically when you enter both a starting balance and a monthly contribution. For a plain lump-sum projection, set the monthly contribution to zero.

For context on why the formula produces the growth patterns it does, see the complete compound interest guide.