curatedapi

Mortgage calculator

Monthly mortgage payment including property tax, insurance, HOA dues and PMI, with an exact amortization schedule.

Purchase price of the home.
Down payment as an amount. Give this or down_payment_percent.
Down payment as a percent of the price. Give this or down_payment.
Nominal annual interest rate in percent.
Length of the mortgage in years.
Property tax per year.
Home insurance premium per year.
Homeowners association dues per month.
PMI premium per year as a percent of the original loan amount (often 0.3 to 1.5). Only applied when the loan is above 80% of the price.
Also return the month-by-month schedule.
More options: rounding and decimals
Precision and rounding
Rounding mode applied once to each result. Default half_even.
Round results to this many digits after the decimal point.

Examples

Example: CFPB sample loan

Loan amount
Price minus down payment.
162,000.00 exact
Down payment
Down payment amount.
18,000.00 exact
Loan to value percent
Loan amount as a percent of the price. Unit: percent.
90.00 exact
Monthly principal and interest
Monthly principal and interest payment.
761.78 exact
Monthly property tax
Annual property tax ÷ 12.
0.00 exact
Monthly home insurance
Annual insurance ÷ 12.
0.00 exact
Monthly hoa
Monthly HOA dues.
0.00 exact
Monthly pmi
Monthly PMI while it applies.
0.00 exact
Total monthly payment
Total of the monthly items above (first month).
761.78 exact
Pmi months
Number of months PMI is charged.
0
Total pmi
Total PMI paid.
0.00 exact
Total interest
Total interest over the life of the loan.
112,243.67 exact
Total principal and interest
Sum of all principal and interest payments.
274,243.67 exact
Last principal and interest payment
The final payment, which clears the balance exactly.
764.65 exact
Number of payments
Number of monthly payments.
360

Rounding: Half even, 2 decimal places. Calculator finance/mortgage@1.

How it is calculated

P&I = L·r·(1+r)^n / ((1+r)^n − 1), L = price − down payment, r = rate ÷ 1200, n = years × 12; total = P&I + tax/12 + insurance/12 + HOA + PMI

Splits the monthly housing payment into principal and interest, property tax, home insurance, HOA dues and private mortgage insurance (PMI). Principal and interest use the same exact, lender-style schedule as the loan EMI calculator. PMI applies when the loan is more than 80% of the price and stops once the scheduled balance reaches 78% of the original price, the automatic termination point in the US Homeowners Protection Act.

  • Amounts are plain numbers in any single currency; no currency conversion is done.
  • PMI is estimated as a fixed yearly percent of the original loan amount. Real PMI pricing depends on the lender and credit score, and borrowers can usually ask to cancel it at 80% loan-to-value; this calculator uses the automatic 78% point.
  • Tax and insurance are assumed constant; in reality they change over time.

References

Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.

Use it from your code

POST /v1/calc/finance/mortgageVersion 1
curl https://api.curatedapi.com/v1/calc/finance/mortgage \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "home_price": "180000",
    "down_payment": "18000",
    "annual_rate_percent": "3.875",
    "term_years": 30
  }'
The same call in Python
import os

import requests

payload = {
    "home_price": "180000",
    "down_payment": "18000",
    "annual_rate_percent": "3.875",
    "term_years": 30,
}
response = requests.post(
    "https://api.curatedapi.com/v1/calc/finance/mortgage",
    headers={"Authorization": f"Bearer {os.environ['CURATEDAPI_KEY']}"},
    json=payload,
    timeout=10,
)
print(response.json()["result"])
The same call in JavaScript
const payload = {
    "home_price": "180000",
    "down_payment": "18000",
    "annual_rate_percent": "3.875",
    "term_years": 30,
};
const response = await fetch("https://api.curatedapi.com/v1/calc/finance/mortgage", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.CURATEDAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});
console.log((await response.json()).result);

MCP tool calc_finance_mortgage at https://mcp.curatedapi.com. Inputs, outputs and errors in the API reference.

Put it on your website

<div data-curatedapi-widget="finance/mortgage" data-key="capi_public_…"></div>
<script src="https://widgets.curatedapi.com/v1/widget.js" async></script>

Use a public key registered for your site. Calculations are billed like API calls. How widgets work.

Related calculators

Add this calculator to your website

Paste two lines into your page and your visitors get this calculator. Each use counts as one call on your plan, the same as the API.

Free for up to 1,000 uses a month. 50,000 uses a month cost $9.00 on the Starter plan.