The compound interest formula, with and without contributions
For a lump sum with no further deposits, the formula is A equals P times (1 plus r divided by n) raised to the power of n times t. P is the starting principal, r is the annual rate as a decimal, n is the number of compounding periods per year, and t is the number of years. The exponent n times t is the total number of compounding periods, and r divided by n is the rate applied in each one.
Regular contributions need a second term, the future value of an annuity: PMT times ((1 plus r over n) to the power of n times t, minus 1), all divided by r over n. This calculator takes a monthly contribution and converts it to a per-period amount by multiplying by 12 and dividing by n, so the annual amount deposited stays the same whichever compounding frequency you pick. The final balance is the sum of the two terms.
Compounding frequency options are annual, quarterly, monthly, and daily, which are n equals 1, 4, 12, and 365. Higher frequency earns slightly more at the same nominal rate, but the effect is small compared with the rate and the time horizon. Going from annual to daily compounding at 7 percent adds roughly a quarter of a percentage point of effective yield.
A worked example: 10,000 start, 200 a month, 7 percent, 10 years
With monthly compounding, n is 12, so the periodic rate is 0.07 divided by 12, or 0.00583333, and the number of periods is 12 times 10, or 120. The growth factor (1.00583333) to the power of 120 is about 2.0096. The starting 10,000 therefore grows to about 20,096 on its own.
The contribution term is 200 times ((2.0096 minus 1) divided by 0.00583333), which is 200 times about 173.07, or about 34,614. Adding the two gives a final balance of roughly 54,710.
Total deposits are 10,000 plus 200 times 12 times 10, or 34,000. Interest earned is 54,710 minus 34,000, or about 20,710. Notice where the growth came from: the monthly contributions produced a larger share of the final balance than the initial lump sum did, because 24,000 of new money went in over the decade. The year-by-year table lets you see the crossover point where cumulative interest starts outpacing new deposits.
What the inputs mean
Initial principal is the balance on day one. Annual interest rate is the nominal rate, not the effective annual yield, and it should be entered as a percentage rather than a decimal. Years is the investment horizon. Monthly contribution is added at the end of each month, which is the ordinary annuity convention. Depositing at the start of each month instead would produce a slightly higher balance, because each deposit gets one extra period of growth.
The rate is assumed constant for the entire period. Real investment returns vary year to year and can be negative, and even fixed deposit rates change when accounts are rolled over. A constant rate is a reasonable modelling simplification for savings accounts and bonds with a fixed coupon, and a rough average for equities, but the actual path will never be a smooth curve.
Contributions are assumed constant too. If you plan to increase deposits over time in line with income, the model will understate your result; there is no escalation input. One workaround is to run the calculation with an average contribution across the period rather than the starting one.
Nominal rate, effective yield, and inflation
The rate you enter is nominal. The effective annual rate is what you actually earn once compounding is accounted for, and it is (1 plus r over n) to the power of n, minus 1. At a nominal 7 percent compounded monthly, the effective annual rate is about 7.23 percent. Bank accounts often advertise the effective figure, sometimes labelled APY, while loan rates are usually quoted nominally, so check which one you have before entering it.
The result is in nominal currency, not inflation-adjusted purchasing power. A balance of 54,710 in ten years is not worth 54,710 in today's terms. To see a rough real value, subtract expected inflation from the rate before entering it: a 7 percent nominal return with 3 percent inflation becomes about 4 percent real, and the same calculation then gives a figure in today's money.
Tax is not modelled either. Interest, dividends, and realised gains are taxable in most jurisdictions unless the account is sheltered, and tax drag compounds against you exactly as returns compound for you. For a taxable account, using an after-tax rate gives a more honest projection.
The mistake people make with compound interest
The usual error is underestimating how much of the final figure comes from time rather than rate. Doubling the rate at a short horizon has less effect than people expect, while adding years at a modest rate has more. Running the same inputs at 10 years and then at 20 years shows this directly: the second decade in the example above adds far more than the first, because it compounds on a much larger base.
The second error is treating a projected balance as a plan. A single fixed rate produces a smooth curve, but a portfolio that averages 7 percent will have years of losses along the way, and the order of those years affects the outcome when you are contributing or withdrawing. This tool answers what a constant rate would produce, which is useful for comparison, not a forecast.
The third is forgetting fees. An annual management fee of 1 percent on a portfolio expected to return 7 percent is not a 1 percent reduction in the outcome; over decades it removes a substantial share of the final balance, because the fee compounds too. Subtracting fees from the rate before entering it gives a more realistic figure.