Methodology: formulas and assumptions

This page documents exactly how each calculator on this site produces its numbers: the formulas, the assumptions behind them, what the terms mean, and what the results leave out. Every example figure below is produced by the same code that runs the calculators.

Principles that apply to every calculator

  • Results are estimates. They show what the math gives for the inputs you enter. They are not predictions, promises of returns, or financial advice.
  • Rates are your inputs. The site does not supply or recommend a rate of return. Example rates on any page are hypothetical and are labelled as examples.
  • The rate is held constant. Unless a calculator says otherwise, the same rate applies in every period. Real savings rates change and real investment returns vary from year to year, including losses.
  • No fees, taxes or inflation. Unless a calculator has an explicit input for one of these, results are in nominal dollars before fees and taxes.
  • Calculated in your browser. The calculation runs on your device in standard double-precision floating-point arithmetic. Amounts are rounded only for display, so two displayed parts can differ from a displayed total in the last digit shown.
  • Checked against known results. Each calculation function has automated tests that compare it with closed-form formula values and edge cases such as a zero rate.

Compound interest calculator

The compound interest calculator projects the future value of a starting balance plus a fixed monthly contribution, growing at a constant rate, and reports the balance at the end of each year.

Inputs and symbols

SymbolMeaning
PInitial investment (principal), in dollars. Allowed range: $0 to $10,000,000,000.
CMonthly contribution, in dollars, the same every month. Allowed range: $0 to $100,000,000.
rAnnual rate as a decimal (6% is 0.06). Allowed range: 0% to 50%.
YTime period in whole years, from 1 to 50.
nNumber of months: n = 12 × Y.
iMonthly rate, derived from r and the compounding option (see below).
BkBalance at the end of month k. B0 = P.

Step 1: convert the annual rate to a monthly rate

The calculator always works month by month. The compounding option decides how the annual rate you enter becomes a monthly rate.

Annually (APY). The rate is treated as an effective annual rate, so twelve months of growth equal exactly the annual rate:

i = (1 + r)1/12 − 1

Monthly (rate ÷ 12). The rate is treated as a nominal annual rate compounded monthly:

i = r ÷ 12

At a 6% annual rate, the monthly rate is 0.4868% under the annual option and 0.5000% under the monthly option. After one year, $10,000 with no contributions becomes $10,600.00 under the annual option and $10,616.78 under the monthly option. In other words, a 6% nominal rate compounded monthly is an effective annual rate of 6.17%.

Step 2: grow the balance one month at a time

For each month k from 1 to n, the balance is updated once. With contributions at the end of each month, the existing balance earns a month of interest and then the contribution is added:

Bk = Bk−1 × (1 + i) + C

With contributions at the beginning of each month, the contribution is added first and earns interest for that month too:

Bk = (Bk−1 + C) × (1 + i)

The year-by-year table and chart show Bk at k = 12, 24, 36 and so on.

Step 3: split the balance into contributions and interest

Total contributions = P + C × n

Interest earned = Bn − Total contributions

The initial investment counts as a contribution. "Interest earned" is everything in the final balance that you did not put in yourself.

Equivalent closed-form formulas

The month-by-month calculation gives the same result as the standard future value formulas. For contributions at the end of each month (an ordinary annuity):

Bn = P × (1 + i)n + C × [(1 + i)n − 1] ÷ i

For contributions at the beginning of each month (an annuity due), the contribution term is multiplied by one extra month of growth:

Bn = P × (1 + i)n + C × [(1 + i)n − 1] ÷ i × (1 + i)

When the rate is zero these formulas divide by zero, so the result is simply Bn = P + C × n. This page is built only if the closed-form values match the calculator's month-by-month result to within one cent for the examples shown here.

Worked example

Inputs: $10,000 initial investment, $1,000 contributed at the end of each month, 6% annual rate, 20 years, compounded annually. These are the calculator's default values, and the rate is a hypothetical example.

  1. Monthly rate: i = (1 + 0.06)1/12 − 1 = 0.00486755, which is 0.4868% a month.
  2. Number of months: n = 12 × 20 = 240.
  3. Growth factor: (1 + i)240 = 3.207135.
  4. The initial investment grows to $10,000 × 3.207135 = $32,071.
  5. The contributions grow to $1,000 × (3.207135 − 1) ÷ 0.00486755 = $453,439.
  6. Final balance: $32,071 + $453,439 = $485,510.
  7. Total contributions: $10,000 + $1,000 × 240 = $250,000. Interest earned: $485,510 − $250,000 = $235,510.

Dollar amounts in this example are rounded to the nearest dollar, as they are in the calculator; the calculation itself carries full precision. After the first year the balance is $22,927, of which $22,000 is contributions and $927 is interest.

With the same inputs but contributions at the beginning of each month, the final balance is $487,717, which is $2,207 more.

Limitations of the compound interest calculator

  • One constant rate for the whole period. It cannot model returns that change from year to year or a sequence of gains and losses.
  • Fees, taxes and inflation are not included. The result is in nominal dollars.
  • Contributions are the same fixed amount every month. It does not model contributions that rise over time, one-off deposits after the start, or withdrawals.
  • The time period is a whole number of years from 1 to 50, and the rate is from 0% to 50%. Negative rates are not supported.
  • Two compounding conventions are offered: an effective annual rate, or a nominal rate compounded monthly. Daily and continuous compounding are not offered. For a nominal rate compounded daily, the monthly option slightly understates the result.
  • Each month is treated as one twelfth of a year. Actual day counts, deposit dates and bank-specific interest rules are ignored.

Savings goal calculator

The savings goal calculator solves the compound interest formula backwards: given a target balance, it finds the fixed monthly contribution that reaches it. The monthly rate i and the number of months n are defined exactly as in the compound interest calculator above.

Formula

First, your current savings S grow on their own to S × (1 + i)n. The gap is whatever is still missing from the goal G:

Gap = G − S × (1 + i)n

Each dollar contributed at the end of every month accumulates to the annuity factor:

Factor = [(1 + i)n − 1] ÷ i

Monthly contribution = Gap ÷ Factor

For contributions at the beginning of each month the factor is multiplied by (1 + i). At a zero rate the factor is simply n. If the gap is zero or negative, your current savings reach the goal without further contributions and the result is $0.

Worked example

Inputs: a goal of $100,000 in 10 years, $0 saved so far, a hypothetical 6% annual rate, contributions at the end of each month. The factor is 162.4734, so the required contribution is $100,000 ÷ 162.4734 = $615.49 a month.

Limitations

  • The same constant-rate assumption as the compound interest calculator. A real portfolio can be well above or below the goal on the target date.
  • The contribution is fixed for the whole period, and the deadline is a whole number of years.
  • The goal is in nominal dollars. It is not adjusted for inflation, fees or taxes.

FIRE calculator

The FIRE calculator estimates the portfolio size at which planned withdrawals would cover your spending, and how long it takes to get there.

Formula

FIRE number = Annual spending ÷ Withdrawal rate

The time to reach it uses the compound interest calculation with annual compounding: your annual savings are split into twelve equal contributions made at the end of each month, and the balance is grown month by month until it first reaches the FIRE number. With monthly contribution m, current savings P and target F, this is equivalent to:

Months = ln[(F + m ÷ i) ÷ (P + m ÷ i)] ÷ ln(1 + i), rounded up to a whole month

If the target is not reached within 100 years, the calculator says so instead of showing a number.

Worked example

Inputs: $40,000 of annual spending, a 4% withdrawal rate, $50,000 already invested, $24,000 saved per year and a hypothetical 5% annual return. The FIRE number is $40,000 ÷ 0.04 = $1,000,000, reached after 20 years 10 months.

Limitations

  • The withdrawal rate is a planning assumption that you choose. It is not a guarantee that a portfolio will last for any particular length of time.
  • Results are in today's dollars only if the return you enter is a real (after-inflation) return. If you enter a nominal return, the spending figure is not adjusted for rising prices.
  • Returns, spending and savings are held constant. Taxes on withdrawals, other retirement income and changes in spending are not modelled.

Investment fee calculator

The investment fee calculator compares two growth paths for the same contributions: one with no fee, and one where an annual percentage fee is charged.

Formula

Net annual return = Annual return before fees − Annual fee

Both paths are computed with the compound interest calculation (annual compounding, contributions at the end of each month), one at the return before fees and one at the net return.

Cost of fees = Ending balance without fees − Ending balance with fees

Share lost to fees = Cost of fees ÷ Ending balance without fees

The cost is larger than the sum of the fees actually paid, because every dollar paid in fees also loses the growth it would have earned for the rest of the period.

Worked example

Inputs: $10,000 initial investment, $500 a month for 30 years, a hypothetical 7% annual return before fees and a 1% annual fee. Without fees the ending balance is $660,849. At the net return of 6% it is $544,691. The fee costs $116,157, which is 17.6% of the no-fee balance.

Limitations

  • Subtracting the fee from the return is a close approximation. A fee charged on the balance after growth gives a net return of (1 + return) × (1 − fee) − 1, which is very slightly lower.
  • The fee is a constant percentage of assets. Flat-dollar fees, sales loads, trading costs and fee changes over time are not modelled.
  • The return before fees is a constant hypothetical rate, and taxes are ignored.

CAGR calculator

The CAGR calculator finds the single constant yearly growth rate that turns a starting value into an ending value over a given period.

Formula

CAGR = (Ending value ÷ Starting value)1 ÷ years − 1

Total return = Ending value ÷ Starting value − 1

The starting value and the number of years must be greater than zero. The number of years may be fractional. An ending value of zero gives a CAGR of −100%.

Worked example

Inputs: $10,000 growing to $20,000 over 5 years. The growth multiple is 2.00, the total return is 100.00%, and the CAGR is 2.001/5 − 1 = 14.87% a year.

Limitations

  • CAGR describes a smooth path between two points. It says nothing about the ups and downs in between.
  • It assumes no money was added or withdrawn during the period. With cash flows along the way, a money-weighted return is the appropriate measure instead.
  • For periods shorter than a year, the result extrapolates a short-term change to a full year and can be misleading.

Definitions of terms

Principal
The amount you start with, before any interest or further contributions.
Compound interest
Interest calculated on the principal plus the interest already earned, so that earlier interest earns interest in later periods. Simple interest, by contrast, is calculated on the principal only.
Compounding frequency
How often interest is added to the balance, for example monthly or annually. For the same nominal rate, more frequent compounding gives a slightly higher balance.
Nominal annual rate
A yearly rate stated without the effect of compounding within the year. The rate applied in each period is the nominal rate divided by the number of periods per year.
Effective annual rate
The actual growth over one year once compounding within the year is included. For a nominal rate r compounded m times a year, the effective annual rate is (1 + r ÷ m)m − 1.
APY (annual percentage yield)
An effective annual rate, usually quoted for savings and deposit accounts. It already includes compounding. On this site, enter an APY with the "Annually (APY)" option.
APR (annual percentage rate)
A yearly rate that does not include compounding within the year, usually quoted for loans and credit. On loans it may also reflect certain fees. On this site, the "Monthly (rate ÷ 12)" option treats the rate you enter as a nominal annual rate compounded monthly.
Contributions at the end of the period
Each contribution is added after that period's interest is calculated, so it starts earning in the next period. In finance textbooks this is an ordinary annuity.
Contributions at the beginning of the period
Each contribution is added before that period's interest is calculated, so it earns one extra period of interest. In finance textbooks this is an annuity due.
Future value
The balance at the end of the time period, including all contributions and all interest.
Nominal dollars
Amounts not adjusted for inflation. A future balance in nominal dollars will buy less than the same number of dollars buys today if prices rise in the meantime.

Corrections

If you find a result that does not match these formulas, or a formula that looks wrong, please get in touch and include the numbers you entered so the result can be reproduced.