# Loan Comparison Calculator

> Compares two fixed-rate, fully amortizing loan offers for the same amount: the level monthly payment, total interest, up-front fees and total cost (interest + fees) of each, and which offer costs less over its full term.

- Calculator id: `loan-comparison` · Category: Finance (`finance`) · Tool name: `compare_loans`
- Canonical page: https://tttkmbb.com/finance/loan-comparison · This document: https://tttkmbb.com/finance/loan-comparison.md · JSON definition: https://tttkmbb.com/finance/loan-comparison.json

## Purpose

Compares two fixed-rate, fully amortizing loan offers for the same amount: the level monthly payment, total interest, up-front fees and total cost (interest + fees) of each, and which offer costs less over its full term.

**Use when:** You have two loan or mortgage quotes with different rates, terms or fees for the same amount and want the payments and lifetime costs side by side.

**Do not use when:** You are replacing an existing loan (use refinance-break-even), only need one loan's payment (use loan-payment), or will sell or repay early (this compares full-term costs and ignores the time value of money). Informational; not financial advice.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `loan_amount` | number |  | required | Amount borrowed under both offers. (> 0, max 1000000000000) |
| `rate_a_percent` | number | % | required | Annual nominal rate of loan A in percent; the monthly rate is this / 12. (min 0, max 100) |
| `term_a_years` | number | years | required | Term of loan A in years (fractions allowed; rounded to whole months). (> 0, max 100) |
| `fees_a` | number |  | optional, default 0 | Up-front fees of loan A (origination, points, closing costs), paid separately rather than financed. (min 0, max 1000000000) |
| `rate_b_percent` | number | % | required | Annual nominal rate of loan B in percent. (min 0, max 100) |
| `term_b_years` | number | years | required | Term of loan B in years. (> 0, max 100) |
| `fees_b` | number |  | optional, default 0 | Up-front fees of loan B. (min 0, max 1000000000) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `payment_a` | number |  | Level monthly payment of loan A (annuity formula). |
| `payment_b` | number |  | Level monthly payment of loan B. |
| `total_interest_a` | number |  | payment_a × months_a − loan_amount. |
| `total_interest_b` | number |  | payment_b × months_b − loan_amount. |
| `total_cost_a` | number |  | total_interest_a + fees_a: what loan A costs beyond repaying the principal. |
| `total_cost_b` | number |  | total_interest_b + fees_b. |
| `cheaper_loan` | string |  | "A", "B" or "equal" by total cost (interest + fees), compared to the cent. |
| `monthly_payment_difference` | number |  | payment_a − payment_b (positive = loan A has the higher monthly payment). |
| `total_cost_difference` | number |  | total_cost_a − total_cost_b (positive = loan A costs more over its full term). |
| `comparison` | list |  | Two rows: loan, rate_percent, term_years, monthly_payment, total_interest, fees, total_cost. |
| `summary` | string |  | Plain-language comparison of payment and lifetime cost. |

## Formula

`For each loan: i = rate/1200, n = 12 × term_years, payment = loan_amount × i / (1 − (1 + i)^−n) (loan_amount / n if i = 0); total_interest = payment × n − loan_amount; total_cost = total_interest + fees. cheaper_loan = the loan with the lower total_cost; monthly_payment_difference = payment_a − payment_b; total_cost_difference = total_cost_a − total_cost_b`

Standard monthly amortization with end-of-month payments, both loans held to maturity, fees paid up front and not financed. A shorter term raises the payment but lowers lifetime interest; the comparison does not discount future payments, so it favours shorter terms when cash flow is not a constraint.

## Data Sources

- Wikipedia – Amortization calculator (annuity payment formula) — https://en.wikipedia.org/wiki/Amortization_calculator (reference, retrieved 2026-09-24)
- CFPB – How do mortgage lenders calculate monthly payments? — https://www.consumerfinance.gov/ask-cfpb/how-do-mortgage-lenders-calculate-monthly-payments-en-1965/ (government, retrieved 2026-09-24)
- CFPB – Owning a Home: compare loan offers — https://www.consumerfinance.gov/owning-a-home/ (government, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/loan-comparison?loan_amount=…&rate_a_percent=…&term_a_years=…&rate_b_percent=…&term_b_years=…`
- `POST https://tttkmbb.com/api/v1/calculate/loan-comparison` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/loan-comparison · OpenAPI operationId `compare_loans` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "loan-comparison", "inputs": {…}}`

## Example

- 300,000: A 6 % for 30 years with 3,000 fees vs B 5.5 % for 15 years with 5,000 fees: inputs `{"loan_amount":300000,"rate_a_percent":6,"term_a_years":30,"fees_a":3000,"rate_b_percent":5.5,"term_b_years":15,"fees_b":5000}` → `{"payment_a":1798.65,"payment_b":2451.25,"total_interest_a":347514.57,"total_interest_b":141225.07,"total_cost_a":350514.57,"total_cost_b":146225.07,"cheaper_loan":"B","monthly_payment_difference":-652.6,"total_cost_difference":204289.5}`
- 25,000 auto loan: A 7 % for 5 years, no fees vs B 6 % for 6 years with 500 fees: inputs `{"loan_amount":25000,"rate_a_percent":7,"term_a_years":5,"rate_b_percent":6,"term_b_years":6,"fees_b":500}` → `{"payment_a":495.03,"payment_b":414.32,"total_interest_a":4701.8,"total_interest_b":4831.2,"total_cost_a":4701.8,"total_cost_b":5331.2,"cheaper_loan":"A","monthly_payment_difference":80.71,"total_cost_difference":-629.4}`

```
GET https://tttkmbb.com/api/v1/calculate/loan-comparison?loan_amount=300000&rate_a_percent=6&term_a_years=30&fees_a=3000&rate_b_percent=5.5&term_b_years=15&fees_b=5000
```

## Limitations

You are replacing an existing loan (use refinance-break-even), only need one loan's payment (use loan-payment), or will sell or repay early (this compares full-term costs and ignores the time value of money). Informational; not financial advice. Standard monthly amortization with end-of-month payments, both loans held to maturity, fees paid up front and not financed. A shorter term raises the payment but lowers lifetime interest; the comparison does not discount future payments, so it favours shorter terms when cash flow is not a constraint. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is the loan with the higher payment the cheaper one?**

Total cost counts interest over the whole term: a 15-year loan repays principal faster, so interest accrues on a smaller balance for fewer months, even though each payment is larger.

**How do fees enter the comparison?**

They are added to total interest to form total_cost and are assumed paid in cash at closing. To model financed fees, add them to loan_amount for that offer and run loan-payment separately.

**Should I compare APRs instead?**

An APR folds fees into a single rate over the full term and is useful for offers with the same term; for different terms the total-cost view here shows the trade-off between payment size and lifetime interest directly.

## Related

- [Loan Payment Calculator](https://tttkmbb.com/finance/loan-payment.md) — Payment and totals of a single loan.
- [Refinance Break-Even Calculator](https://tttkmbb.com/finance/refinance-break-even.md) — Compare a new loan against the remaining term of an existing one.
- [Amortization Schedule Calculator](https://tttkmbb.com/finance/amortization-schedule.md) — Year-by-year balance of either offer.
