Free calculators
Mortgage overpayment versus investing calculator documentation
Inputs, formulas, assumptions and API/MCP examples for the mortgage overpayment versus investing calculator. Reproduce a calculation and cite its sources.
Content updated . Assumptions reviewed .
Formula and assumptions
Net-wealth difference = overpayment investments - overpayment debt - alternative investments + alternative debt.
- Both options receive the same monthly cash budget through the same horizon; payments released by early payoff or insurance removal are invested at month end.
- The common home value cancels from the wealth difference. Property value is held constant for insurance removal.
- Closing costs reduce only the overpayment option at time zero; protected cash remains outside investments.
- Mortgage interest uses APR/12; deterministic investment return is an effective annual assumption.
- Simulations use paired seeded lognormal monthly investment returns so both options experience the same market path.
- Probability describes this model only and excludes taxes, fees other than the entered closing cost, future rate changes and investment advice.
Assumptions reviewed:
Sources
- KlarFort calculator methodology. KlarFort-authored arithmetic; free to use with credit.; vintage 1.
Parameters
| Name | Description | Type | Default | Minimum | Maximum |
|---|---|---|---|---|---|
| currency | Currency | string | "USD" | ||
| principal | Mortgage balance | number | 300000 | 0 | 1,000,000,000 |
| homeValue | Home value for insurance removal | number | 400000 | 0 | 1,000,000,000 |
| mortgageRate | Mortgage annual rate (%) | number | 5 | 0 | 100 |
| mortgageMonths | Mortgage remaining months | integer | 300 | 1 | 600 |
| extraMonthly | Extra cash each month | number | 500 | 0 | 1,000,000,000 |
| horizonMonths | Common comparison horizon months | integer | 300 | 1 | 600 |
| investmentReturn | Expected effective annual investment return (%) | number | 6 | -50 | 50 |
| volatility | Annual investment volatility (%) | number | 15 | 0 | 100 |
| paths | Simulation paths | integer | 250 | 1 | 1,000 |
| seed | Seed (empty or 16 hexadecimal characters) | string | "" | ||
| initialInvestment | Initial investment cash outside reserve | number | 20000 | 0 | 1,000,000,000 |
| protectedCash | Protected cash outside investment portfolio | number | 10000 | 0 | 1,000,000,000 |
| overpaymentClosingCost | Upfront cost charged to overpayment option | number | 0 | 0 | 1,000,000,000 |
| monthlyMortgageInsurance | Monthly mortgage insurance | number | 0 | 0 | 1,000,000,000 |
| insuranceRemovalLTV | Insurance removal loan-to-value (%) | number | 78 | 0 | 100 |
JSON API
GET accepts one input parameter containing URL-encoded JSON. POST sends the JSON input object. Prefer POST for personal figures. Inputs are limited to 16 KiB. POST results are not stored; GET results may be cached for up to 24 hours.
curl -X POST https://klarfort.com/tools/api/v1/overpay-or-invest -H "Content-Type: application/json" --data '{"currency":"USD","principal":300000,"homeValue":400000,"mortgageRate":5,"mortgageMonths":300,"extraMonthly":500,"horizonMonths":300,"investmentReturn":6,"volatility":15,"paths":250,"seed":"731f4821e09868c9","initialInvestment":20000,"protectedCash":10000,"overpaymentClosingCost":0,"monthlyMortgageInsurance":0,"insuranceRemovalLTV":78}'fetch("https://klarfort.com/tools/api/v1/overpay-or-invest", {method:"POST", headers:{"Content-Type":"application/json"}, body:JSON.stringify({"currency":"USD","principal":300000,"homeValue":400000,"mortgageRate":5,"mortgageMonths":300,"extraMonthly":500,"horizonMonths":300,"investmentReturn":6,"volatility":15,"paths":250,"seed":"731f4821e09868c9","initialInvestment":20000,"protectedCash":10000,"overpaymentClosingCost":0,"monthlyMortgageInsurance":0,"insuranceRemovalLTV":78})})import json, urllib.request
request = urllib.request.Request("https://klarfort.com/tools/api/v1/overpay-or-invest", data=json.dumps({"currency":"USD","principal":300000,"homeValue":400000,"mortgageRate":5,"mortgageMonths":300,"extraMonthly":500,"horizonMonths":300,"investmentReturn":6,"volatility":15,"paths":250,"seed":"731f4821e09868c9","initialInvestment":20000,"protectedCash":10000,"overpaymentClosingCost":0,"monthlyMortgageInsurance":0,"insuranceRemovalLTV":78}).encode(), headers={"Content-Type":"application/json"})
print(urllib.request.urlopen(request).read().decode())Connected assistants
Connect using https://klarfort.com/tools/mcp. Discover this calculator with tools/list, then call overpay-or-invest. Protocol versions 2026-07-28 and 2025-11-25 are supported. Modern requests carry protocol metadata and matching HTTP headers. Set Mcp-Name to params.name for tools/call and to params.uri for resources/read. Older clients initialize first.
Limits: 120 requests per minute per address and approximately 3,000 per minute per edge location. Simulations are capped at 1,000 paths, 600 months and 150,000 path-months (paths multiplied by months). Shorten the duration or reduce paths when that work limit is exceeded. A limit response returns 429 and Retry-After. No exact remaining-request count is available.
Usage and credit
Free for personal, commercial and any other lawful use with credit to KlarFort at https://klarfort.com/. Third-party data terms still apply.
Place a visible credit near the reused material or in the credits for your work or integration. One clear credit per work or integration is sufficient; no separate credit per API request is required. Links to individual calculators are optional.
Computed with KlarFort Calculators, https://klarfort.com/
The API returns this text in credit and the homepage in credit_url. The optional citation_url identifies the calculator for reference. See usage and credit for the full permission.
KlarFort is not financial, investment, tax, or legal advice. Verify outputs before making material decisions.