{
  "id": "40-year-mortgage",
  "version": "12ea0421efec",
  "status": "published",
  "name": "40 Year Mortgage Calculator",
  "question": "What is a 40 year mortgage payment?",
  "summary": "Works out the monthly payment and total interest on a 40-year fixed-rate mortgage (480 payments), and how they compare with the same loan over 30 years.",
  "category": "finance",
  "subcategory": "loans",
  "url": "https://www.acalculator.org/finance/40-year-mortgage-calculator",
  "markdown": "https://www.acalculator.org/finance/40-year-mortgage-calculator.md",
  "kind": "function",
  "method": "Loan L = price − down payment. Monthly rate r = yearly rate ÷ 1,200 and n = years × 12 payments. Payment M = L × r ÷ (1 − (1 + r)^−n), or L ÷ n at 0%. Total interest = M × n − L. The 30-year figures use n = 360.",
  "assumptions": [
    "A fixed rate for the whole term, monthly payments, and no extra payments. The payment is principal and interest only: property tax, insurance, HOA dues and mortgage insurance are extra.",
    "A loan term over 30 years is not a qualified mortgage under the CFPB’s ability-to-repay rule (12 CFR 1026.43(e)(2)(ii)), so fewer lenders offer it."
  ],
  "inputs": {
    "$schema": "https://json-schema.org/draft/2020-12/schema",
    "type": "object",
    "properties": {
      "price": {
        "title": "Home price",
        "description": "The price of the home.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 1000,
        "maximum": 1000000000
      },
      "down": {
        "title": "Down payment",
        "description": "The cash you pay toward the price. The loan is the price minus this.",
        "type": "number",
        "x-unit": "USD",
        "minimum": 0,
        "maximum": 1000000000
      },
      "rate": {
        "title": "Interest rate",
        "description": "The fixed yearly rate your lender quotes. The monthly rate is this ÷ 12.",
        "type": "number",
        "x-unit": "percent",
        "minimum": 0,
        "maximum": 30
      },
      "years": {
        "title": "Loan term (years)",
        "description": "The length of the mortgage: 40 years on this page, or any term from 30 to 50, to compare with 30 years.",
        "type": "integer",
        "minimum": 30,
        "maximum": 50
      }
    }
  },
  "outputs": {
    "payment": {
      "label": "Monthly payment",
      "description": "Principal and interest each month.",
      "format": "money"
    },
    "loan": {
      "label": "Loan amount",
      "description": "The price minus the down payment.",
      "format": "money"
    },
    "interest": {
      "label": "Total interest",
      "description": "Every payment added up, minus the loan.",
      "format": "money"
    },
    "total": {
      "label": "Total of payments",
      "description": "The loan plus the total interest.",
      "format": "money"
    },
    "payment30": {
      "label": "Payment over 30 years",
      "description": "The same loan and rate over 30 years, for comparison.",
      "format": "money"
    },
    "less": {
      "label": "Monthly difference vs 30 years",
      "description": "The 30-year payment minus this payment.",
      "format": "money"
    },
    "more": {
      "label": "Extra interest vs 30 years",
      "description": "This term’s total interest minus the 30-year total.",
      "format": "money"
    }
  },
  "defaultAnswer": {
    "inputs": {
      "price": 400000,
      "down": 80000,
      "rate": 6.5,
      "years": 40
    },
    "outputs": {
      "payment": 1873.46179223956,
      "loan": 320000,
      "interest": 579261.6602749889,
      "total": 899261.6602749889,
      "payment30": 2022.6176751774838,
      "less": 149.1558829379237,
      "more": 171119.29721109464
    },
    "text": "A 40-year loan of $320,000.00 at 6.5% costs $1,873.46 a month, with $579,261.66 of interest in total."
  },
  "examples": [
    {
      "given": {
        "price": 400000,
        "down": 80000,
        "rate": 6.5,
        "years": 40
      },
      "expect": {
        "payment": 1873.4617922395632,
        "interest": 579261.6602749904,
        "payment30": 2022.6176751774892,
        "less": 149.155882937926,
        "more": 171119.2972110943
      },
      "source": "OpenStax, Contemporary Mathematics, section 6.12 Renting and Homeownership: monthly mortgage payment pmt = P × (r/12) × (1 + r/12)^(12t) ÷ ((1 + r/12)^(12t) − 1); total paid = pmt × 12 × t. https://openstax.org/books/contemporary-mathematics/pages/6-12-renting-and-homeownership (retrieved 2026-10-18); Python 3 in docs/progress/WP-124.md"
    },
    {
      "given": {
        "price": 300000,
        "down": 50000,
        "rate": 6,
        "years": 40
      },
      "expect": {
        "payment": 1375.534101510133,
        "interest": 410256.36872486386,
        "payment30": 1498.8763128818923
      },
      "source": "OpenStax, Contemporary Mathematics, section 6.12 Renting and Homeownership: monthly mortgage payment pmt = P × (r/12) × (1 + r/12)^(12t) ÷ ((1 + r/12)^(12t) − 1); total paid = pmt × 12 × t. https://openstax.org/books/contemporary-mathematics/pages/6-12-renting-and-homeownership (retrieved 2026-10-18); Python 3 in docs/progress/WP-124.md"
    },
    {
      "given": {
        "price": 250000,
        "down": 50000,
        "rate": 0,
        "years": 40
      },
      "expect": {
        "payment": 416.6666666666667,
        "interest": 0
      },
      "source": "hand calculation in content.mdx: 200,000 ÷ 480 = 416.67"
    }
  ],
  "sources": [
    "OpenStax, Contemporary Mathematics, section 6.12 Renting and Homeownership: the monthly mortgage payment pmt = P × (r/12) × (1 + r/12)^(12t) ÷ ((1 + r/12)^(12t) − 1) for principal P, yearly rate r and t years; total paid = pmt × 12 × t. Retrieved 2026-10-18. https://openstax.org/books/contemporary-mathematics/pages/6-12-renting-and-homeownership",
    "Consumer Financial Protection Bureau, Regulation Z, 12 CFR 1026.43(e)(2)(ii): a qualified mortgage is one “for which the loan term does not exceed 30 years”. Retrieved 2026-10-18. https://www.consumerfinance.gov/rules-policy/regulations/1026/43/"
  ],
  "related": [
    "mortgage",
    "50-year-mortgage",
    "300k-mortgage",
    "mortgage-comparison"
  ],
  "changelog": []
}
