{
  "schemaVersion": 1,
  "slug": "car-loan-payoff-calculator",
  "category": "automotive",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "17a7165d6358800f62a1ee2576465ad69d822d6395fc91a291424a16ce2ff059",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/car-loan-payoff-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": "M = B·r ÷ [1 − (1+r)^−n];  B_{i+1} = B_i(1+r) − min(M + E, B_i(1+r))",
    "vars": [
      [
        "M",
        "Current monthly payment"
      ],
      [
        "E",
        "Extra monthly payment"
      ],
      [
        "r",
        "Monthly rate = APR% ÷ 100 ÷ 12"
      ],
      [
        "n",
        "Original remaining months"
      ],
      [
        "B_i",
        "Balance after i months"
      ],
      [
        "B",
        "Current loan balance"
      ]
    ],
    "note": "Uses APR ÷ 12 and fixed monthly amortization; assumes extra payments are applied after interest and excludes fees or penalties. Actual allocation follows the lender contract."
  },
  "externalEvidence": {
    "reviewedAt": "2026-10-04",
    "sources": [
      {
        "name": "OpenStax — Loan amortization",
        "url": "https://openstax.org/books/principles-finance-2e/pages/8-3-loan-amortization"
      }
    ],
    "basis": "Fixed monthly payment = P × i / (1 - (1 + i)^(-n)); i is annual percent / 1200. At zero interest, payment = P / n. Extra payments reduce the simulated outstanding balance each month.",
    "limitations": "Fixed nominal rate and monthly payments; fees, insurance, taxes and lender-specific daily accrual are excluded. The simulation stops at a one-cent balance or 1200 payments; prepayment penalties are excluded.",
    "implementationHash": "17a7165d6358800f62a1ee2576465ad69d822d6395fc91a291424a16ce2ff059"
  },
  "contract": {
    "compute": "const r = rate/100/12; const pay = r > 0 ? balance*r/(1-Math.pow(1+r, -remainingMonths)) : balance/remainingMonths; const totalWithout = pay*remainingMonths-balance; let bal = balance, months = 0, paid = 0; const withPay = pay+extraPayment; while (bal > 0.01 && months < 1200) { const interest = bal*r; bal += interest; const p = Math.min(withPay, bal); paid += p; bal -= p; months++; } const totalWith = Math.max(0, paid-balance); return { currentPayment: pay, monthsWithExtra: months, monthsSaved: remainingMonths-months, interestSaved: totalWithout-totalWith, totalInterest: totalWithout };",
    "inputs": [
      {
        "name": "balance",
        "type": "number",
        "default": 18000,
        "min": 0,
        "max": 2000000,
        "step": 100
      },
      {
        "name": "rate",
        "type": "number",
        "default": 6.5,
        "min": 0,
        "max": 40,
        "step": 0.01,
        "slider": true
      },
      {
        "name": "remainingMonths",
        "type": "number",
        "default": 42,
        "min": 1,
        "max": 120,
        "step": 1,
        "slider": true
      },
      {
        "name": "extraPayment",
        "type": "number",
        "default": 100,
        "min": 0,
        "max": 20000,
        "step": 10,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "monthsWithExtra",
        "precision": 1,
        "unit": "months"
      },
      {
        "name": "monthsSaved",
        "precision": 1,
        "unit": "months"
      },
      {
        "name": "interestSaved",
        "precision": 0,
        "unit": "$"
      },
      {
        "name": "currentPayment",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "totalInterest",
        "precision": 0,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
