Unit Converter
Convert length, weight, temperature, area, volume, speed, data storage and data rates, in either direction, with the exact definitions of every unit.
Overview
Unit conversion expresses the same quantity in a different unit. Every category except temperature has a base unit, and every other unit is a fixed multiple of it, so a conversion is two steps: multiply by the factor of the unit you have to reach the base, divide by the factor of the unit you want. The factors here are the exact definitions, not roundings: an inch is 0.0254 m and a pound 0.45359237 kg by international agreement since 1959.
Web interface
Each category has a page of its own; /convert/units opens on length. Pick the two units and type
into either field: both are editable, and the other one follows as you type. Swap exchanges the
units together with their values, so the equation stays true. Copy copies the value that was
worked out, Clear empties both fields. The line under the fields repeats the conversion with
both units named, and the table below lists every unit of the category with what it is used for.
| Page | Units | Base |
|---|---|---|
/convert/units/length | 15, from nanometer to light year | meter |
/convert/units/weight | 12, including troy ounce and carat | kilogram |
/convert/units/temperature | 4: Celsius, Fahrenheit, Kelvin, Rankine | Celsius |
/convert/units/area | 10, including hectare and acre | square meter |
/convert/units/volume | 16, US customary and imperial kept apart | liter |
/convert/units/speed | 7, including knot and Mach | meter per second |
/convert/units/data-storage | 16, binary and decimal, and four discs | byte |
/convert/units/data-rate | 15, in bits and in bytes per second | bit per second |
US and imperial measures share names but not sizes: a US gallon is 3.785411784 liters, a UK gallon 4.54609. The volume page labels the US ones as such and groups them apart. Mach is taken as 343 m/s, the speed of sound in dry air at 20 °C; the real figure changes with temperature.
Numbers and precision
A result carries up to fifteen significant digits, the most a double-precision number holds reliably, with
trailing zeros dropped. Exact definitions therefore come through whole: 1 mile is 1609.344 m, 1
light year 9.4607304725808e+15 m. From a quadrillion up and below a millionth the result is
written in exponent notation, such as 1e-9 for a nanometer in meters. Results never carry a
thousands separator, so a copied value pastes straight into a spreadsheet or a script.
A value can be typed with a comma or a point:
| Typed | Read as |
|---|---|
1.5 or 1,5 | one and a half: a single comma or point is the decimal separator |
1,000 | one, for the same reason |
1.000.000 or 1,000,000 | a million: a separator that appears twice groups thousands |
1.234,5 or 1,234.5 | 1234.5: with both, the last one separates the decimals |
1 000 or 1'000 | a thousand: spaces and apostrophes are ignored |
2e3 | 2000 |
Anything else gives Not a number. The line under the fields shows how the value was read, so
1,000 taken as one is visible at once.
Temperature
Temperature scales differ in where zero sits as well as in the size of a degree, so no single factor links
them. They are converted through Celsius with an offset: Fahrenheit as (°F − 32) × 5/9, Kelvin as K − 273.15,
Rankine as (°R − 491.67) × 5/9. Results are rounded to ten decimal places, which removes the residue of that
arithmetic: 100 °F is 37.7777777778 °C, and 0 K is exactly 0 °R.
Nothing is colder than absolute zero. A value below it, such as −300 °C, gives no result and the message
Below absolute zero, which is 0 K, −273.15 °C, −459.67 °F and 0 °R.
Bits and bytes
A kibibyte is 1024 bytes, a kilobyte 1000, and the same holds a step up: 1 GiB is 1.073741824 GB.
Operating systems and storage vendors disagree about which one "GB" means, so both are offered. Data rates are
counted in bits, storage in bytes, and the factor of eight between them is why a 1 Gbps line moves
125 MB/s at most.
The discs are measured by what they hold. A "1.44 MB" floppy is 1440 KiB, 1,474,560 bytes. A 700 MB CD-R holds 737,280,000 bytes, 360,000 sectors of 2048, which is 703.125 MiB. The DVD and the Blu-ray are taken at their nominal 4.7 and 25 GB.
No API
There is no API for this tool. The conversion runs in the browser; on the command line,
units '1 mile' 'm' does the same with the units program.
Privacy
Nothing leaves the browser. The factors come with the page, the conversion runs on it, and Copy writes to the clipboard only when you press it.