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.
You getone complete HTML file in a single code block, then 3 short ideas to extend it.
The prompt
Act as a front-end developer who builds clean, trustworthy health utilities.
Build Steady Scale, a BMI and daily calorie needs calculator, as one self-contained HTML file with inline CSS and JavaScript. Use no external resources, storage, forms or alerts.
Inputs: a Metric/Imperial toggle (cm and kg, or feet, inches and pounds), the sex used by the formula, age, height, weight, and five activity levels from sedentary (1.2) to extra active (1.9). Give each activity level a one-line description.
Rules:
1. Results update live as the user types. Switching units converts the current values instead of clearing them.
2. Show BMI to one decimal with a color-banded bar from 15 to 40 and a moving marker. Use neutral, non-medical labels: below, within, above, and well above the usual range. Also show the healthy-weight range for the user's height in the chosen units.
3. Use Mifflin-St Jeor for resting energy, then multiply by the activity factor for maintenance. List gentle loss, steady loss, maintain and gentle gain targets, rounded to 10 kcal. Flag any target below the resting estimate.
4. Validate ages 18-90 and sensible height and weight ranges, and show a friendly inline message when an entry is out of range.
5. Layout: two-column cards above 820px wide, stacked below. Use a warm off-white background and one teal accent. Include labeled inputs, visible focus rings and aria-live results, and avoid big motion under prefers-reduced-motion.
6. End with a short plain-language legend and a clear note that this is educational, not medical advice.
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, activity factors and rounding rules gives every model the same math, so the numbers come out consistent.
- Requiring live updates and unit conversion on toggle avoids the usual submit button and form-reset bugs.
- Neutral range labels plus a fixed disclaimer keep the tool helpful without sounding like a diagnosis.
Paste the prompt into ChatGPT, Claude or Gemini. Save the returned code as steady-scale.html and open it in any browser, or view it in the chat's preview or canvas panel.
Common edits
- Change the accent color, app name or goal deficits (for example ±300 kcal) by editing the matching line in the prompt.
- Ask for a macro split (protein, carbs, fat) under the maintenance figure, or a printable summary card.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
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 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.
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.