x402AgentTools

šŸ¦Loan Payment Calculator

Calculate the fixed monthly payment for a loan from its principal, annual interest rate and term in years, plus total repaid and total interest (annuity formula).

Worked examples

300,000 at 4.5% for 30 years

GET /api/v1/calculators/loan-payment-calculator?principal=300000&annualRate=4.5&years=30

Result: 1,520.06 / month

20,000 at 6.9% for 4 years

GET /api/v1/calculators/loan-payment-calculator?principal=20000&annualRate=6.9&years=4

Result: 478 / month

500,000 at 2% for 15 years

GET /api/v1/calculators/loan-payment-calculator?principal=500000&annualRate=2&years=15

Result: 3,217.54 / month

Machine API (x402)

$0.002 / call

This tool is also a JSON API for AI agents. Requests without payment receive 402 Payment Required plus instructions; agents pay USDC on Base via the x402 protocol — no accounts, no API keys.

GET /api/v1/calculators/loan-payment-calculator?principal=300000&annualRate=4.5&years=30 HTTP/1.1
Host: agenttools-hub.vercel.app

→ 402 (payment required, instructions in headers)
→ 200 (after X-PAYMENT header; JSON body below)

{
  "tool": "calculators/loan-payment-calculator",
  "input": {"principal":300000,"annualRate":4.5,"years":30},
  "result": { "value": 1520.055929, "answer": "1,520.06 / month" }
}

Agent docs: /llms.txt Ā· OpenAPI spec Ā· integration guide

About this tool

Compute the fixed monthly payment of an amortized loan — mortgage, car or personal — from the amount borrowed, the nominal annual rate and the term. Total repaid and total interest are included so you can compare offers.

M = P Ā· r Ā· (1+r)ⁿ Ć· ((1+r)ⁿ āˆ’ 1), where r = annual rate Ć· 12 and n = years Ɨ 12

Frequently asked questions

Does this include taxes, insurance or fees?

No. The result is the pure principal-and-interest payment (P&I). Property tax, insurance and origination fees come on top.

Why is total interest so large on long loans?

Interest accrues on the remaining balance each month; stretching the term lowers the monthly payment but multiplies the number of interest-bearing months.

What happens at a 0% rate?

The payment is simply the principal divided by the number of months — the formula handles this special case.

Related tools