Reference

Methodology

How each calculator computes its numbers, what's modeled vs simplified, and where the assumptions could mislead you.

Last updated October 2026

On this page

This page documents the math behind each calculator on the site (the formulas, the constants, what we model, and what we deliberately simplify) so you can check the numbers yourself.

Core mortgage math

All payment calculations use the standard amortization formula:

M = P × [r(1+r)^n] / [(1+r)^n − 1]

where M is the monthly payment, P is principal, r is monthly rate (annual ÷ 12), and n is the number of months. This is implemented in src/lib/calc/mortgage.ts as calcMP(). Every monthly P&I figure on the site comes from this single function.

Amortization schedules walk forward month-by-month, splitting each payment into interest (balance × r) and principal (M − interest), and reducing the balance. ARM schedules adjust the rate at fixed periods and re-amortize the remaining balance.

Mortgage Calculator

Inputs: home price, down payment, rate, term, taxes, insurance, HOA, PMI rate.

Math:

  • P&I via calcMP(loan, rate, termMonths)
  • Monthly tax = annual property tax ÷ 12
  • Monthly PMI = (loan × PMI rate) ÷ 12 only if LTV > 80%
  • Total monthly = P&I + tax + insurance + PMI + HOA
  • Min income (28% rule) = total monthly × 12 ÷ 0.28

ARM modeling: caps applied per Fannie Mae convention (initial cap at first reset, periodic cap at each subsequent reset, both limiting decreases as well as increases; lifetime cap measured from the original start rate; rate floored at 0). Re-amortizes balance at each reset.

What’s simplified: PMI rate is a single user input rather than a FICO×LTV grid. Property tax doesn’t reassess with appreciation in this view (use the rental tools for that). No FHA UFMIP / VA funding fee modeling here. See the Closing Cost Estimator for those.

Affordability Calculator

Inputs: income, monthly debts, down payment, rate, term, tax, insurance, HOA, PMI rate, front/back-end DTI caps.

Math: solves backwards via binary search. Given a target PITI:

  1. PITI budget = min(income/12 × frontEndDTI, income/12 × backEndDTI − debts)
  2. Binary search on home price: at each candidate, compute PITI = P&I + tax + ins + HOA + PMI; converge on the price where PITI = budget.

The coupling is non-trivial because property tax and PMI both depend on home price.

Stress tiers: 28%/36% (planner-conservative), 36%/43% (the former QM DTI limit, removed in 2021), 43%/50% (aggressive, roughly the Fannie Mae DU cap). Both front- and back-end vary together to avoid the front-end-binding pathology where loosening only back-end did nothing.

Refinance Calculator

Inputs: current loan (balance, rate, months remaining, fixed/ARM), new loan (rate, term, closing costs, points, cash-out, roll-in), tax params, discount rate.

Math (compare() in src/lib/calc/refinance.ts):

  • Monthly savings = current P&I − new P&I on the like-for-like slice (see cash-out below). Shown for month 1.
  • Break-even is counted month by month as a running total. Each month the tool adds that month’s payment difference (old payment − new payment, which changes when an ARM resets or one loan pays off before the other) to a running total that starts at −(out-of-pocket closing costs + points). Nominal break-even = the first month the running total reaches ≥ 0. With a fixed-to-fixed refi and constant savings this lands on the same month as ceil(closing ÷ monthly savings); with ARMs or differing payoff dates it can differ. If costs are rolled into the loan, break-even still counts them, because you owe them as soon as the loan closes: the running total starts at −(costs added to the loan) instead. The lifetime totals and NPV don’t subtract rolled-in costs again, because the new payment already repays them.
  • After-tax break-even uses the same running total, but each month’s cost is payment − that month’s share of the year’s tax benefit from afterTaxInterest() in src/lib/calc/tax.ts. That function applies the standard-deduction floor (only the slice of itemized deductions above the standard deduction provides marginal benefit), the $750k acquisition-debt limit, refi points deducted ratably over the loan life, and the non-deductibility of cash-out not used to improve the home.
  • NPV = Σ (after-tax monthly savings ÷ (1 + r/12)^t) − upfront costs, where r is your discount rate. The NPV break-even is the first month that discounted running total, minus any costs rolled into the loan, turns positive.
  • Cash-out: the new loan is split pro rata into (1) the slice that refinances your old balance plus any financed costs and (2) the cash-out slice. Monthly savings, break-evens, and lifetime interest compare your current loan against slice (1) only, so borrowing more doesn’t masquerade as “negative savings.” Slice (2) is valued separately: cash received at closing minus the present value of its after-tax payments. Headline NPV = rate-and-term NPV + cash-out NPV.
Current loan New loan What the tool reports old balance vs (1) old balance + financed costs (2) cash-out payment splits in the same proportion Rate-and-term NPV monthly savings, break-evens, lifetime interest + Cash-out NPV cash received minus PV of its after-tax payments Headline NPV
Only slice 1 is compared with your current loan, so the extra you borrow never shows up as lost savings. The cash-out slice gets its own value, and the headline NPV adds the two.

ARM handling on the current loan: the remaining schedule re-amortizes at each adjustment, starting from the user-specified months-to-next-adjustment and then every 6 or 12 months, moving toward your assumed fully-indexed rate. Because the loan is already past its first reset, every adjustment uses the periodic cap, and the lifetime cap is measured from the loan’s original start rate.

What’s simplified: tax benefit is computed per year and spread evenly across its 12 months; uses 2026 standard deduction values; doesn’t include AMT, NIIT, or QBI. Discount rate is user-input; default 7% is a pre-tax stock-market return, which is conceptually mismatched with after-tax cash flows.

Rent vs Buy Calculator

Method: NPV-style wealth-delta model. At year 0, the buyer is “behind” the renter by (down payment + closing costs). Each year:

delta(y) = delta(y−1) × (1 + discount_rate)
        + (rent_cost(y) − after_tax_buy_cost(y))

In any year, buying’s net position = delta + net sale proceeds if you sold then (home_value × (1 − selling_cost) − mortgage_balance). The headline result uses your horizon year.

Buy-side costs: P&I, property tax and maintenance (each a % of the home’s value at the start of the year, so they grow with appreciation), insurance & HOA (grow with general inflation), and conventional PMI when you put less than 20% down: the PMI rate × the original loan, charged monthly until the scheduled balance reaches 78% of the purchase price (the Homeowners Protection Act automatic-termination point). Less the mortgage interest tax shield via afterTaxInterest().

Rent-side costs: rent (escalates at user-specified rate), renter’s insurance (grows with general inflation).

Result: positive = buying ahead by that amount; negative = renting ahead. Break-even = the first year in which buying’s net position, including a sale that year, turns positive.

What’s simplified: PMI isn’t tax-deducted (it’s deductible again from 2026, but only below roughly $109k AGI) and isn’t dropped early at 80% or by reappraisal. No utility differential (SFR utilities typically higher than apartments). No capital-gains tax on the home sale (most owners are inside the §121 exclusion) and no tax drag on the renter’s invested savings. No transaction friction beyond selling costs at horizon.

PMI Removal

Method: walks the amortization schedule month-by-month from current state and finds three milestones:

  1. Automatic termination at 78% LTV of the original value, based on the original amortization schedule (HPA legal trigger). Uses the scheduled balance from the original loan amount and term, not your actual balance, so extra payments don’t accelerate this. It’s capped at the amortization midpoint: if the schedule wouldn’t reach 78% by then, PMI ends at month floor(term ÷ 2) (month 180 of a 30-year loan) regardless of LTV (HPA final termination).
  2. Request at 80% LTV of the original value, based on actual balance (extra payments help here). User must request; servicers can also require a good payment history and no junior liens.
  3. Reappraisal: available once the loan is 2 years old; 75% LTV if the loan is 2-5 yrs old, 80% if ≥5 yrs old (Fannie servicer rule). Uses appreciated home value: original_price × (1 + appreciation)^(months/12).

Loan type gates: FHA-post-2013-low (<10% down) shows life-of-loan MIP warning. FHA-post-2013-10down notes 11-year auto-cancel. VA & USDA have no PMI cancellation path. Pre-2013 FHA approximates HPA-equivalent.

Investment Property Analyzer

Year-by-year projection including:

  • NOI = effective rent (gross × (1 − vacancy)) − operating expenses (taxes scale with home value, insurance grows at insurance-growth rate, maintenance + capex scale with home value)
  • Pre-tax cash flow = NOI − annual P&I
  • Taxable rental income = NOI − mortgage interest − depreciation
  • §469(i) passive activity loss treatment: $25k allowance below $100k AGI, phased out by $150k. Above $150k, losses suspend (no current cash benefit).
  • Exit tax at sale: §1250 unrecaptured depreciation (lesser of 25% or marginal) on the recaptured slice + LT cap gains (0/15/20% bracketed off marginal + 3.8% NIIT for higher brackets) on the rest.
  • IRR computed via secant method on the cash-flow stream.

What’s simplified: §469 losses are treated year-by-year (no carryforward tracking). No QBI/§199A deduction (some rentals qualify under Rev. Proc. 2019-38 safe harbor). State tax not modeled. No 1031 exchange option.

Sell vs Rent-Out

Method: compares two scenarios over the user’s horizon:

  • Sell now: net proceeds = sale × (1 − selling cost) − balance − cap-gains tax (with Section 121 exemption applied if eligible). Proceeds are invested at the discount rate, and each year’s value is shown after tax on liquidation: the growth (not the already-taxed principal) is taxed at the same long-term capital-gains rate used elsewhere in the tool.
  • Rent then sell: year-by-year after-tax cash flow: NOI − debt service − tax on positive taxable rental income (NOI − mortgage interest − depreciation on 80% of the lesser of basis or value, over 27.5 years). Tax losses are treated as suspended passive losses (no current benefit; release at sale not modeled). Cumulative cash flow compounds at the discount rate and its growth is taxed on liquidation the same way as the sell branch, so the comparison is symmetric. Selling in any year includes §1250 recapture (lesser of 25% or your marginal rate, plus 3.8% NIIT at the 32%+ brackets) and LT cap-gains.
  • Cap-gains rate proxy: keyed off your marginal bracket: 0% at 10-12%, 15% at 22-24%, 15% + 3.8% NIIT at 32-35%, 20% + 3.8% NIIT at 37%.

Section 121 simplification: the actual rule is “owned and used as primary residence 2 of last 5 years.” The tool models a hard cliff at year 3 of conversion, which is approximately right but not strict.

1031 Exchange

Taxable sale: net sale = price × (1 − selling cost). Gain = net sale − adjusted basis (cost + improvements − accumulated depreciation). The depreciation slice (up to the gain) is taxed at 25% (+3.8% NIIT if toggled), the rest at your LTCG rate (+ NIIT), and your state rate applies to the whole gain.

Exchange: all tax is deferred if you reinvest the full net proceeds and buy a replacement priced at or above the net sale price (selling costs are exchange expenses). Trading down creates boot = max(0, net sale − replacement price), which assumes any mortgage paid off is replaced with new debt or added cash. Recognized gain = min(boot, total gain), taxed first as depreciation recapture, then LTCG, plus state.

Buying power: cash left after the sale (taxable) or after boot tax (exchange), grossed up at 75% LTV to compare how much property each path can buy.

What’s simplified: no federal bracket math (you supply the LTCG rate); recapture is taxed at the 25% maximum rather than your marginal rate, which can overstate it a little for the 22% and 24% brackets; exchange costs beyond selling costs, related-party rules, and the 45/180-day timing aren’t modeled.

Closing Cost Estimator

Default rules:

  • Origination 0.5% of loan
  • Application $400, underwriting $600
  • Lender’s title 0.5% of loan; owner’s title 0.5% of price (configurable buyer/seller)
  • FHA UFMIP 1.75%, VA funding fee tiered (0.50-3.30% by use & down %), USDA 1.0%
  • Prepaid interest = (loan × rate × days) / 365
  • Tax escrow = (price × tax rate × months) / 12
  • Insurance prepaid = 14 months of annual premium / 12

Credits/adjustments: lender credit, seller concession, earnest money deposit, property tax proration all reduce cash to close (but not gross closing costs).

Credit Score LLPA

Uses an encoded approximation of the Fannie Mae LLPA matrix (Selling Guide May 2023). Cells indexed by credit-score band × LTV band. Cash-out adds an additional surcharge.

LLPA → rate adjustment uses the rule-of-thumb 0.25% rate per 1.0 LLPA points (varies by market in reality).

Known limitations: doesn’t include the 2023 first-time-buyer (≤100% AMI) waiver; doesn’t stack LLPAs for second home, investment, condo, manufactured, etc. Treat as ballpark only.

DTI Scenario Planner

Per-debt qualifying payment rules:

  • Student loans in deferment: greater of actual payment or 1% of balance (Fannie convention)
  • Student loans on IBR: the documented IBR payment, including a documented $0 payment (Fannie convention)
  • Installment / personal / auto / lease: zero if ≤10 payments remaining (and payment doesn’t materially affect ability to repay), except auto leases, which always count
  • Co-signed: zero if 12+ months of documented payments by other party; else full payment
  • Credit cards: minimum from credit report (or 5% of balance if no min)

Max home price: same binary-search engine as the Affordability calculator, given the user’s qualifying-debts total.

Known gap: rules are Fannie-flavored; FHA’s 0.5% student-loan rule and other program-specific variations aren’t yet modeled.

Cash-Out vs HELOC vs Personal Loan

Compares three borrowing structures on identical cash needs.

Tax treatment: each option is credited for the change in deductible interest vs keeping the current mortgage. Interest on the existing balance stays deductible when refinanced; interest on new cash (the pro-rata slice of the refi, or the HELOC) is deductible only if the cash is used to buy, build, or substantially improve the home; financed closing costs aren’t acquisition debt. A HELOC term of 120 months or less is modeled as interest-only with a balloon at the end of the draw period.

Tax savings assume itemizing and full marginal benefit on every deductible interest dollar. The standard deduction floor is not enforced here (unlike Refinance and Rent vs Buy). Crude but acceptable for the rank-ordering between options.

Rate-trap warning fires when current mortgage rate < refi rate (the cash-out path re-prices the entire balance, almost always making it worse than a HELOC even at higher HELOC rate).

15 vs 30 Year Comparison

Side-by-side amortization. The wealth-delta calculation:

  • 15-yr borrower at year 15: mortgage paid off, net wealth = 0 (assumes no extra invested)
  • 30-yr borrower at year 15: portfolio = future value of monthly difference invested at market rate, minus remaining mortgage balance

Difference = which side is ahead at year 15.

Caveats: doesn’t account for the fact that the 30-yr borrower would also have funds freed up at year 30 to invest. A more rigorous analysis would extend the horizon and assume identical reinvestment thereafter.

Pay Off vs Invest

Compares prepay-extra vs invest-extra strategies month-by-month over the remaining loan term.

Effective mortgage rate: rate × (1 − benefit rate), where the benefit rate is the year-1 tax saving from the interest deduction ÷ year-1 interest. The saving counts only interest on the first $750k of average balance, only the part of itemized deductions above the standard deduction (with SALT capped, including the high-income phase-down), × combined federal + state marginal rate. If you don’t itemize, it’s the note rate.

Taxable brokerage model: the market return is split into a 1.5% dividend yield, taxed every year and reinvested, and price growth, which isn’t taxed until you sell. Both use the same rate: the 0/15/20% LTCG bracket looked up from estimated taxable income (AGI minus the larger of the standard or itemized deduction) and filing status, plus 3.8% NIIT above $200k single / $250k MFJ, plus optionally your state marginal rate. The displayed after-tax market return is the annualized result of $1 invested today and sold at the end of the loan term, so it reflects that deferral (money invested later gets less of it).

Spread = after-tax market − after-tax mortgage. Positive favors investing.

Simulation: both paths amortize the loan at its note rate. Each month, whatever part of (regular P&I + extra) the loan doesn’t need, plus that month’s mortgage-interest tax saving, goes into the portfolio; once a loan is paid off, the full P&I + extra is invested. Net wealth at horizon = portfolio value after selling and paying capital-gains tax on the gain − remaining mortgage balance, for both strategies.

Caveats: the deduction value is fixed from year 1 rather than recomputed as interest falls; doesn’t model 401(k) match (which beats either), liquidity premium (invested money is accessible, paid-off equity isn’t), or sequence-of-returns risk (real markets don’t hand you the average every year).

Home Equity

Math: equity = current value − current balance. Maximum borrowable = max CLTV × value − current balance. Cash-out cap = min(80%, CLTV) × value − balance.

Pure arithmetic; no temporal projection.

Mortgage Recast

Compares 4 strategies for a lump sum: do nothing, recast (re-amortize at same rate, lower payment), extra payment (apply lump sum + keep paying baseline), refinance (new rate, same remaining term). Strategies are ranked on net savings = interest saved − recast fee or refi closing costs.

Recast eligibility gate: FHA, VA, USDA loans cannot be recast. Conventional and most jumbo can.

Property Type Impact

Encoded rules per property type with rate adjustment, minimum down by occupancy, minimum credit score, program eligibility.

Gift Fund Wizard

Decision tree by loan type × donor relationship × occupancy. Returns eligibility verdict + required documentation.

Recent change: conventional second-home 5% borrower-own-funds rule (eliminated by Fannie Mae April 2021) is no longer enforced.

Appraisal Gap Planner

Math for each scenario: lender uses lower of contract or appraised value to size the loan, so covering-the-gap-with-cash and meeting-in-the-middle both yield the same loan amount but different cash needs. Walk-away cost computed as contract × user-specified EMD percentage.

ROV (Reconsideration of Value) added per FHFA’s 2024 ROV rule that codifies it as a borrower right.


What we don’t model (and why)

  • State income tax stacking: state cap-gains rates and their interaction with federal NIIT vary too much to model honestly without per-state data.
  • AMT: alternative minimum tax kicks in for narrow income ranges. Skipped.
  • QBI for rental real estate (outside the dedicated QBI Deduction calculator): the Section 199A safe harbor is procedurally complex; many users won’t qualify.
  • Suspended passive losses carryforward: §469 losses that can’t be used this year carry forward indefinitely. We treat each year independently as a simplification.
  • 1031 exchange (outside the dedicated 1031 Exchange calculator): deferring cap-gains via like-kind exchange is a common investor strategy; the math is complex and isn’t built into the other investor tools.
  • Real-time rate/index data: SOFR, Prime, conforming loan limits all change. We use illustrative current values; verify before acting.

Verifying our numbers

Every calculator’s formulas are documented above. When the math involves a judgment call (cap-gains rate proxy, depreciation recapture treatment, discount-rate selection), the calculator says so on the page.

See something wrong on this page? Report it

Report a problem

On

What kind of problem?