Unit Conversion Mastery: Length, Mass, Temperature, Time Zones (2026)

A unit conversion is never just a number times a number. It is a number with a unit, multiplied by an exact ratio defined by international agreement, with the precision rules of a measurement system and the floating-point rules of a machine. This guide walks the SI base units, the derived units, the metric prefix ladder from tera to femto, the exact imperial-to-metric factors, time zones and DST, and the developer gotchas that have actually lost spacecraft. The companion health and money calculators guide covers the everyday-math angle; here we go deep on the science and the code.

NoCostTools Editorial Team· Updated October 22, 2026· 26 min read
Unit conversion reference card showing SI base units, the metric prefix ladder, and an imperial-to-metric conversion table

The Seven SI Base Units

Every measurement in the International System of Units (SI) reduces to seven base units. Six of them were redefined in 2019 to anchor on physical constants instead of physical artifacts, which means the definitions no longer drift when an instrument wears out. The seventh, the second, has been constant-defined since 1967.

QuantityUnitSymbolDefining constant (post-2019)
LengthmetremSpeed of light in vacuum c = 299,792,458 m/s exactly
MasskilogramkgPlanck constant h = 6.62607015 × 10⁻³⁴ J·s exactly
TimesecondsCs-133 hyperfine frequency ΔνCs = 9,192,631,770 Hz exactly
Electric currentampereAElementary charge e = 1.602176634 × 10⁻¹⁹ C exactly
Thermodynamic temperaturekelvinKBoltzmann constant k = 1.380649 × 10⁻²³ J/K exactly
Amount of substancemolemolAvogadro number NA = 6.02214076 × 10²³ /mol exactly
Luminous intensitycandelacdLuminous efficacy of 540 THz green light Kcd = 683 lm/W exactly

Two details trip up developers. First, the kilogram is the only base unit with a prefix baked into its name; the gram is technically a derived unit equal to 10⁻³ kg. Code that takes "grams" as the base unit and multiplies by 1000 to "convert to kilograms" is fine, but it is converting a derived unit to a base unit, not the other way around. Second, the degree Celsius is not a base unit — it is a special name for the kelvin used to express Celsius temperatures, with the offset 0 °C = 273.15 K. We unpack that fully in the temperature section below.

If you only need to convert between the units above and their common siblings, the unit converter on this site uses these exact definitions, and the broader unit converter tools guide walks through how each category of converter is built.

Derived and Supplementary Units

Every other SI unit is built from the seven base units. Some have special names that hide the underlying composition, and most of those names are also the units you see in everyday engineering: hertz, newton, pascal, joule, watt, coulomb, volt, farad, ohm.

UnitSymbolQuantityIn base units
hertzHzfrequencys⁻¹
newtonNforcekg·m·s⁻²
pascalPapressurekg·m⁻¹·s⁻²
jouleJenergykg·m²·s⁻²
wattWpowerkg·m²·s⁻³
coulombCelectric chargeA·s
voltVelectric potentialkg·m²·s⁻³·A⁻¹
faradFcapacitancekg⁻¹·m⁻²·s⁴·A²
ohmΩelectric resistancekg·m²·s⁻³·A⁻²
siemensSelectric conductancekg⁻¹·m⁻²·s³·A²
weberWbmagnetic fluxkg·m²·s⁻²·A⁻¹
teslaTmagnetic flux densitykg·s⁻²·A⁻¹
henryHinductancekg·m²·s⁻²·A⁻²

The radian and steradian used to be a separate class called supplementary units; since 1995 they are classified as dimensionless derived units (1 rad = 1 m/m, 1 sr = 1 m²/m²). The practical effect for code is that angles in radians are unitless numbers, so functions like sin(x) expect radians even when your spec calls for degrees — a famous source of off-by-57.3 bugs.

Working through these by hand is the best way to verify dimensional analysis, but for shipping features the unit converter tools guide catalogs which converters exist, what they accept, and where the precision comes from.

The Metric Prefix Ladder: Tera to Femto

The metric prefix ladder is the cleanest part of SI: every step is a power of ten. Once you learn the ladder, you can convert 4.7 THz to 4.7 × 10¹² Hz or 12 fm to 12 × 10⁻¹⁵ m in your head, because the prefix is just a label for the exponent.

PrefixSymbolFactorPower of 10Typical use
teraT1,000,000,000,00010¹²Terahertz spectroscopy, TB disk sizes (SI)
gigaG1,000,000,00010⁹GHz CPUs, gigabyte network
megaM1,000,00010⁶MHz, megapixel
kilok1,00010³km, kg, kHz
hectoh10010²hectare (ha), hectopascal (hPa)
decada1010¹decade, rare in technical use
(base)—110⁰m, g, s, A, K, mol, cd
decid0.110⁻¹decibel (dB), decimeter
centic0.0110⁻²cm, cL
millim0.00110⁻³mm, mg, ms
microµ0.00000110⁻⁶µm, µg, µs
nanon0.00000000110⁻⁹nm, ns
picop0.00000000000110⁻¹²pm, pF
femtof0.00000000000000110⁻¹⁵fm (nuclear scale), fs laser pulses

Three case-sensitivity rules catch the most bugs. The prefix m is milli (10⁻³) while the prefix M is mega (10⁶) — a 1,000,000× difference from a single bit. The prefix k for kilo is the only prefix above unity that is lowercase, which is why a kilobyte in SI is kB but a kilometer is km. And the micro sign has two code points: the "micro sign" U+00B5 (µ) used in SI, and the Greek small letter mu U+03BC (μ). They render identically but compare as different strings, which is why any units library should normalize the micro sign before hashing.

The kilobyte versus kibibyte split is the same ladder applied to two different bases. SI prefixes are powers of 1000, so 1 kB = 1000 bytes. The IEC binary prefixes (kibi Ki = 1024, mebi Mi = 1024², gibi Gi = 1024³) exist because RAM is sized in powers of two, and operating systems that report "KB" while meaning 1024 bytes are the source of the "missing disk space" complaint. The binary to decimal converter handles the numeric end; the character counter strategies guide walks through formatting those numbers consistently in user-facing strings.

Length: Imperial versus Metric, Exact Factors

Length is where the imperial-to-metric conversion is most often quoted and most often misquoted. The numbers below are not approximations — they are exact, defined by the international yard and pound agreement of 1959, which fixed 1 yard = 0.9144 m exactly. Every other imperial length unit is exact because it is defined in terms of the yard.

Imperial unitExact metric valueDefinition chain
1 inch (in)25.4 mm exactly1 in = (1/36) yd × 0.9144 m = 0.0254 m
1 foot (ft)0.3048 m exactly1 ft = 12 in × 0.0254 m
1 yard (yd)0.9144 m exactlyDefined value (1959)
1 mile (mi)1609.344 m exactly1 mi = 5280 ft × 0.3048 m
1 chain (ch)20.1168 m exactly1 ch = 22 yd × 0.9144 m
1 furlong (fur)201.168 m exactly1 fur = 220 yd × 0.9144 m
1 fathom1.8288 m exactly1 fathom = 2 yd × 0.9144 m
1 nautical mile (M)1852 m exactlyInternational definition (1929)

The most common trap is the inch-to-millimeter conversion. People quote "1 inch equals 2.54 centimeters" because centimeters feel friendlier than millimeters, and that is numerically correct because 25.4 mm = 2.54 cm exactly. The trap is multiplying inches by 2.54 and labeling the result as millimeters, or multiplying by 25.4 and labeling it as centimeters. The SI subunit convention is millimeters for engineering drawings, so the canonical form is 25.4 mm/inch. Pick one form, store it as a named constant, and never inline the raw multiplier.

For interactive work, the length converter ships with all of these factors defined exactly, and the area converter and volume converter derive their factors from these by squaring or cubing them.

Mass and Weight: Pounds, Troy Ounces, and Tonnes

Mass is the quantity of matter; weight is the force on that matter under gravity. Everyday language conflates them, and the imperial system has separate units for each, which is where most of the bugs live.

UnitExact valueSystem
1 pound (avoirdupois, lb)0.45359237 kg exactlyUS/UK customary
1 ounce (avoirdupois, oz)28.349523125 g exactly1 oz = 1/16 lb
1 hundredweight (cwt, US)45.359237 kg exactly100 lb
1 short ton (US)907.18474 kg exactly2000 lb
1 long ton (UK)1016.0469088 kg exactly2240 lb
1 tonne (metric ton, t)1000 kg exactlySI-compatible
1 troy ounce (oz t)31.1034768 g exactlyPrecious metals
1 troy pound (lb t)373.2417216 g exactly12 oz troy
1 carat (ct)0.2 g exactlyGemstones

Three confusions cause real losses. First, the troy ounce is 9.7% heavier than the avoirdupois ounce, but the troy pound is 17.6% lighter than the avoirdupois pound because the troy system uses 12 ounces to the pound instead of 16. A gold dealer who mentally converts "1 pound of gold" using kitchen numbers will be off by a third of a pound. Second, "ton" means short ton in the US (2000 lb), long ton in the UK (2240 lb), and tonne (1000 kg) almost everywhere metric. International shipping contracts always spell out which one. Third, "pound-mass" (lbm) and "pound-force" (lbf) are different units under standard gravity: 1 lbf = 1 lbm × g₀ = 4.4482216152605 N, where g₀ = 9.80665 m/s² exactly. The pound-force is the unit that crashed the Mars Climate Orbiter; we cover that in the developer gotchas below.

The weight converter uses these exact factors, including the troy/avoirdupois distinction. If your use case is human body mass, the BMI calculator is the better entry point — it handles the kg/lb/st switch cleanly.

Temperature: Celsius, Fahrenheit, Kelvin, Rankine

Temperature is the only base-unit conversion that has both an offset and a slope. Length, mass, and time conversions are pure multiplication, so 0 m and 0 ft are the same point. Temperature is not — 0 °C is 32 °F is 273.15 K, and the three scales disagree on what "zero" means. The conversion is a two-step linear map: scale the difference, then add the offset.

/* Temperature conversions — slope and offset */
degF = degC * 9.0/5.0 + 32.0;        /* Celsius -> Fahrenheit */
degC = (degF - 32.0) * 5.0/9.0;      /* Fahrenheit -> Celsius */
K    = degC + 273.15;               /* Celsius -> Kelvin (offset only) */
degR = degF + 459.67;                /* Fahrenheit -> Rankine (offset only) */

The four temperatures every developer should know: 0 K = -273.15 °C is absolute zero, the floor of the temperature scale. 0 °C = 32 °F = 273.15 K is the freezing point of water at 1 atm. 100 °C = 212 °F = 373.15 K is the boiling point of water at 1 atm. And -40 °C = -40 °F is the unique point where the two scales cross, which makes it the easiest sanity-check value in temperature code.

Two subtleties. First, a temperature difference of 1 °C equals 1 K exactly, but a temperature reading of 1 °C equals 274.15 K. Slopes apply to differences; offsets apply only to readings. Code that adds 273.15 to a difference is wrong by 273.15 K. Second, the kelvin is not "degrees kelvin"; it is just "kelvin" with symbol K and no degree sign. The degree sign belongs to Celsius (°C) and Fahrenheit (°F). Style guides enforce this, and so does the Celsius to Fahrenheit converter on this site. The general temperature converter handles Kelvin and Rankine as well.

Area and Volume: Hectares, Acres, Liters, Gallons

Area and volume conversions are squares and cubes of the length conversions, so they are also exact whenever their underlying length is exact. The two trap cases are the acre (defined via the chain and furlong) and the gallon, which has different exact sizes in the US and the UK.

UnitExact valueNotes
1 square foot (ft²)0.09290304 m² exactly(0.3048 m)²
1 square yard (yd²)0.83612736 m² exactly(0.9144 m)²
1 acre4046.8564224 m² exactly1 chain × 1 furlong = 43560 ft²
1 hectare (ha)10000 m² exactly1 hm²
1 square mile (mi²)2589988.110336 m² exactly(1609.344 m)²
1 liter (L)0.001 m³ exactly1 dm³
1 US gallon (gal)3.785411784 L exactly231 in³
1 imperial gallon (UK gal)4.54609 L exactlyUK Weights and Measures Act
1 US fluid ounce (fl oz)29.5735295625 mL exactly1/128 US gal
1 imperial fluid ounce28.4130625 mL exactly1/160 imp gal
1 US pint (pt)473.176473 mL exactly1/8 US gal
1 imperial pint568.26125 mL exactly1/8 imp gal

The US gallon is 3.785 L, the imperial gallon is 4.546 L, and a "pint" in a UK pub is 568 mL while a pint in a US bar is 473 mL — a difference of about 20 percent. Recipe sites that silently swap the two produce wet dough or thin batter, and motor-fuel comparisons using US mpg against UK mpg are nonsensical. The acre is exact but unintuitive: it is one chain by one furlong (22 yd × 220 yd), which is why farmers remember it as "about a football field minus the end zones." A hectare is exactly 10,000 m², and the conversion factor 1 ha = 2.47105381 acres is a derived value, not an exact definition.

For interactive conversions, the area converter handles hectares and acres, and the volume converter handles both gallon systems with the correct exact factor.

Time, Time Zones, and DST Mechanics

Time is the base unit humans have measured the longest, and it is the only one where the "day" is not a clean power of 10. The SI second is exact, but the civil day is 86,400 seconds, the Julian year is 365.25 days = 31,557,600 seconds, and the Gregorian year averages 365.2425 days = 31,556,952 seconds. Code that uses "year = 31,536,000 seconds" (365 days) drifts by 0.78 days per year versus the calendar, which is why the date difference calculator uses calendar arithmetic instead of dividing seconds.

Time zones sit on top of the second. A UTC offset is a signed hours-and-minutes difference from Coordinated Universal Time, formatted as ±HH:MM. Most offsets are whole hours, but three large countries use half-hour offsets, and two use quarter-hour offsets:

  • India (Asia/Kolkata): UTC+05:30 — half-hour offset.
  • Newfoundland (America/St_Johns): UTC-03:30 — half-hour offset.
  • Nepal (Asia/Kathmandu): UTC+05:45 — quarter-hour offset.
  • Chatham Islands (Pacific/Chatham): UTC+12:45 — quarter-hour offset.

An IANA time zone identifier like America/New_York is more than an offset. It is a named region with a full history and future of offset rules, including when daylight saving time starts and stops. The same IANA zone flips between two UTC offsets across the year — Eastern Standard Time is UTC-05:00 and Eastern Daylight Time is UTC-04:00 — so storing an offset alone throws away the rule that produced it. If you store "2026-03-08T01:30:00-05:00" for a New York timestamp, you have lost the fact that two minutes later the clock springs forward to 03:00 EDT, and a recurring-meeting engine cannot tell whether the meeting happens at 01:30 standard or daylight.

DST mechanics, in plain English:

  • Spring forward: at 02:00 local on the second Sunday of March (US), clocks jump to 03:00, so the hour 02:00-03:00 never happens. Scheduling a backup for 02:30 that day silently skips.
  • Fall back: at 02:00 local on the first Sunday of November (US), clocks return to 01:00, so the hour 01:00-02:00 happens twice. A timestamp "2026-11-01T01:30" without an offset or zone is ambiguous.
  • EU DST uses different dates (last Sundays of March and October), so a transatlantic meeting's local time shifts by an hour twice a year for a few weeks until the other side catches up.
  • Leap seconds are inserted (or, theoretically, removed) at the end of June or December UTC, announced six months in advance by the IERS. Most code ignores them and treats UTC days as exactly 86,400 seconds, which is wrong but consistent; systems that need true UTC use a leap-second-aware library or a smear.

The correct code pattern is: store every instant in UTC, attach the IANA zone as metadata, format for display using that zone, and never store a local timestamp without either an offset or a zone identifier. ISO 8601 covers both: 2026-10-22T13:45:00+02:00 for a wall-clock instant with offset, and 2026-10-22T11:45:00Z for the same instant in UTC. The time zone converter and the timezone converter use IANA zones for these reasons, and the timestamp converter handles ISO 8601 and Unix epoch seconds in both directions. For age math on top of dates, the age calculator uses calendar-aware differences.

Developer Gotchas: Floating Point, Unit Mixes, Dimensional Analysis

Most unit-conversion bugs are not math bugs. They are precision bugs, unit-label bugs, and timezone bugs. Three of these have crashed spacecraft or cost lives, and they are all avoidable with cheap discipline.

Floating point: 0.1 + 0.2 ≠ 0.3

IEEE 754 doubles store numbers in binary, and 0.1 has no exact binary representation. In JavaScript, Python, Java, and every other language that uses doubles, 0.1 + 0.2 evaluates to 0.30000000000000004, which is not equal to 0.3 under strict ===. In unit conversion this surfaces whenever you chain factors or compare a result to a threshold. A water-level alarm at "exactly 0.3 m" never fires when the sensor reports 0.30000000000000004.

/* Floating point trap in unit conversion */
> 0.1 + 0.2 === 0.3
false
> (0.1 + 0.2).toFixed(20)
"0.30000000000000004441"

/* Fixes: epsilon compare, decimal type, integer subunits */
function eq(a, b) { return Math.abs(a - b) < 1e-9; }
// or store as integer millimeters and convert only for display

The four standard fixes are: compare against an epsilon tolerance; use a decimal type for money and for human-facing measurements; store integers in the smallest SI subunit you care about (millimeters, milligrams, milliseconds) and convert only for display; or use a units library that keeps the precision in the integer mantissa. The percentage calculator on this site uses decimal math internally for the same reason.

Unit mixes: the Mars Climate Orbiter

In 1999 the Mars Climate Orbiter burned up in the Martian atmosphere because two contractor teams used different unit conventions for the same quantity. Lockheed Martin sent impulse values (force × time) in pound-force-seconds; NASA's navigation software expected newton-seconds. One pound-force is 4.4482216152605 newtons exactly, so the impulse values were off by a factor of about 4.45, and the spacecraft entered the atmosphere roughly 57 kilometers lower than planned, where aerodynamic heating destroyed it. The cost was $327.6 million in 1999 dollars. The bug was not a math error — it was a unit-label error, and a code review that required explicit unit annotations would have caught it.

Dimensional analysis

Dimensional analysis is the cheap discipline that prevents this class of bug. Every variable in your conversion code should carry its unit: impulse_lbf_s rather than impulse, velocity_m_s rather than v. When you multiply, you check that the units cancel to produce the expected result. When you call across modules, you assert the unit on the way in. Libraries like pint in Python, unitsnet in C#, and js-quantities in JavaScript make a wrong-unit multiplication a runtime error instead of a quiet wrong answer. If you are building a converter for production, the documentation best practices guide has the format for writing down unit assumptions so the next maintainer does not have to guess.

Time zones in code

Three time-zone bugs repeat in production. First, storing local time without an offset or zone, so DST transitions silently shift the data by an hour twice a year. Second, computing a "day" by adding 86,400 seconds to a local time, which skips or doubles a DST transition hour. Third, calling new Date() in a browser and assuming the resulting UTC value matches the server's UTC value — it does, but only if the client's clock is correct, which is a separate reliability problem. If you are parsing user input that may carry a zone, the regex testing guide has a tested pattern for ISO 8601 strings that accepts offset, Z, or no-offset-but-with-zone cases.

Compound Units: Speed, Density, Pressure, Fuel Economy

Compound units are derived units that mix two or more dimensions, and their conversions are products of the underlying factor conversions. Speed is length per time; density is mass per volume; pressure is force per area; fuel economy is length per volume. The exact factors below all derive from the exact factors in the sections above.

Compound unitExact metric valueComposition
1 mile per hour (mph)0.44704 m/s exactly1609.344 m / 3600 s
1 kilometer per hour (km/h)0.2777... m/s exactly1000 m / 3600 s = 5/18 m/s
1 knot (kn)0.5144... m/s exactly1852 m / 3600 s
1 foot per second (ft/s)0.3048 m/s exactly0.3048 m / 1 s
1 gram per cm³ (g/cm³)1000 kg/m³ exactlywater at 4 °C ≈ 1000 kg/m³
1 standard atmosphere (atm)101325 Pa exactlydefined (1954)
1 bar100000 Pa exactlydefined
1 pound per square inch (psi)6894.757293168 Pa1 lbf / 1 in² (derived)
1 torr (mmHg)133.322368421052... Paatm / 760 (defined)
1 kilowatt-hour (kWh)3600000 J exactly1000 W × 3600 s
1 thermochemical calorie (cal)4.184 J exactlydefined
1 BTU (ISO)1055.05585262 J exactlydefined (ISO 80000-15)
1 horsepower (mechanical, hp)745.699871582 W550 ft·lbf/s (derived)

Fuel economy is the one compound unit with a non-linear conversion. US mpg and metric L/100km are reciprocals with a scaling factor: L/100km = 235.214583 / mpg, and mpg = 235.214583 / (L/100km). The "235.214583" comes from 100 × 3.785411784 L/gal / 1.609344 km/mi, both exact. The flip means that improving from 20 mpg to 30 mpg saves more fuel per mile than improving from 30 mpg to 40 mpg, which is why European fuel-economy labels are linear in L/100km rather than in mpg.

The calculator tools guide catalogs the calculators that combine units — speed, density, pressure, fuel economy, and the rest — and the unit converter tools guide covers the single-quantity converters.

Seven Common Unit-Conversion Anti-Patterns

  1. Mixing 2.54 cm/inch and 25.4 mm/inch. Both are numerically correct, but inlining one as a bare multiplier and the other as a constant in the next function drifts. Fix: pick millimeters as the canonical SI subunit for engineering, store 25.4 as one named constant, and never inline the raw multiplier.
  2. Confusing troy and avoirdupois ounces. A troy ounce is 31.1034768 g; an avoirdupois ounce is 28.349523125 g. Bullion, gold, and silver are quoted in troy; recipes and body weight use avoirdupois. Fix: name every mass variable with its system, like mass_troy_oz and mass_avdp_oz, and convert through a single function.
  3. Treating "pound" as mass when you mean force, or vice versa. 1 pound-mass is 0.45359237 kg; 1 pound-force is 4.4482216152605 N. Engineers in aerospace and fluid systems must know which one is in the spec. Fix: use lbm and lbf in code, never bare lb, and assert standard gravity where you divide one by the other.
  4. Storing local timestamps without timezone. A column of 2026-03-08T01:30:00 with no offset and no zone is ambiguous on a DST transition. Fix: store UTC instants plus an IANA zone, or store the full ISO 8601 string with offset; never the bare local time.
  5. Using "ton" without specifying short, long, or metric. Short ton = 2000 lb, long ton = 2240 lb, metric ton (tonne) = 1000 kg — three different weights. Fix: in code use ton_us, ton_uk, tonne; in prose spell out which one.
  6. Mixing US gallons and imperial gallons. US gal = 3.785411784 L; imperial gal = 4.54609 L. Recipe and fuel-economy conversions break silently. Fix: pick the country context once, document it, and ship a single exact factor.
  7. Adding 273.15 to a temperature difference. A temperature reading of 20 °C is 293.15 K, but a temperature difference of 20 °C is exactly 20 K. Offsets apply to readings, not differences. Fix: separate the "absolute temperature" type from the "temperature difference" type so the compiler refuses the wrong call.

Every one of these is a naming and types problem before it is a math problem. The general workflow for catching them in code review is in the documentation best practices guide, and the productivity tools guide catalogs the converters and checklists that make the discipline cheap.

Frequently Asked Questions

Both are true because they are the same length stated in two SI subunits, but the canonical exact SI value is 1 inch = 25.4 mm exactly, fixed by the 1959 international yard and pound agreement. One inch equals 2.54 centimeters exactly because 25.4 mm is 2.54 cm. The trap is mixing the multiplier with the wrong unit: multiply inches by 25.4 to get millimeters, or multiply inches by 2.54 to get centimeters. Pick one canonical form and use it everywhere, because the bug that loses spacecraft is almost always the multiplier-without-the-unit form.

The Mars Climate Orbiter burned up in 1999 because one contractor sent impulse values in pound-force-seconds while the navigation software expected newton-seconds. A pound-force is 4.4482216152605 newtons, so the trajectory was off by a factor of about 4.45, and the spacecraft entered the atmosphere roughly 57 kilometers lower than planned. The fix in your code is dimensional analysis: always attach a unit object to the number, never let a bare number cross a module boundary, and assert that units cancel before you compare. Libraries like pint in Python or units.net in C# make a wrong-unit multiplication a runtime error instead of a quiet wrong answer.

No. A troy ounce is 31.1034768 grams exactly and is divided 12 per troy pound, while an avoirdupois ounce is 28.349523125 grams exactly and is divided 16 per avoirdupois pound. A troy ounce is about 9.7 percent heavier than the ounce you see on a kitchen scale. Precious metals, bullion, and most spot gold and silver prices are quoted in troy ounces, so a casual conversion using the grocery-store ounce will quietly over- or under-state a position. The troy pound is actually lighter than the avoirdupois pound because it has only 12 ounces, even though each troy ounce is heavier.

The exact formulas are Fahrenheit = Celsius times 9/5 plus 32, and Celsius = (Fahrenheit minus 32) times 5/9. The two scales cross at exactly negative 40 degrees, so minus 40 Celsius equals minus 40 Fahrenheit. To convert to kelvin, add 273.15 to the Celsius value, and remember that a temperature difference of 1 degree Celsius equals 1 kelvin exactly, while a temperature point of 1 Celsius equals 274.15 kelvin. The most common bug is applying the 9/5 slope to a temperature difference and then also adding 32, which double-counts the offset.

Floating-point doubles use binary fractions, and 0.1 and 0.2 have no exact binary representation. Adding them yields 0.30000000000000004, which is not equal to 0.3 under strict equality. In unit conversion this matters whenever you chain factors or compare results to a threshold. The standard fixes are to compare against an epsilon tolerance, use a decimal type for money and for human-facing measurements, store integers in the smallest SI subunit you care about (millimeters, milligrams, milliseconds) and convert only for display, or use a units library that keeps the precision in the integer mantissa.

A UTC offset is a signed hours-and-minutes difference from Coordinated Universal Time, like plus 05:30 for India or minus 05:00 for Eastern Standard Time. An IANA time zone, like America/New_York, is a named region with a historical and future set of offset rules, including when daylight saving time starts and stops. The same IANA zone flips between two UTC offsets across the year, so storing an offset alone loses information about which rule applied. The correct pattern in code is to store every instant in UTC with an IANA zone attached, format for display using that zone, and never store a local time without either an offset or a zone identifier.

Health Tip Calculators: Everyday Math Made Easy

The sibling angle: the health, body, and money math that sits next to hard science conversions in any tool kit.

Unit Converter Tools Guide

How the on-site converters are built, which exact factors they use, and how to extend the same patterns.

Calculator Tools Guide

The broader calculator catalog: percentage, age, BMI, date difference, and the rules that keep them precise.

Documentation Best Practices

How to write down unit assumptions, exact factors, and dimensional-analysis rules so the next maintainer does not guess.

Character Counter Strategies for Content Optimization

Formatting unit strings, decimals, and significant figures consistently across user-facing output.

Productivity Tools Ultimate Guide

The umbrella guide that catalogs converters, calculators, and checklists into a single workflow.

Conclusion: Conversions That Survive Review

Unit conversion looks like multiplication, but it is a stack of decisions: which exact factor to use, which SI subunit is canonical, whether the number is a reading or a difference, whether the timestamp is an instant or a wall clock, and whether the unit on the wire matches the unit in the spec. The SI base units, the derived units, the prefix ladder, and the exact imperial-to-metric factors give you the math. The discipline — named units, dimensional analysis, UTC plus IANA zone — gives you the safety. Together they are what separates a converter that ships from one that quietly produces wrong answers until a spacecraft burns.

When you are ready to move from reading to converting, open the unit converter for single quantities, the length converter, weight converter, temperature converter, area converter, volume converter, and time zone converter for category-specific work, and the calculator tools guide for the wider toolkit. For the everyday-math angle that pairs with this guide, read the health tip calculators guide, and browse the full catalog on the NoCostTools blog. More about the team behind these guides is on the about page, and common questions about how the tools work are answered in the site FAQ.