Free calculators
Retirement calculator with pension and spending stages documentation
Inputs, formulas, assumptions and API/MCP examples for the retirement calculator with pension and spending stages. Reproduce a calculation and cite its sources.
Content updated . Assumptions reviewed .
Formula and assumptions
Before retirement, contribute monthly. During retirement, withdraw max(inflated expenses − indexed pension − indexed stage income, 0), or invest the surplus. Apply monthly returns, asset fees and tax on positive gains.
- Contributions are made at the beginning of each month. Annual returns are effective rates converted to monthly compound factors. All figures use one entered currency.
- Retirement and pension months are one-based and inclusive. Stage ranges cannot overlap. All retirement expense, pension and stage income amounts are in today's money and grow with the entered inflation rate.
- Success requires no withdrawal shortfall and a positive balance at every month end, including the final month. Zero-volatility simulations match the deterministic path. Return draws are independent lognormal samples; the model does not estimate actual future probabilities.
Assumptions reviewed:
Sources
- KlarFort calculation methodology. Free to use with the credit line; vintage 1.
Parameters
| Name | Description | Type | Default | Minimum | Maximum |
|---|---|---|---|---|---|
| currency | Currency | string | "USD" | ||
| principal | Starting balance | number | 10000 | 0 | 1,000,000,000,000 |
| months | Projection months | integer | 12 | 1 | 600 |
| monthlyContribution | Monthly contribution | number | 0 | 0 | 1,000,000,000,000 |
| annualReturn | Annual return (%) | number | 0 | -99 | 100 |
| retirementMonth | First retirement month | integer | 1 | 1 | 601 |
| monthlyExpenses | Monthly retirement spending | number | 1000 | 0 | 1,000,000,000,000 |
| pensionStartMonth | First pension month | integer | 1 | 1 | 601 |
| monthlyPension | Monthly pension in today's money | number | 0 | 0 | 1,000,000,000,000 |
| annualVolatility | Annual volatility (%) | number | 0 | 0 | 200 |
| annualFee | Annual asset fee (%) | number | 0 | 0 | 100 |
| taxRate | Tax on positive gains (%) | number | 0 | 0 | 100 |
| inflationRate | Annual inflation (%) | number | 0 | -99 | 100 |
| paths | Simulation paths | integer | 1000 | 1 | 1,000 |
| seed | Leave empty to derive a reproducible seed from your inputs, or enter 16 hexadecimal characters. | string | "" | ||
| lifeStages | Optional nonoverlapping inclusive month ranges overriding retirement spending and adding other monthly income. Each amount is expressed in today's money. | array | [] |
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/retirement-calculator -H "Content-Type: application/json" --data '{"currency":"USD","principal":10000,"months":12,"monthlyContribution":0,"annualReturn":0,"retirementMonth":1,"monthlyExpenses":1000,"pensionStartMonth":1,"monthlyPension":0,"annualVolatility":0,"annualFee":0,"taxRate":0,"inflationRate":0,"paths":1000,"seed":"bcedbf7e441e38da","lifeStages":[]}'fetch("https://klarfort.com/tools/api/v1/retirement-calculator", {method:"POST", headers:{"Content-Type":"application/json"}, body:JSON.stringify({"currency":"USD","principal":10000,"months":12,"monthlyContribution":0,"annualReturn":0,"retirementMonth":1,"monthlyExpenses":1000,"pensionStartMonth":1,"monthlyPension":0,"annualVolatility":0,"annualFee":0,"taxRate":0,"inflationRate":0,"paths":1000,"seed":"bcedbf7e441e38da","lifeStages":[]})})import json, urllib.request
request = urllib.request.Request("https://klarfort.com/tools/api/v1/retirement-calculator", data=json.dumps({"currency":"USD","principal":10000,"months":12,"monthlyContribution":0,"annualReturn":0,"retirementMonth":1,"monthlyExpenses":1000,"pensionStartMonth":1,"monthlyPension":0,"annualVolatility":0,"annualFee":0,"taxRate":0,"inflationRate":0,"paths":1000,"seed":"bcedbf7e441e38da","lifeStages":[]}).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 retirement-calculator. 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.