Compound Interest Calculator
Visualize how your investments grow over time with compound interest and regular contributions.
Parameters
Final Amount
$292.5K
20 yr
Total Principal
$130.0K
Total Gain
$162.5K
+125.0%
Growth over time
Year-by-year breakdown
| Year | Principal | Interest | Total |
|---|---|---|---|
| 1 | $16.0K | $890.00 | $16.9K |
| 2 | $22.0K | $2,263.00 | $24.3K |
| 3 | $28.0K | $4,151.00 | $32.2K |
| 4 | $34.0K | $6,592.00 | $40.6K |
| 5 | $40.0K | $9,623.00 | $49.6K |
| 6 | $46.0K | $13.3K | $59.3K |
| 7 | $52.0K | $17.6K | $69.6K |
| 8 | $58.0K | $22.7K | $80.7K |
| 9 | $64.0K | $28.5K | $92.5K |
| 10 | $70.0K | $35.2K | $105.2K |
| 11 | $76.0K | $42.8K | $118.8K |
| 12 | $82.0K | $51.3K | $133.3K |
| 13 | $88.0K | $60.8K | $148.8K |
| 14 | $94.0K | $71.4K | $165.4K |
| 15 | $100.0K | $83.1K | $183.1K |
| 16 | $106.0K | $96.2K | $202.2K |
| 17 | $112.0K | $110.5K | $222.5K |
| 18 | $118.0K | $126.3K | $244.3K |
| 19 | $124.0K | $143.5K | $267.5K |
| 20 | $130.0K | $162.5K | $292.5K |
Did this tool solve your problem?
Code Examples
JavaScript
// Compound interest with monthly contributions
function compoundGrowth(P, r, n, t, pmt) {
// P = principal, r = annual rate (decimal)
// n = compounds/year, t = years, pmt = monthly contrib
const monthlyRate =
Math.pow(1 + r / n, n / 12) - 1;
let balance = P;
for (let y = 1; y <= t; y++) {
for (let m = 0; m < 12; m++) {
balance *= (1 + monthlyRate);
balance += pmt;
}
}
return balance;
}
// Example: $10k at 7%, 20 years, $500/mo
console.log(compoundGrowth(10000, 0.07, 1, 20, 500));
// → ~$284,428Python
def compound_growth(P, r, n, t, pmt=0):
"""
P = initial principal
r = annual rate (decimal, e.g. 0.07)
n = compounding frequency per year
t = years
pmt = monthly contribution
"""
monthly_rate = (1 + r / n) ** (n / 12) - 1
balance = P
for _ in range(t * 12):
balance *= (1 + monthly_rate)
balance += pmt
return balance
# $10,000 at 7% for 20 years + $500/mo
print(f"USD {compound_growth(10000, 0.07, 1, 20, 500):,.2f}")
# → USD 284,428.09Excel / Google Sheets
// Future Value formula (no contributions) =FV(rate/n, n*t, 0, -PV) // With monthly contributions (monthly compounding) // pmt = monthly payment, rate = annual rate =FV(rate/12, years*12, -pmt, -PV) // Example: $10k principal, 7% rate, 20 years // with $500/month contribution: =FV(7%/12, 20*12, -500, -10000) // → $284,428.09 // Rule of 72 — years to double: =72 / (rate * 100)
Go
package main
import (
"fmt"
"math"
)
func compoundGrowth(P, r float64, n, t int, pmt float64) float64 {
monthlyRate := math.Pow(1+r/float64(n), float64(n)/12) - 1
balance := P
for i := 0; i < t*12; i++ {
balance *= (1 + monthlyRate)
balance += pmt
}
return balance
}
func main() {
result := compoundGrowth(10000, 0.07, 1, 20, 500)
fmt.Printf("$%.2f\n", result) // $284,428.09
}Frequently Asked Questions
What is compound interest?
Compound interest means earning returns not just on your initial principal, but also on the interest already accumulated. Over time, this creates exponential growth — famously called 'the eighth wonder of the world' by Einstein.
How does compound frequency affect growth?
The more frequently interest compounds (daily vs. annually), the slightly higher your effective annual yield (APY). Daily compounding produces marginally more than annual compounding at the same nominal rate.
What annual return rate should I use?
The historical average of the S&P 500 is around 10% nominal per year, or about 7% after inflation. For conservative projections use 5–6%; for bonds or savings, 2–4% is more realistic.
How are regular contributions calculated?
Monthly contributions are added at the end of each month after interest is applied, using an annuity formula. Annual contributions are added at the end of each year. This calculator simulates month-by-month for accuracy.
Why does my investment balance grow slowly at first?
Compound interest is exponential — growth accelerates over time. In the early years most of your balance is principal; in later years earned interest can exceed your contributions entirely. This is why starting early matters so much.
What is the Rule of 72?
Divide 72 by your annual return rate to estimate how many years it takes to double your money. At 7% return, 72 ÷ 7 ≈ 10.3 years to double. At 10%, it's about 7.2 years.