{
  "schemaVersion": 1,
  "slug": "annuity-calculator",
  "category": "finance",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "cc7c2aa313f8b66c3e4cf9b291948b640037453c4375bbe4a088911b6fcf4878",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/annuity-calculator.json",
    "src/engine.js"
  ],
  "runtimeSource": "/sources/engine.txt",
  "runtimeHash": "5c888d8898afbdee36267bb9977829e1e2ac568f6677c8ee87469c139864645c",
  "scope": "The compute function records implemented equations, constants, lookup tables and custom rules. Inputs record defaults and allowed values; outputs record precision and units. Defaults are examples, not recommendations. General background references are not evidence for this specific algorithm.",
  "publishedFormula": {
    "formula": "FV = PMT × ((1 + r)^n − 1) ÷ r",
    "vars": [
      [
        "FV",
        "future value"
      ],
      [
        "PMT",
        "regular monthly deposit"
      ],
      [
        "r",
        "monthly interest rate"
      ],
      [
        "n",
        "number of deposits"
      ]
    ],
    "note": "r = annual % ÷ 100 ÷ 12; n = years × 12; ordinary annuity, deposits at period end."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-04",
    "sources": [
      {
        "name": "OpenStax — Ordinary annuities",
        "url": "https://openstax.org/books/principles-finance/pages/8-2-annuities"
      }
    ],
    "basis": "End-of-month deposits use FV = D × ((1 + i)^n - 1) / i, with i = annual percent / 1200 and n = 12 × years; zero rate uses D × n.",
    "limitations": "Constant nominal rate and equal monthly deposits; excludes taxes, fees and inflation. It is a projection, not a guaranteed return. Fractional month counts are mathematical projections, not an actual payment schedule.",
    "implementationHash": "cc7c2aa313f8b66c3e4cf9b291948b640037453c4375bbe4a088911b6fcf4878"
  },
  "contract": {
    "compute": "const r=rate/100/12, n=years*12; const fv = r ? deposit*((Math.pow(1+r,n)-1)/r) : deposit*n; return { futureValue:fv, contributions:deposit*n, interestEarned:fv-deposit*n };",
    "inputs": [
      {
        "name": "deposit",
        "type": "number",
        "default": 500,
        "min": 0,
        "max": 1000000,
        "step": 50
      },
      {
        "name": "rate",
        "type": "number",
        "default": 7,
        "min": 0,
        "max": 100,
        "step": 0.01
      },
      {
        "name": "years",
        "type": "number",
        "default": 20,
        "min": 0,
        "max": 80,
        "step": 1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "futureValue",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "contributions",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "interestEarned",
        "precision": 2,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
