{
  "schemaVersion": 1,
  "slug": "car-payment-calculator",
  "category": "automotive",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "d8364729edb7dbe4dcbccd48628e3f191e361a547496fc0135a01f79ffda22f1",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/car-payment-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 = P × r ÷ (1 − (1 + r)^−n),  r = APR ÷ 100 ÷ 12",
    "vars": [
      [
        "M",
        "Monthly payment"
      ],
      [
        "P",
        "Loan amount (principal)"
      ],
      [
        "r",
        "Monthly interest rate"
      ],
      [
        "n",
        "Number of months"
      ],
      [
        "APR",
        "Annual interest rate (%)"
      ]
    ],
    "note": "APR is entered as a percent (7 means 7%); it is divided by 100 and 12. At 0%, M = P ÷ n."
  },
  "externalEvidence": {
    "reviewedAt": "2026-09-28",
    "sources": [
      {
        "name": "CFPB — Compare auto loan offers and total costs",
        "url": "https://www.consumerfinance.gov/ask-cfpb/how-do-i-compare-auto-loan-offers-what-should-i-look-at-besides-the-monthly-payment-en-753/"
      }
    ]
  },
  "contract": {
    "compute": "const r = rate/100/12; const monthly = r > 0 ? loanAmount*r/(1-Math.pow(1+r, -months)) : loanAmount/(months || 1); const maxLoan = r > 0 ? monthlyBudget*(1-Math.pow(1+r, -months))/r : monthlyBudget*months; return { monthly, totalInterest: monthly*months-loanAmount, totalPaid: monthly*months, maxLoan };",
    "inputs": [
      {
        "name": "loanAmount",
        "type": "number",
        "default": 25000,
        "min": 0,
        "max": 2000000,
        "step": 100
      },
      {
        "name": "rate",
        "type": "number",
        "default": 7,
        "min": 0,
        "max": 40,
        "step": 0.01,
        "slider": true
      },
      {
        "name": "months",
        "type": "number",
        "default": 60,
        "min": 6,
        "max": 120,
        "step": 6,
        "slider": true
      },
      {
        "name": "monthlyBudget",
        "type": "number",
        "default": 450,
        "min": 0,
        "max": 20000,
        "step": 10,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "monthly",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "totalInterest",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "totalPaid",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "maxLoan",
        "precision": 0,
        "unit": "$"
      }
    ],
    "interpret": null
  }
}
