Unit Conversion, From First Principles

After reading this you will know how a unit converter turns one number into every equivalent, why temperature is the odd one out, and how to avoid the small factor errors that ruin an answer.

A unit converter answers one question: if a quantity measures 1 in this unit, what does it measure in that unit? The tool does it for a whole family at once. Type a length and you see millimetres, feet, miles and nautical miles side by side. That breadth is convenient, but it hides some real physics and a few traps. This article shows the math so you can trust the numbers and catch mistakes.

Here is a hook. A car maker quotes 150 horsepower. Is that mechanical horsepower or metric PS? The two differ by about 1.4 percent, so the honest figure sits between 150 hp = 111.9 kW and 150 PS = 110.3 kW. That gap is small until a contract or a spec sheet depends on it.

What the tool does and when to use it

Pick a quantity, type a value, choose the unit that value is in, and read the full table of equivalents. Use it for everyday conversions where you want to see several targets at once: recipe volumes, tyre pressures, energy on a food label, download sizes.

Two cases need a different tool. Fuel economy does not convert linearly, because miles per gallon is a reciprocal of litres per 100 km. Use the Fuel Economy Converter for that. Cooking amounts that cross between volume and weight depend on the ingredient, because a cup of flour and a cup of honey weigh different amounts. Use the Cooking Measurement Converter, which carries per-ingredient densities.

Everything here except temperature is a ratio conversion. That is why the tool can show all units together: it stores one factor per unit relative to a base unit, then divides. Temperature needs an offset as well as a factor, so it follows different rules.

The formula behind ratio units

For length, mass, pressure, energy, power, speed, area, volume and data, each unit is defined as a fixed number of base units. Length uses the metre. A foot is 0.3048 m exactly. A mile is 1609.344 m. To convert, put the input into base units, then divide by the target factor.

v_{\text{out}} = v_{\text{in}} \cdot \frac{f_{\text{in}}}{f_{\text{out}}}

Here v_{\text{in}} is your value, f_{\text{in}} is how many base units one input unit equals, and f_{\text{out}} is the same for the target unit. The base unit cancels, so 5 ft in yards is 5 \cdot 0.3048 / 0.9144 = 1.667 yards.

The exact definitions matter. The inch is 25.4 mm by definition, and the international pound is 453.59237 g by definition. Those are not measured, they are agreed. Reference values like the standard atmosphere (101325 Pa) or mmHg are also fixed by convention, so the tool treats them as exact for arithmetic even though real air pressure varies.

Why temperature is different

Celsius and Fahrenheit do not start at the same zero, and their degrees are different sizes. So you cannot use a single multiply. You need a scale factor and a shift.

T_{\text{F}} = T_{\text{C}} \cdot \frac{9}{5} + 32

T_{\text{C}} is Celsius and T_{\text{F}} is Fahrenheit. The factor 9/5 stretches the degree size; the +32 moves the zero. Kelvin shares the Celsius degree size but shifts the zero to absolute zero: T_{\text{K}} = T_{\text{C}} + 273.15.

A temperature reading and a temperature difference convert differently. A rise of 10 °C equals a rise of 18 °F (multiply by 9/5, no offset), not 50 °F. This tool converts readings. If you are converting a difference, drop the +32 and the +273.15.

A worked length conversion

The demo uses the defaults: quantity length, value 1, unit metres.

Convert 1 metre to every length unit

Each factor below is metres per unit. Divide 1 m by the factor to get the count.

  1. Millimetres: 1 / 0.001 = 1000 mm.
  2. Centimetres: 1 / 0.01 = 100 cm.
  3. Kilometres: 1 / 1000 = 0.001 km.
  4. Inches: 1 / 0.0254 = 39.37 in.
  5. Feet: 1 / 0.3048 = 3.281 ft.
  6. Yards: 1 / 0.9144 = 1.094 yd.
  7. Miles: 1 / 1609.344 = 0.0006214 mi.
  8. Nautical miles: 1 / 1852 = 0.00054 nmi.

Sanity check: a metre is a bit longer than a yard, and indeed 1.094 > 1. It is close to 3.28 feet, which matches the rough rule that a metre is about three and a quarter feet.

One metre expressed in each length unit
UnitValueMetres per unit
mm10000.001
cm1000.01
in39.370.0254
ft3.2810.3048
yd1.0940.9144
mi0.00062141609
nmi0.000541852

Watching the offset in temperature

Ratio units all pass through a single point: zero maps to zero. Temperature does not, and the widget below shows why the two lines cross rather than fanning out from the origin.

The Celsius to Fahrenheit line has slope 9/5 and intercept 32. At -40 °C it reads -40 °F, the one temperature where the two scales agree. At 0 °C it reads 32 °F; at 100 °C it reads 212 °F.

The line crosses the diagonal only at -40. Body temperature 37 °C reads 98.6 °F.

Reading the results, and rounding

The tool shows more digits than most jobs need. Match the precision to your input. If you measured a room as 4.2 m, reporting 13.77953 ft is false precision; 13.8 ft carries the same three significant figures you started with.

Watch for tiny non-zero results that are really rounding noise. Convert 1 m to miles and you get 0.0006214. That is genuine, not an error. But if you convert and then convert back and land on 0.9999998, that is floating point, and the true answer is 1.

Data units: decimal versus binary

Storage marketing uses powers of ten; operating systems often use powers of two. A kilobyte (kB) is 1000 bytes. A kibibyte (KiB) is 1024 bytes. The gap grows with size.

Decimal versus binary multiples, bytes each
PrefixDecimalBinaryBinary/decimal
kilo100010241.024
mega1e610485761.049
giga1e910737418241.074
tera1e1210995116277761.100

This is why a drive sold as 1 TB shows up as about 0.909 TiB in some systems: 10^{12} / 2^{40} = 0.9095. No storage was lost; the two labels count differently.

Common mistakes

Mixing US and UK volumes. A US gallon is 3.785 L; a UK (imperial) gallon is 4.546 L. That is a 20 percent difference. The tool lists galuk separately for this reason. US cups, pints and fluid ounces are also smaller than their imperial cousins.

Confusing calories. The food "Calorie" on a label is a kilocalorie: 1 kcal = 1000 cal = 4184 J. A single scientific calorie is 4.184 J. A 200 Calorie snack is 200 kcal = 837 kJ, not 837 J.

Confusing power and energy. A watt is a rate; a watt-hour is an amount. Running 2 kW for 3 hours uses 6 kWh. The tool converts within each family, not across them, because that step needs a time.

When a result looks wrong by a clean factor like 2, 10 or 1000, suspect a prefix or a US/UK slip before you suspect the tool. Those errors leave round fingerprints.

Related tools

For sound levels and signal ratios, which are logarithmic rather than linear, use the Decibel (dB) Converter. Doubling a power is always +3.01 dB there, which is a different kind of conversion from the ratios on this page.

Frequently asked questions

Why is mechanical horsepower different from PS?

They were defined in different unit systems. Mechanical horsepower is 745.7 W; metric PS is 735.5 W. So 100 hp = 74.57 kW but 100 PS = 73.55 kW, a 1.4 percent gap.

Is a nautical mile the same as a mile?

No. A statute mile is 1609.344 m; a nautical mile is 1852 m, defined as one minute of latitude. A nautical mile is about 15 percent longer.

How exact are the conversions?

Where a unit is defined exactly, the factor is exact: inch = 25.4 mm, pound = 453.59237 g. Reference values like the atmosphere and mmHg are fixed by standard, so arithmetic treats them as exact. The display then rounds.

Can I convert a temperature difference?

Not directly here. This tool converts readings, which include the offset. For a difference, multiply by 9/5 to go Celsius to Fahrenheit, or by 1 to go Celsius to kelvin, and skip the offset.

Why does my 1 TB drive show less capacity?

The label uses decimal terabytes (10^{12} bytes) while some systems report binary tebibytes (2^{40} bytes). The ratio is 0.9095, so 1 TB reads as roughly 0.909 TiB.