{
  "schemaVersion": 1,
  "slug": "car-loan-calculator",
  "category": "automotive",
  "kind": "implementation",
  "independentValidation": false,
  "implementationHash": "b3b52235a818e7ffc7cc952fa95953a4059a660a556eb7768938d72a1a838d1d",
  "provenance": "Generated from the calculation contract used by the published page. Publication is not external validation.",
  "sourceFiles": [
    "data/calculators/car-loan-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 = F·r ÷ [1 − (1+r)^−n];  r = APR% ÷ 100 ÷ 12",
    "vars": [
      [
        "M",
        "Monthly payment"
      ],
      [
        "F",
        "Amount financed (incl. tax, less down/trade-in)"
      ],
      [
        "r",
        "Monthly interest rate"
      ],
      [
        "n",
        "Term in months"
      ],
      [
        "APR",
        "Annual Percentage Rate"
      ]
    ],
    "note": "Sales tax applies only to (price − trade-in T); F = price + tax − down payment − T, floored at 0; total interest = M·n − F."
  },
  "externalEvidence": {
    "reviewedAt": "2026-09-28",
    "sources": [
      {
        "name": "CFPB — Auto loan key terms: APR, amortization, principal, and total cost",
        "url": "https://www.consumerfinance.gov/consumer-tools/auto-loans/answers/key-terms/"
      }
    ]
  },
  "contract": {
    "compute": "const tax = (price-tradeIn)*salesTax/100; const financed = Math.max(0, price+tax-downPayment-tradeIn); const r = rate/100/12; const monthly = r > 0 ? financed*r/(1-Math.pow(1+r, -months)) : financed/(months || 1); const totalPaid = monthly*months; return { amountFinanced: financed, monthly, totalInterest: totalPaid-financed, totalPaid, downPercent: price > 0 ? (downPayment+tradeIn)/price*100 : 0 };",
    "inputs": [
      {
        "name": "price",
        "type": "number",
        "default": 32000,
        "min": 0,
        "max": 2000000,
        "step": 100
      },
      {
        "name": "downPayment",
        "type": "number",
        "default": 5000,
        "min": 0,
        "max": 2000000,
        "step": 100
      },
      {
        "name": "tradeIn",
        "type": "number",
        "default": 3000,
        "min": 0,
        "max": 2000000,
        "step": 100
      },
      {
        "name": "rate",
        "type": "number",
        "default": 6.5,
        "min": 0,
        "max": 40,
        "step": 0.01,
        "slider": true
      },
      {
        "name": "months",
        "type": "number",
        "default": 60,
        "min": 6,
        "max": 120,
        "step": 6,
        "slider": true
      },
      {
        "name": "salesTax",
        "type": "number",
        "default": 7,
        "min": 0,
        "max": 25,
        "step": 0.1,
        "slider": true
      }
    ],
    "outputs": [
      {
        "name": "monthly",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "amountFinanced",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "totalInterest",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "totalPaid",
        "precision": 2,
        "unit": "$"
      },
      {
        "name": "downPercent",
        "precision": 1,
        "unit": "%"
      }
    ],
    "interpret": null
  }
}
