# 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.

Canonical calculator: https://klarfort.com/tools/overpay-or-invest/
Content updated: 2026-09-07
Assumptions reviewed: 2026-09-07

## Overview
Compare two uses of the same spare monthly cash: paying down a mortgage faster or investing while making scheduled payments. Both options use one end date and the same total monthly cash budget.

The comparison includes mortgage interest, an entered overpayment cost and insurance removal at your chosen loan-to-value threshold. It also shows investment scenarios driven by your return and volatility assumptions.

## How to use
1. Enter the mortgage balance, remaining term, annual rate, home value and extra cash available each month.
2. Choose a common comparison horizon and enter investment return, volatility and simulation settings.
3. Add investment cash, a separate protected cash reserve, any upfront overpayment cost and mortgage-insurance details.
4. Calculate and compare the wealth difference, payoff dates, liquid assets and simulated range.

## Understanding the result
A positive headline difference means the overpayment option ends with more modeled net wealth. A negative difference means the investing option ends with more. The shared home value cancels from this comparison.

Liquid assets show the investment balance plus protected cash. Model probabilities count simulated outcomes under your assumptions; they are not estimates of your actual chance of outperforming.

## Questions
### What happens after the mortgage is paid off?
The cash no longer needed for mortgage payments is invested at month end through the same comparison horizon. Savings from modeled mortgage-insurance removal are also invested.

### Does the model compare the same market conditions?
Yes. Within each simulation path, both options experience the same monthly investment returns. This isolates the modeled effect of directing cash to mortgage payments or investments.

### Are taxes and investment fees included?
No. The comparison includes mortgage interest, entered mortgage insurance and the upfront cost assigned to overpayment. Investment taxes, other fees, future mortgage-rate changes and home-price changes are excluded.

## Default worked example
Overpayment minus investing wealth: -28,438.64 USD. Overpayment minus investing net wealth at the same end date. The modeled probability reflects only the assumptions entered. Assumptions as of 2026-09-07.

## Formula
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.

## Inputs
- currency: Currency; default "USD"
- principal: Mortgage balance; default 300000
- homeValue: Home value for insurance removal; default 400000
- mortgageRate: Mortgage annual rate (%); default 5
- mortgageMonths: Mortgage remaining months; default 300
- extraMonthly: Extra cash each month; default 500
- horizonMonths: Common comparison horizon months; default 300
- investmentReturn: Expected effective annual investment return (%); default 6
- volatility: Annual investment volatility (%); default 15
- paths: Simulation paths; default 250
- seed: Seed (empty or 16 hexadecimal characters); default ""
- initialInvestment: Initial investment cash outside reserve; default 20000
- protectedCash: Protected cash outside investment portfolio; default 10000
- overpaymentClosingCost: Upfront cost charged to overpayment option; default 0
- monthlyMortgageInsurance: Monthly mortgage insurance; default 0
- insuranceRemovalLTV: Insurance removal loan-to-value (%); default 78

## Interfaces
Input schema: https://klarfort.com/tools/overpay-or-invest/schema.json
Worked request and response: https://klarfort.com/tools/overpay-or-invest/examples.json
Public table: https://klarfort.com/tools/overpay-or-invest/table.json
JSON API: POST https://klarfort.com/tools/api/v1/overpay-or-invest
MCP endpoint: POST https://klarfort.com/tools/mcp
MCP tool name: overpay-or-invest

## JSON request body
```json
{
  "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
}
```

## 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.

Computed with KlarFort Calculators, https://klarfort.com/

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. The credit_url field contains the homepage. The citation_url field is an optional calculator reference. Full permission: https://klarfort.com/tools/docs/license/

## Sources
KlarFort calculator methodology: https://klarfort.com/tools/methodology/ (1)
