Why "Convert My Units" Bugs Are So Common in Software
A real spacecraft was lost over a units mismatch. The same category of bug still ships in ordinary software today, and it's almost always avoidable the same way.
Published March 22, 2026
In 1999, NASA's Mars Climate Orbiter burned up in the Martian atmosphere because one team's software calculated thruster force in pound-force seconds while the navigation software on the receiving end expected newton-seconds. Nobody miscalculated the math; the numbers were correct in their own units. The bug was that two systems disagreed about which units a plain number represented, and nothing caught the mismatch before it mattered.
The same bug, much lower stakes, ships constantly
A form field labeled "weight" with no unit shown. An API that returns a distance as a bare number, leaving the caller to guess meters or feet from the documentation, or worse, from a stack overflow post. A spreadsheet column of "size" that mixes MB and GB because someone pasted in numbers from two different sources. None of these are dramatic on their own, but they're the same underlying failure as the Mars Climate Orbiter: a number without an explicit, enforced unit is a bug waiting for the day someone assumes the wrong one.
Why this keeps happening
Units are cheap to drop and expensive to add back. It's faster to store a plain number than a number-plus-unit pair, so a lot of code takes the shortcut early on, when it seems harmless. The cost shows up later, when that value moves between systems, gets read by someone else's code, or gets displayed to a user who has no idea whether "200" means grams or ounces.
What actually prevents it
Label the unit everywhere the value is stored, displayed, or passed between systems, not just in documentation that nobody re-reads before writing new code against it. When converting between systems that might use different units by convention (metric vs. imperial, decimal vs. binary storage units, bits vs. bytes), convert explicitly at the boundary and be loud about it in the code, a named function like poundsToKilograms(), not a bare multiplication buried inline where a future reader can't tell what it's converting from or to.