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

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

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

Example: Measurely, a two-way converter for the kitchen and everyday life.

Pick a tab (Length, Weight, Temperature, Volume, Cooking) and type in either box; the other side updates instantly. In Cooking, choose an ingredient and convert 1 cup of flour to grams or 100 g sugar to cups. Try typing 1 1/2, hit the ⇄ swap button, or tap a quick-reference chip. Keys 1–5 switch tabs and S swaps.

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

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 in Mini Apps & Tools