How to Convert Units
A practical guide to unit conversion — understand the metric and imperial systems, common conversion factors, and how to convert length, weight, temperature, and volume accurately.
Metric vs imperial systems
The metric system (SI) uses base units of metres, kilograms, litres, and Celsius. It scales by powers of ten — a kilometre is exactly 1,000 metres. The imperial system uses feet, pounds, gallons, and Fahrenheit with less regular conversion factors. The US uses a variant of imperial (US customary), which differs from the UK system for volume. Most of the world uses metric; the US, Myanmar, and Liberia are the main exceptions.
Length conversions
The kilometre–mile and metre–foot conversions are the most common. One inch is exactly 25.4 millimetres by international definition, which anchors the entire imperial length system to metric.
1 inch = 25.4 mm exactly
1 foot = 0.3048 m exactly (12 inches)
1 yard = 0.9144 m exactly (3 feet)
1 mile = 1.609344 km exactly (5,280 feet)
1 cm = 0.3937 inches
1 metre = 3.2808 feet = 1.0936 yards
1 kilometre = 0.6214 miles
# Quick mental approximations
# km → miles: multiply by 0.6 (or divide by 1.6)
# miles → km: multiply by 1.6
# metres → feet: multiply by 3.3Weight and mass conversions
The kilogram–pound conversion is the most common. Note that 'weight' in everyday use usually means mass — the stone unit is used in the UK for body weight but rarely elsewhere.
1 ounce (oz) = 28.3495 g
1 pound (lb) = 453.592 g = 16 oz
1 stone (st) = 6.35029 kg = 14 lb (UK body weight)
1 ton (US) = 907.185 kg = 2,000 lb (short ton)
1 tonne (metric)= 1,000 kg = 2,204.6 lb
1 gram = 0.03527 oz
1 kilogram = 2.20462 lb
# Quick mental approximation
# kg → lb: multiply by 2.2
# lb → kg: divide by 2.2Temperature conversions
Temperature is the most common conversion people get wrong because it involves an offset, not just multiplication. Celsius and Fahrenheit share the same scale step size (1°C = 1.8°F), but their zeros are different.
# Celsius → Fahrenheit
F = (C × 9/5) + 32
# Fahrenheit → Celsius
C = (F − 32) × 5/9
# Celsius → Kelvin
K = C + 273.15
# Key reference points
0°C = 32°F (water freezes)
20°C = 68°F (comfortable room temperature)
37°C = 98.6°F (human body temperature)
100°C = 212°F (water boils at sea level)
# Quick mental trick for °C → °F
# Double the Celsius, subtract 10%, then add 32
# 20°C → 40 − 4 + 32 = 68°F ✓Volume conversions
Volume conversions are tricky because the US and UK use different definitions for gallons, pints, and fluid ounces. The metric litre is unambiguous.
# Metric
1 litre (L) = 1,000 mL = 1,000 cm³
1 millilitre = 1 cm³
# US customary
1 US fluid oz = 29.5735 mL
1 US cup = 236.588 mL = 8 US fl oz
1 US pint = 473.176 mL = 2 cups
1 US quart = 946.353 mL = 2 pints
1 US gallon = 3.78541 L = 4 quarts
# UK (Imperial)
1 UK fl oz = 28.4131 mL
1 UK pint = 568.261 mL (≠ US pint)
1 UK gallon = 4.54609 L (≠ US gallon)
# Quick approximations
# litres → US gallons: divide by 3.8
# US gallons → litres: multiply by 3.8Why is the US gallon different from the UK gallon?
The US retained the old English wine gallon (231 cubic inches, ~3.785 L) when it standardised its measurements. The UK later redefined its gallon to exactly 10 pounds of water at a specific temperature (~4.546 L). They diverged in the 19th century and have never been reconciled.
Is a metric ton the same as a regular ton?
No. A metric tonne is exactly 1,000 kg (~2,205 lb). A US short ton is 2,000 lb (~907 kg). A UK long ton is 2,240 lb (~1,016 kg). Always specify which you mean in international contexts.
What is the difference between mass and weight?
Mass is an intrinsic property of matter (kilograms, pounds). Weight is the gravitational force acting on a mass (newtons). In everyday use they are treated as interchangeable, but on the Moon your mass is the same and your weight is about 1/6 of what it is on Earth.
Cron Expression Examples
A reference guide to cron syntax with common schedule patterns — from every minute to complex multi-field expressions — with plain-English explanations.
Read guide →How chmod and File Permissions Work
A practical guide to Unix file permissions — reading the permission string, understanding octal notation, using chmod and chown, and common secure permission patterns.
Read guide →How to Read HTTP Headers
A practical guide to HTTP headers — request vs response headers, what the most important ones mean, how to inspect them in the browser and curl, and security headers you should be setting.
Read guide →