Compound Interest Calculator Formula

Understand the math behind the compound interest calculator. Each variable explained with a worked example.

Formulas Used

Future Value

future_value = monthly_rate > 0 ? principal * pow(1 + monthly_rate, num_months) + monthly_contribution * (pow(1 + monthly_rate, num_months) - 1) / monthly_rate : principal + monthly_contribution * num_months

Total Contributions

total_contributions = principal + monthly_contribution * num_months

Total Interest Earned

total_interest_earned = future_value - total_contributions

Variables

VariableDescriptionDefault
principalInitial Investment(USD)10000
monthly_contributionMonthly Contribution(USD)200
annual_rateAnnual Interest Rate(%)7
yearsTime Period(years)20
monthly_rateDerived value= annual_rate / 12 / 100calculated
num_monthsDerived value= years * 12calculated

How It Works

How Compound Interest Actually Works

Compound interest means you earn interest on your interest. After month one, your earnings get added to your balance, and next month you earn interest on that larger number. Over short periods the effect is small. Over decades it gets dramatic.

The Formula

FV = P(1+r)^n + PMT * [(1+r)^n - 1] / r

  • FV = What your money grows to
  • P = Starting amount
  • PMT = What you add each month
  • r = Monthly interest rate (annual rate / 12 / 100)
  • n = Total months
  • When to Use This

    Use it to compare saving vs. spending decisions. If you're wondering whether to invest $200/month or spend it, plug the numbers in and see what 20 years of compounding does. It's also useful for comparing two scenarios side by side, like 6% vs 8% returns, or starting now vs. starting in 5 years.

    What This Assumes

    This calculator uses a fixed rate of return, which doesn't happen in real markets. The S&P 500 has averaged about 10% per year historically (7% after inflation), but individual years swing from -37% to +52%. Use this for planning estimates, not predictions. It also assumes monthly compounding, which is standard for most savings accounts and investment platforms.

    The Part People Underestimate

    The contribution matters more than the starting amount when you have time. $200/month for 30 years at 7% grows to about $243,000 in contributions and $243,000 in interest. Half of your ending balance came from money you never deposited. But almost all of that interest growth happens in the last 10 years. The first decade feels slow, and that's where most people give up.

    Common Mistakes

  • Using a pre-inflation return rate and treating the result as today's purchasing power. If you use 10%, subtract 3% for inflation to get a realistic number.
  • Ignoring taxes on investment gains. In a taxable account, your actual growth is lower than the nominal rate.
  • Comparing compound interest across different compounding frequencies without adjusting. Monthly compounding at 6% is slightly more than annual compounding at 6%.
  • Worked Example

    You invest $10,000 and add $200 per month at 7% annual return for 20 years.

    principal = 10000monthly_contribution = 200annual_rate = 7years = 20
    1. 01Monthly rate: 7% / 12 = 0.5833% (0.005833)
    2. 02Total months: 20 * 12 = 240
    3. 03Growth of initial investment: $10,000 * (1.005833)^240 = $40,387.39
    4. 04Growth of contributions: $200 * [(1.005833)^240 - 1] / 0.005833 = $104,185.06
    5. 05Future Value = $40,387.39 + $104,185.06 = $144,572.45
    6. 06Total contributions: $10,000 + ($200 * 240) = $58,000
    7. 07Total interest earned: $144,572.45 - $58,000 = $86,572.45

    When to Use This Formula

    • Projecting how much a retirement account will grow over 20-30 years with regular contributions and reinvested returns.
    • Comparing savings accounts or CDs with different compounding frequencies (monthly vs. daily vs. annually) to see the real difference in earnings.
    • Estimating how long it will take an investment to double at a given rate, and verifying the Rule of 72 approximation.
    • Calculating the future value of a lump sum inheritance or bonus if invested today, to weigh spending now versus investing.
    • Determining how much you need to invest today to reach a specific goal amount by a target date, by solving for the present value.
    • Understanding the true cost of credit card debt that compounds daily on unpaid balances over months or years.

    Common Mistakes to Avoid

    • Confusing the compounding frequency (n) with the number of years (t) — n is how many times per year interest compounds (12 for monthly, 365 for daily), while t is the total time in years.
    • Using the nominal annual rate when the effective annual rate is what matters for comparison — an account compounding daily at 5% yields more than one compounding annually at 5%, and the formula shows this only when n is set correctly.
    • Forgetting to convert the percentage rate to a decimal before plugging it in — entering 5 instead of 0.05 produces absurdly large results.
    • Ignoring the effect of fees and taxes on actual returns — the formula gives gross growth, but a 1% annual fee compounds against you just as powerfully as returns compound for you.
    • Assuming contributions are included in the basic A = P(1+r/n)^(nt) formula — this version handles lump sums only; regular contributions require the future value of annuity addition.

    Frequently Asked Questions

    What is compound interest?

    Compound interest is interest earned on both your initial principal and previously earned interest. Unlike simple interest, compound interest grows exponentially over time.

    How often is interest compounded?

    This calculator assumes monthly compounding, which is the most common for savings accounts and investments. Some accounts compound daily, quarterly, or annually.

    What is the Rule of 72?

    The Rule of 72 is a quick way to estimate how long it takes to double your money. Divide 72 by your annual interest rate. At 7%, it takes approximately 72/7 = 10.3 years to double.

    How much does starting early matter for compound interest?

    Starting early has a dramatic effect. Investing $200/month from age 25 to 65 at 7% yields roughly $525,000. Waiting until age 35 and investing the same amount yields only about $243,000 — less than half — due to missing a decade of compounding.

    Learn More

    Guide

    Understanding Compound Interest

    Learn how compound interest works and why it is the most powerful force in personal finance. Covers the compound interest formula, compounding frequency, the Rule of 72, and real-world applications.

    Ready to run the numbers?

    Open Compound Interest Calculator