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_monthsTotal Contributions
total_contributions = principal + monthly_contribution * num_monthsTotal Interest Earned
total_interest_earned = future_value - total_contributionsVariables
| Variable | Description | Default |
|---|---|---|
principal | Initial Investment(USD) | 10000 |
monthly_contribution | Monthly Contribution(USD) | 200 |
annual_rate | Annual Interest Rate(%) | 7 |
years | Time Period(years) | 20 |
monthly_rate | Derived value= annual_rate / 12 / 100 | calculated |
num_months | Derived value= years * 12 | calculated |
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
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
Worked Example
You invest $10,000 and add $200 per month at 7% annual return for 20 years.
- 01Monthly rate: 7% / 12 = 0.5833% (0.005833)
- 02Total months: 20 * 12 = 240
- 03Growth of initial investment: $10,000 * (1.005833)^240 = $40,387.39
- 04Growth of contributions: $200 * [(1.005833)^240 - 1] / 0.005833 = $104,185.06
- 05Future Value = $40,387.39 + $104,185.06 = $144,572.45
- 06Total contributions: $10,000 + ($200 * 240) = $58,000
- 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