{
  "id": "loan-comparison",
  "version": "35deb1907cbb",
  "status": "published",
  "name": "Loan Comparison Calculator",
  "question": "Loan comparison: which costs less?",
  "summary": "Compares two loan offers for the same amount: the monthly payment, the interest and fees over the years you keep the loan, the APR with fees, and which one costs less.",
  "category": "finance",
  "subcategory": "loans",
  "url": "https://www.acalculator.org/finance/loan-comparison-calculator",
  "markdown": "https://www.acalculator.org/finance/loan-comparison-calculator.md",
  "kind": "function",
  "method": "For each loan: payment = L × r ÷ (1 − (1 + r)^−n), r = rate ÷ 1200, n = years × 12; cost = fees + interest paid in the months kept; APR = 1200 × j where the payments at monthly rate j are worth L − fees.",
  "assumptions": [
    "Both loans are for the same amount, at a fixed rate, with monthly payments at the end of each month.",
    "Fees are paid when the loan starts; they are not added to the loan.",
    "The cost over the years kept counts interest and fees, not the principal you repay.",
    "No prepayment penalties. Type the rates you are offered; no live rates."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "amount": {
        "title": "Amount to borrow",
        "description": "The amount borrowed with either loan.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 1,
        "maximum": 100000000
      },
      "ratea": {
        "title": "Loan A rate",
        "description": "The fixed yearly interest rate of loan A. The monthly rate is this ÷ 12.",
        "type": "number",
        "x-unit": "percent",
        "minimum": 0,
        "maximum": 50
      },
      "yearsa": {
        "title": "Loan A term (years)",
        "description": "The length of loan A in years; 2.5 is 30 months.",
        "type": "number",
        "minimum": 0.1,
        "maximum": 40
      },
      "feesa": {
        "title": "Loan A fees",
        "description": "Origination and other fees for loan A, paid when the loan starts.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 10000000
      },
      "rateb": {
        "title": "Loan B rate",
        "description": "The fixed yearly interest rate of loan B. The monthly rate is this ÷ 12.",
        "type": "number",
        "x-unit": "percent",
        "minimum": 0,
        "maximum": 50
      },
      "yearsb": {
        "title": "Loan B term (years)",
        "description": "The length of loan B in years; 2.5 is 30 months.",
        "type": "number",
        "minimum": 0.1,
        "maximum": 40
      },
      "feesb": {
        "title": "Loan B fees",
        "description": "Origination and other fees for loan B, paid when the loan starts.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 10000000
      },
      "keep": {
        "title": "Years you keep the loan",
        "description": "Compare the cost over this many years, for example until you plan to pay off or refinance. Leave empty for each loan’s full term.",
        "type": "number",
        "minimum": 0.1,
        "maximum": 40
      }
    }
  },
  "outputs": {
    "saving": {
      "label": "The cheaper loan saves",
      "description": "The difference between the two costs.",
      "format": "money"
    },
    "best": {
      "label": "Cheaper loan",
      "description": "The loan with the lower interest plus fees.",
      "format": "text"
    },
    "paymentA": {
      "label": "Loan A monthly payment",
      "description": "Amount × r ÷ (1 − (1 + r)^−n), r = rate ÷ 12, n = months.",
      "format": "money"
    },
    "paymentB": {
      "label": "Loan B monthly payment",
      "description": "Amount × r ÷ (1 − (1 + r)^−n), r = rate ÷ 12, n = months.",
      "format": "money"
    },
    "costA": {
      "label": "Loan A cost",
      "description": "Up-front fees + interest paid over the years kept.",
      "format": "money"
    },
    "costB": {
      "label": "Loan B cost",
      "description": "Up-front fees + interest paid over the years kept.",
      "format": "money"
    },
    "interestA": {
      "label": "Loan A interest",
      "description": "Interest paid over the years kept.",
      "format": "money"
    },
    "interestB": {
      "label": "Loan B interest",
      "description": "Interest paid over the years kept.",
      "format": "money"
    },
    "aprA": {
      "label": "Loan A APR",
      "description": "The yearly rate with the up-front fees counted (Regulation Z).",
      "format": "percent"
    },
    "aprB": {
      "label": "Loan B APR",
      "description": "The yearly rate with the up-front fees counted (Regulation Z).",
      "format": "percent"
    },
    "balanceA": {
      "label": "Loan A balance left",
      "description": "What you still owe on loan A when you stop comparing.",
      "format": "money"
    },
    "balanceB": {
      "label": "Loan B balance left",
      "description": "What you still owe on loan B when you stop comparing.",
      "format": "money"
    },
    "months": {
      "label": "Months compared",
      "description": "The months the costs cover.",
      "format": "integer"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "amount": 20000,
      "ratea": 7,
      "yearsa": 5,
      "feesa": 0,
      "rateb": 6.5,
      "yearsb": 5,
      "feesb": 400
    },
    "outputs": {
      "saving": 117.93961405481605,
      "best": "Loan A",
      "paymentA": 396.02397080699075,
      "paymentB": 391.322964374571,
      "costA": 3761.438248419443,
      "costB": 3879.377862474259,
      "interestA": 3761.438248419443,
      "interestB": 3479.377862474259,
      "aprA": 7,
      "aprB": 7.347283715868759,
      "balanceA": 0,
      "balanceB": 0,
      "months": 60
    },
    "text": "Loan A costs $117.94 less over 60 months: $3,761.44 for loan A against $3,879.38 for loan B."
  },
  "examples": [
    {
      "given": {
        "amount": 20000,
        "ratea": 7,
        "yearsa": 5,
        "feesa": 0,
        "rateb": 6.5,
        "yearsb": 5,
        "feesb": 400
      },
      "expect": {
        "paymentA": 396.02397080698944,
        "paymentB": 391.32296437457353,
        "costA": 3761.4382484193666,
        "costB": 3879.377862474412,
        "best": "Loan A",
        "aprB": 7.3472837158691995
      },
      "source": "hand calculation in content.mdx; Consumer Financial Protection Bureau, Regulation Z, 12 CFR 1026, Appendix J: annual percentage rate computations for closed-end credit transactions (actuarial method), https://www.consumerfinance.gov/rules-policy/regulations/1026/j/ (retrieved 2026-10-05); Consumer Financial Protection Bureau, What is the difference between a loan interest rate and the APR? https://www.consumerfinance.gov/ask-cfpb/what-is-the-difference-between-a-loan-interest-rate-and-the-apr-en-733/ (retrieved 2026-10-05)"
    },
    {
      "given": {
        "amount": 20000,
        "ratea": 7,
        "yearsa": 5,
        "feesa": 0,
        "rateb": 6.5,
        "yearsb": 5,
        "feesb": 400,
        "keep": 2
      },
      "expect": {
        "costA": 2330.391551902938,
        "costB": 2559.636806760869,
        "balanceA": 12825.81625253519,
        "months": 24
      },
      "source": "hand calculation in content.mdx: balance after 24 payments = L(1 + r)^24 − P((1 + r)^24 − 1) ÷ r; Consumer Financial Protection Bureau, What is the difference between a loan interest rate and the APR? https://www.consumerfinance.gov/ask-cfpb/what-is-the-difference-between-a-loan-interest-rate-and-the-apr-en-733/ (retrieved 2026-10-05)"
    },
    {
      "given": {
        "amount": 12000,
        "ratea": 0,
        "yearsa": 2,
        "feesa": 0,
        "rateb": 0,
        "yearsb": 4,
        "feesb": 0
      },
      "expect": {
        "paymentA": 500,
        "paymentB": 250,
        "costA": 0,
        "costB": 0,
        "saving": 0,
        "best": "Neither: they cost the same"
      },
      "source": "hand calculation in content.mdx: 12,000 ÷ 24 and 12,000 ÷ 48"
    }
  ],
  "sources": [
    "Consumer Financial Protection Bureau, What is the difference between a loan interest rate and the APR? https://www.consumerfinance.gov/ask-cfpb/what-is-the-difference-between-a-loan-interest-rate-and-the-apr-en-733/ (retrieved 2026-10-05)",
    "Consumer Financial Protection Bureau, Regulation Z, 12 CFR 1026, Appendix J: annual percentage rate computations for closed-end credit transactions. https://www.consumerfinance.gov/rules-policy/regulations/1026/j/ (retrieved 2026-10-05)"
  ],
  "related": [
    "loan",
    "apr",
    "personal-loan",
    "mortgage-comparison"
  ],
  "changelog": []
}
