Reference

Methodology

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

Last updated April 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. The goal is that you can verify the numbers yourself rather than trusting our outputs blindly.

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, lifetime cap on total increase). 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% (CFP-conservative), 36%/43% (Fannie Mae cap), 43%/50% (QM upper limit). 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, cash-out, points), tax params.

Math:

  • Monthly savings = old P&I − new P&I
  • Nominal break-even = ceil(closing_costs / monthly_savings)
  • After-tax savings via afterTaxInterest() from src/lib/calc/tax.ts — applies the standard-deduction floor (only the slice of itemized deductions above the standard deduction provides marginal benefit) and the cash-out non-deductibility carve-out
  • NPV = sum over months of (after-tax savings ÷ (1 + r/12)^t) − closing_costs, where r is the user’s discount rate

ARM handling on the current loan: the tool re-amortizes from the user-specified months-to-next-adjustment, with the user’s caps and assumed fully-indexed rate.

What’s simplified: tax model uses approximate 2026 standard deduction values; doesn’t include AMT, NIIT, or QBI. Discount rate is user-input; default 7% is pre-tax stocks, 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))

At the user’s horizon, add net sale proceeds (home_value × (1 − selling_cost) − mortgage_balance) to delta.

Buy-side costs: P&I, property tax (grows with home value), insurance & HOA (grow with general inflation), maintenance (% of home value), less mortgage interest tax shield via afterTaxInterest().

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

Result: positive delta = buying ahead by that amount; negative = renting ahead. Break-even = first year delta crosses zero.

What’s simplified: PMI not modeled explicitly (assumes 20% down or that PMI is folded into ins). No utility differential (SFR utilities typically higher than apartments). 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. Auto-cancel at 78% LTV based on the original schedule (HPA legal trigger). Uses scheduled balance, not actual — extra payments don’t accelerate this.
  2. Request at 80% LTV based on actual balance (extra payments help here). User must request.
  3. Reappraisal: 75% LTV if 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 invested at discount rate.
  • Rent then sell: year-by-year cash flow with after-tax adjustment (rental tax including depreciation shield). Cumulative cash flow is reinvested at the discount rate so the comparison is symmetric. Sale at horizon includes §1250 recapture and LT cap-gains.

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.

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 (1.25-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: actual IBR payment if > $0; else 0.5% of balance
  • 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.

Refi cash-out interest is computed as the difference between full refi interest and a hypothetical rate-and-term-only refi (current balance + closing costs at same rate/term). This isolates the interest attributable to the new cash, which is what’s relevant for the tax-deductibility question.

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.

Effective mortgage rate: rate × (1 − marginal) if user itemizes, else just rate (most people post-TCJA).

After-tax market return: market_return × (1 − ltcg_rate). LT cap gains rate proxied from marginal: ≤12% bracket → 0%, 22-24% → 15%, 32%+ → 20%.

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

Net wealth at horizon = portfolio − remaining mortgage balance, computed for both strategies.

Caveats: 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).

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: 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: deferring cap-gains via like-kind exchange is a major investor strategy; the math is complex and out of scope.
  • 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 calculators say so on the page rather than hide it behind a single confident number.