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
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
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 like this
Build a BMI and Daily Calorie Calculator with Metric and Imperial Units in HTML
A prompt that makes an AI build Steady Scale, a single-file BMI and calorie calculator using Mifflin-St Jeor, activity levels, unit switching and plain-language ranges.
Build a Countdown Timer to Any Date With a Confetti Finish in One HTML File
Get a polished single-file countdown page with a custom event title, a large days-hours-minutes-seconds display and a confetti-and-chime celebration at zero.
Build a HIIT and Tabata Interval Workout Timer in a Single HTML File
A self-contained interval timer with adjustable work, rest and rounds, color-coded phases, synthesized countdown beeps and a tap-anywhere pause, all in one HTML file.
Build a Keyboard-Friendly To-Do Checklist with Priorities and Filters in One HTML File
A ready-to-paste prompt that makes an AI build a single-file to-do checklist where you can add, reorder, prioritize, filter and export tasks as plain text, all with keyboard shortcuts.
Build a Live Word and Character Counter with Reading Time in One HTML File
A single-file text counter showing live words, characters, sentences, paragraphs, reading and speaking time, and color-coded progress bars for common post length limits.
Build a Percentage Calculator for Discounts, Increases and Percent Change
A single HTML file that answers the four common percentage questions side by side, with live results and the worked formula shown under each answer.