Build an Instant Two-Way Unit Converter With Kitchen Measurements in HTML
A prompt that produces a single-file unit converter for length, weight, temperature, volume and cooking that updates both directions as you type, including cups-to-grams by ingredient.
You getone complete HTML file in a single code block, then 3 short ideas to extend it.
The prompt
Act as a senior front-end developer and product designer who builds polished, dependable small tools.
Build Measurely, an everyday unit converter in one HTML file with a warm kitchen-notebook feel. It has five categories as tabs: Length, Weight, Temperature, Volume and Cooking. Each category shows two value boxes side by side, each with its own unit dropdown. Typing in either box updates the other instantly, so conversion works in both directions with no convert button.
Rules:
1. Cooking includes cups, tablespoons, teaspoons, milliliters, fluid ounces, grams and ounces, plus an ingredient picker (water, flour, sugar, brown sugar, butter, honey, milk, oil, oats, rice) that uses typical densities for volume-to-weight conversions.
2. Accept decimals, commas and fractions such as 1/2 or 1 1/2. Show a friendly hint like about 3/4 cup for spoon and cup results, and a gentle message for invalid input.
3. Add a swap button, a line showing the formula or 1-unit ratio, and clickable quick-reference chips per category.
4. Keyboard: tabs work with arrow keys, keys 1 to 5 switch categories and S swaps when not typing; everything is touch friendly.
5. Cream background, deep ink text, one teal accent, system fonts, large tabular numbers, stacked layout under 640px, and no animation when reduced motion is preferred.
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 every category, unit and ingredient up front means the model never guesses scope or invents odd units.
- Converting through one base unit per category keeps both directions consistent and avoids rounding drift.
- Explicit input rules (fractions, commas, invalid text) make the tool feel robust on the first try.
Paste into ChatGPT, Claude or Gemini. Save the returned code as measurely.html and open it in any browser, or run it in the chat's canvas or preview pane. No installs or internet needed.
Common edits
- Add more ingredients or units, e.g. stones, nautical miles or UK cups, by listing them in rule 1.
- Swap the palette or add a currency-free 'recent conversions' list kept in memory for the session.
Prompt details
- By
- Prompts-GPT editors
- Published
Did this prompt work?
Keep exploring
More like this
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 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 Pomodoro Focus Timer With SVG Progress Ring in One HTML File
A ready-to-paste prompt that builds a Pomodoro timer with focus, short and long break cycles, an SVG progress ring, a soft synthesized chime, keyboard shortcuts and a session counter.
Build a Random Team Picker That Splits Names Into Fair Groups in One HTML File
You get a single-file team picker: paste names, choose a team count or team size, watch an animated shuffle deal everyone into evenly sized teams, then reshuffle with one key.
Build a Restaurant Tip and Bill Splitter With Uneven Shares in One HTML File
A ready-to-paste prompt that builds a bill splitter where diners pay for what they ordered, tax and tip are shared fairly, totals round neatly, and every cent adds up.
Build a Strong Password Generator with Strength Meter in One HTML File
You get a single HTML file that makes cryptographically random passwords, with toggles for character sets, an entropy-based strength meter and one-click copy.