Principles
- Live and local. Every result is recomputed in your browser on each keystroke. Nothing is sent to a server.
- Any one blank. In each calculator you can leave exactly one of the main inputs empty, and it’s solved from the others.
- Honest refusal. If a combination is impossible — a payment smaller than the monthly interest, a discount rate below the terminal growth rate, a goal that can’t be reached — you get a plain message naming the field that breaks the math. You never see NaN, Infinity or a silently capped number. Solved answers must also fall within the same limits as typed ones (for example, no 1,400-year loan terms). A final check refuses to display any non-finite value even if a bug slipped through.
- Estimates, not advice. Results follow from the assumptions you enter. Real returns, rates and tax rules vary.
The missing-variable solver
Where a variable has an exact algebraic solution, we use it. The future value, starting amount, contribution, loan payment and loan amount are all solved directly, and years are solved with logarithms.
Rates of return, internal rates and break-even points generally have no closed-form solution. For those we use bounded bisection:
- Choose a range [low, high] that must contain the answer (for example −99% to 100% a year), and confirm the result at the two ends falls on opposite sides of the target. If not, the range is widened step by step up to a hard limit. If the answer still isn’t inside, we say so instead of guessing.
- Evaluate the midpoint, keep whichever half still brackets the target, and repeat.
- Stop when the result matches the target to within 10−6–10−9 or the range is narrower than floating-point precision, capped at 200 steps.
Each step halves the range, so the answer is pinned down to about one part in a trillion after roughly 40 steps, and the search can never diverge or loop forever. We deliberately don’t use Newton–Raphson, which is faster when it works but can overshoot, oscillate or fly off to infinity on the flat or steep stretches that financial formulas often have.
When a problem is about whole units (calendar years in the S&P 500 tool, growth years in the DCF tool, months in the debt planner), we search the whole-number values directly or bisect on the condition (“debt-free within the goal?”) and report the nearest qualifying whole number.
Rounding & conventions
- All math runs at full double precision. Rounding happens only for display: dollars to the nearest whole dollar (cents shown for amounts under $1,000 or where cents matter, such as loan payments), and rates to two decimal places.
- Rates are entered as annual percentages. Monthly rates are the annual rate ÷ 12 for loans (the U.S. APR convention). For savings, the effective rate per contribution period is derived from your compounding choice:
i = (1 + r/m)m/c − 1, where m is compounding periods and c contributions per year. - Contributions are made at the end of each period unless you choose the start (annuity due).
- Fractional years are allowed; formulas extend continuously between whole periods.
- Dates (payoff dates, years to FI) count forward from the current month on your device.
- Currency inputs accept “$1,250”, “1250” or shorthand like “10k” or “1.2m”. Percentages accept “7.5” or “7.5%”.
Compound interest
FV = P·(1 + i)N + C·(1 + i·d)·((1 + i)N − 1) ÷ i
P starting amount, C contribution per period, i effective rate per contribution period, N = years × contributions per year, d = 1 for start-of-period contributions, 0 otherwise. As i → 0 the annuity factor becomes N. Continuous compounding uses i = er/c − 1.
- Starting amount and contribution are solved directly. If the answer would be negative (the other source alone already beats the goal), we say so.
- Years: with k = C(1 + i·d)/i,
N = ln((FV + k) ÷ (P + k)) ÷ ln(1 + i). - Rate: bisection between −99% and up to 10,000% a year. Future value rises with the rate whenever the amounts invested are positive.
- Today’s dollars: FV ÷ (1 + inflation)years.
Rule of 72
Exact time to grow by a multiple M at annual rate r compounded m times a year:
years = ln(M) ÷ (m · ln(1 + r/m)) continuous: ln(M) ÷ r
The rule of thumb is 72 ÷ (rate in %) for doubling. For other multiples it scales by log2(M), for example 114 ÷ rate to triple. The required rate is m·(M1/(m·years) − 1), and the multiple is (1 + r/m)m·years. 72 slightly overestimates doubling time below about 8% and underestimates it above. With continuous compounding, 69.3 is exact.
Mortgage & loan
M = P·i ÷ (1 − (1 + i)−n) i = APR ÷ 12, n = years × 12
- Loan amount:
P = M·(1 − (1 + i)−n) ÷ i. - Term:
n = −ln(1 − i·P/M) ÷ ln(1 + i). This needs M > i·P, a payment larger than the first month’s interest. Otherwise the loan never amortizes, and we tell you so. - Rate: bisection on 0–2,400% APR. If the total of all payments is less than the loan amount, the implied rate would be negative, and we explain that instead.
- Amortization: each month interest = balance × i, and principal = payment − interest. The final payment is reduced so the balance ends at exactly zero. Extra payments are added to every month’s principal.
- Total monthly cost adds property tax ÷ 12, insurance ÷ 12, and PMI/HOA.
S&P 500 returns
For each calendar year y we use the S&P 500 total return (dividends reinvested) or price-only return, and December-to-December CPI inflation.
realy = (1 + nominaly) ÷ (1 + inflationy) − 1
CAGR = (Π (1 + ry))1/n − 1 average = Σ ry ÷ n
- Volatility is the sample standard deviation of the annual returns (divided by n − 1).
- A start year means invested on January 1. An end year means valued on December 31.
- Solving for the end year finds the first year-end the investment reached the target. Solving for the start year finds the latest January 1 start that still reached the target by the end year.
- Returns are before fees, taxes and trading costs. An index fund’s small expense ratio would lower them slightly.
DCF valuation
Value = Σt=1..N CF₀(1 + g)t ÷ (1 + r)t + TV ÷ (1 + r)N
TV = CFN·(1 + gT) ÷ (r − gT)
A two-stage model: growth at g for N years, then perpetual growth at gT (Gordon growth). The model requires r > gT. Otherwise the terminal value is infinite and we say so.
- Cash flow is solved directly, since value is proportional to it.
- Growth and terminal growth rates: bisection. Value rises with each of them.
- Discount rate (implied return): bisection on (gT, 1,000%]. Value falls continuously from +∞ toward 0 as the rate rises, so any positive value has exactly one answer.
- Growth years: whole-year search from 1 to 100, reporting the year nearest the target value.
- Margin of safety = 1 − price ÷ value.
Roth vs. traditional
Contributions C are made at the start of each year for n years at return r, with growth factor F = (1 + r)·((1 + r)n − 1) ÷ r.
- Same contribution (default): Roth = C·F. Traditional = C·F·(1 − tlater) plus a taxable side account. Each year’s tax saving C·tnow is invested there at the same return, and gains are taxed at the capital-gains rate when withdrawn. Take-home pay is identical either way.
- Same pre-tax income: Roth = C·(1 − tnow)·F. Traditional = C·F·(1 − tlater). This is the textbook case where equal tax rates give identical results.
- Break-even: leaving one input blank solves for where both totals are equal. We scan the plausible range (tax rates 0–99.99%, returns −50% to 50%, 1–80 years) for the first change in which option is ahead, then bisect to the boundary. If there’s none in range, we tell you which option wins throughout.
- The federal bracket estimator uses the IRS ordinary-income brackets for the selected filing status and year (data from 2000 onward). It doesn’t model deductions, credits, contribution limits, employer matches, RMDs or state rules beyond the flat state rate you enter.
FIRE
FI number = (spending − other income) ÷ withdrawal rate
V(n) = S·(1 + r)n + A·((1 + r)n − 1) ÷ r
All figures are in today’s dollars with a real (after-inflation) return r. Annual savings A are added at each year-end. Years, savings, current balance, spending and withdrawal rate are solved exactly. The required return is solved by bisection.
Runway is how long a portfolio P lasts when spending W is withdrawn at each year-end: ln(W ÷ (W − r·P)) ÷ ln(1 + r). It’s indefinite when r·P ≥ W. This assumes steady returns. Real sequences of good and bad years make outcomes more variable, which is why the 4% guideline carries a safety margin.
Debt snowball vs. avalanche
A month-by-month simulation, capped at 100 years:
- Interest accrues on every balance at APR ÷ 12.
- Every open debt receives its minimum payment (or its remaining balance, if smaller).
- The rest of the fixed monthly budget (sum of original minimums + extra) goes to the target debt, and any overflow to the next. Avalanche targets the highest APR first; snowball the smallest current balance. Paid-off debts’ minimums therefore roll over automatically.
The “minimums only” baseline pays each debt its own minimum with no extra and no rollover. If the total budget can’t cover a month’s interest, the balance can only grow, and we report that rather than an endless schedule.
Extra payment for a goal: payoff time never increases as the payment rises, so we bisect on the payment amount (to the cent) for the smallest extra that makes the avalanche plan debt-free within the goal.
Data sources
- S&P 500 annual returns, 1871–2025 (with and without dividends): Robert Shiller, Yale University, U.S. stock market data (S&P Composite and predecessors before 1957), and S&P Dow Jones Indices for recent years. Compiled in the MoneyChimp archive.
- Consumer Price Index, 1870–2025 (December values, CPI-U, 1982–84 = 100): U.S. Bureau of Labor Statistics from 1913; earlier years from Shiller’s reconstructed price index.
- Federal income tax brackets, 2000–2026: IRS tax rate schedules (Schedules X, Y-1, Y-2 and Z).
The data was extracted from the original MoneyChimp scripts (kept in /legacy) into modern modules by a script that checks every year label. The most recent year’s figures may be revised slightly.
Chart colors were checked for color-vision-deficiency separation and contrast. Every chart also has a table view and a written summary.