Unit Converter: Temperature Breaks the Pattern Every Other Category Follows
Five categories, one live two-way conversion engine, and the one category (temperature) that can't just be a simple multiplier.
Five categories — length, mass, temperature, volume, digital data — and the instant temptation with a tool like this is to keep adding categories until it covers everything anyone could ever want to convert. I resisted that on purpose. These five cover the overwhelming majority of real, everyday conversion needs: a recipe in the wrong units, a file size, a weather report's temperature, a distance from a foreign source. A converter that tries to be encyclopedic ends up with a long, unwieldy category dropdown that makes the common case slower to reach.
Temperature isn't like the other four categories
Length, mass, volume, and data all convert through simple multiplication — a fixed ratio between any two units in that category. Temperature is the one category where that breaks down completely, because Celsius, Fahrenheit, and Kelvin don't share a common zero point. Converting between them means an actual formula with an offset, not just a multiplier, and building the conversion engine generically across all five categories meant explicitly handling temperature as its own special case rather than assuming every category could share one simple ratio-based conversion function. Getting this wrong wouldn't throw an error — it would just silently produce a plausible-looking but incorrect temperature, which is a much worse failure mode than a visible crash.
Two-way live conversion changes how the interface has to behave
Typing into either side updates the other side instantly, and building that bidirectionally rather than as a one-way "input then convert" interaction meant being careful about where a user's typing focus stays while the other field updates underneath them. If updating the target field steals keyboard focus or resets cursor position in the field someone's actively typing into, the whole interaction feels broken even though the math is correct. That's a UI-plumbing problem more than a conversion-math problem, and it's the kind of thing that only shows up when you actually type a multi-digit number slowly rather than pasting a complete value in at once.
Choosing which units make the cut per category
Every category could technically support far more units than it does — length alone has nautical miles, furlongs, and a dozen other units I left out entirely. I picked the units people actually convert between in practice: metric and imperial pairs for length and mass, the three real temperature scales, common volume units for cooking and fuel, and bytes through terabytes for data. Adding an obscure unit costs almost nothing in code, but it costs real interface clarity in the dropdown, and a converter's job is to get someone to their answer fast, not to be a comprehensive reference for every unit that's ever existed.
The copy button had to copy the number, not the display
There's a subtle trap in a tool that rounds a displayed value for readability: if the copy button grabs the rounded, display-friendly string instead of the actual full-precision result, someone pasting that value into a spreadsheet or another calculation is now working with a slightly wrong number without realizing it, because it looked complete on screen. I made sure copy always grabs a sensibly precise value rather than the possibly-truncated display string, so what a visitor pastes elsewhere matches what the conversion actually computed, not just what fit cleanly in the result box.
Precision and rounding needed their own consistent rule
Converting between units introduces the same kind of floating-point imprecision that showed up in the site's calculator — a clean value in one unit rarely converts to an equally clean value in another, since most conversion ratios aren't round numbers to begin with. Miles to kilometers, for instance, involves a ratio with a long decimal tail, and displaying it at full unrounded precision produces an ugly, unreadable number that implies far more accuracy than a casual conversion actually needs. I settled on a consistent rounding precision across every category rather than tuning it per unit, since an inconsistent rounding rule — clean numbers in one category, an obviously truncated mess in another — would read as an oversight rather than a deliberate choice, even if a per-category tune would technically be more "correct" for each individual case.
What I'd reconsider if data units grow more complex
Digital data is the one category with a genuine ambiguity I sidestepped rather than solved: whether a kilobyte means 1,000 bytes or 1,024. Both conventions are legitimately in use depending on context — storage manufacturers use the decimal version, operating systems often report the binary one — and a strict tool would expose both explicitly rather than picking one silently. I picked one convention and moved on for this first version, which is a defensible shortcut for now but one I'm not fully comfortable with long-term, since it means a result here could technically disagree with what a user's own operating system reports for the same file. It's a small enough gap that I don't think it's actively misleading anyone yet, but it's exactly the kind of quiet inconsistency I'd rather fix proactively than wait for someone to notice their file manager and this tool disagree by a few percent on the same number.
What I like about this tool, looking back at it now that it's done, is how little of the actual work was about the conversion math itself. Multiplying by a ratio is not hard. The real work was in the dozens of small decisions around it — which units to include, how to round consistently, how to keep bidirectional typing from fighting the user's own cursor — that never show up in a feature list but are the entire difference between a tool that feels trustworthy and one that technically works but feels slightly off every time you use it. None of that shows up in a screenshot, and all of it shows up the first time someone actually relies on the number it gives them, and that's exactly the moment a converter either earns trust or loses it for good, with nothing in between.