Compound Interest Calculator

See how a lump sum grows over time with compound interest, and how compounding frequency changes the result.

Monthly

How the calculation works

This calculator uses A = P(1 + r/n)^(nt), where P is the principal, r is the annual rate as a decimal, n is how many times per year interest compounds, and t is the number of years. Unlike simple interest, each compounding period earns interest on the principal plus everything accumulated so far, which is why the growth curve bends upward rather than running in a straight line.

Worked example

$10,000 invested at 5% annual interest, compounded monthly, for 10 years: n = 12, r = 0.05, t = 10. Plugging in gives 10000 × (1 + 0.05/12)^120 ≈ $16,470.09, for total interest of about $6,470.09 on the original $10,000.

Compounding frequency comparison ($10,000 at 5% for 10 years)

FrequencyFinal balance
Annually$16,288.95
Monthly$16,470.09
Daily$16,486.65

Limitations of this calculator

This tool assumes a single lump-sum deposit and a fixed rate held constant for the entire period. It does not account for taxes on interest, inflation eroding real purchasing power, or additional contributions made along the way. Use the savings goal calculator below if you want to model regular monthly deposits.

How to calculate compound interest in Python

def compound_interest(principal: float, annual_rate: float, years: float, n: int = 12) -> float: r = annual_rate / 100 return principal * (1 + r / n) ** (n * years) balance = compound_interest(10000, 5, 10, n=12) print(round(balance, 2)) # 16470.09

How to calculate compound interest in JavaScript

function compoundInterest(principal, annualRate, years, n = 12) { const r = annualRate / 100; return principal * Math.pow(1 + r / n, n * years); } const balance = compoundInterest(10000, 5, 10, 12); console.log(balance.toFixed(2)); // 16470.09

This calculator is for informational purposes only and is not financial advice. Actual investment returns vary and are never guaranteed. Talk to a qualified financial advisor before making investment decisions.

Related Tools