Build a Loan and Mortgage Calculator with Amortization Table in One HTML File

Get a polished, offline loan and mortgage calculator that shows monthly payment, total interest, an SVG balance chart, extra-payment savings and a full amortization schedule.

You getone complete HTML file in a single code block, then 3 short ideas to extend it.

The prompt

Prompt
You are a senior front-end developer who builds polished, dependable personal finance tools. Build Keystone Loan Planner, a loan and mortgage payment calculator, as one self-contained HTML file. The user sets loan amount, annual interest rate, term in years and an optional extra monthly payment. The page instantly shows the monthly payment, total interest, payoff time, interest saved and a full amortization schedule.

Rules:
1. Pair each input with a labeled number field and a range slider that stay in sync. Add quick-pick buttons for a 30-year mortgage, a 15-year mortgage, a car loan and a student loan. Do not use a form element.
2. Use the standard amortization formula with monthly compounding and handle a 0% rate. Apply extra payments straight to principal and end the schedule early when the balance reaches zero.
3. Draw an inline SVG chart of remaining balance over time, with labeled axes. Show the standard schedule as a dashed amber line and the with-extra schedule as a solid teal line with a soft fill. Hovering, tapping, or using the arrow keys on the focused chart shows both balances for that month.
4. Show the schedule in a scrollable table with a sticky header and a Yearly / Monthly toggle.
5. Use a calm palette: warm off-white background, navy text, teal and amber accents, system fonts and tabular numbers. Use a two-column layout that stacks below 840px.
6. Do not use external libraries, fonts, network calls, storage or alerts. Use transitions only when prefers-reduced-motion allows them.

Output format: one complete HTML file in a single code block, then 3 short ideas to extend it.

Example output

One HTML file. Save it and open it in any browser.Open full screen

Example: Keystone Loan Planner, a mortgage and loan calculator with an extra-payment chart.

Drag the sliders or type exact values for amount, rate, term and extra monthly payment. Four tiles update live: payment, total interest, payoff time and interest saved. Hover or tap the balance chart, or focus it and use the arrow keys, to compare the standard and accelerated payoff month by month. Try the quick picks, then switch the schedule between Yearly and Monthly.

Written by AI from this prompt. Your results will vary.

Tips and common edits

Why this works

  • Naming the exact formula, the 0% edge case and the early-payoff rule makes the math right on the first try.
  • Synced sliders and number fields with a stacking layout give a tool that works on phones, mouse and keyboard.
  • Spelling out the chart's colors, line styles and inspection controls produces a clear, readable SVG instead of a generic plot.

Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as keystone-loan.html and open it in any browser, or view it in the chat's preview or canvas panel. It needs no internet.

Common edits

  • Switch the currency to EUR or GBP, or add a start-date field so the table shows real calendar months.
  • Add one-time lump-sum payments or a biweekly payment option to compare against the extra monthly payment.

Prompt details

By
Prompts-GPT editors
Published

Did this prompt work?

Keep exploring

More in Mini Apps & Tools