Unit Converter - Length, Weight, Temperature & Data Size Online
Convert between length, weight, temperature, data size, speed, time, area, and volume units instantly. Binary vs decimal data size toggle — 100% client-side, no data sent to server.
Frequently Asked Questions
What is a unit converter?
A unit converter is a tool that translates a measurement value from one unit to another within the same category. For example, it converts 100 centimeters to 1 meter (length), 1 kilogram to 2.205 pounds (weight), or 0 degrees Celsius to 32 degrees Fahrenheit (temperature). This tool supports 8 categories: length, weight/mass, temperature, data size, speed, time, area, and volume, covering both metric (SI) and imperial measurement systems.
How do I use this unit converter tool?
1. Select a conversion category tab (e.g., Length, Data Size, Temperature). 2. Enter a numeric value in the input field. 3. Choose the "From" unit using the dropdown (e.g., Kilometers). 4. Choose the "To" unit using the dropdown (e.g., Miles). 5. The result appears instantly as you type. 6. Use the swap button to reverse the conversion direction. 7. Check the "All Units" panel below to see the value in every unit of that category. 8. Click the copy button to copy the result to your clipboard.
Is my data safe? Does anything get sent to a server?
All unit conversions are performed 100% in your browser using pure JavaScript math. No data is transmitted to any server. The tool uses simple arithmetic formulas (multiplication and division by conversion factors) that run entirely on your device. Your input values never leave your browser, making this tool completely private and safe to use with any values.
What is the difference between binary (1024) and decimal (1000) data units?
In computing, there are two standards for data size units. The binary (IEC) standard uses powers of 1024: 1 KiB = 1,024 bytes, 1 MiB = 1,048,576 bytes, 1 GiB = 1,073,741,824 bytes. This matches how computers actually allocate memory. The decimal (SI) standard uses powers of 1000: 1 KB = 1,000 bytes, 1 MB = 1,000,000 bytes, 1 GB = 1,000,000,000 bytes. This is how storage manufacturers typically advertise capacity. The tool defaults to binary mode since developers most commonly work with base-1024 values.
Why do temperature conversions use formulas instead of simple multiplication?
Temperature scales are not proportional to each other — they have different zero points and different scale sizes. Celsius and Fahrenheit are offset scales (0°C = 32°F, not 0°F), so conversion requires both multiplication and addition: °F = °C × 9/5 + 32. Kelvin is an absolute scale where 0K is absolute zero (−273.15°C), so it requires an additive offset: K = °C + 273.15. This is different from length or weight conversions where units are simply multiples of each other (e.g., 1 km = 1000 m).
How accurate are the conversions?
The tool uses IEEE 754 double-precision floating-point arithmetic, which provides approximately 15-17 significant decimal digits of precision. Conversion factors are sourced from international standards (BIPM SI definitions, NIST). For everyday and engineering use, the precision exceeds practical measurement accuracy. You can adjust the displayed decimal places from 0 to 10 using the precision selector, or use "Auto" mode which shows up to 6 meaningful digits with trailing zeros removed.
What time assumptions does this tool use for months and years?
For simplicity and predictability, the tool defines 1 month = 30 days and 1 year = 365 days. These are standard approximations used in engineering and development contexts (e.g., cache TTL calculations, timeout configurations). Actual calendar months vary from 28 to 31 days, and actual years may be 365 or 366 days. For precise calendar-aware calculations, use a dedicated date/time calculator instead.
Code Examples
// Unit conversion utilities
function convert(value, fromUnit, toUnit, factors) {
const baseValue = value * factors[fromUnit];
return baseValue / factors[toUnit];
}
// Length factors (base: meter)
const lengthFactors = {
mm: 0.001, cm: 0.01, m: 1, km: 1000,
in: 0.0254, ft: 0.3048, yd: 0.9144, mi: 1609.344,
};
console.log(convert(100, 'cm', 'm', lengthFactors)); // 1
console.log(convert(1, 'mi', 'km', lengthFactors)); // 1.609344
// Temperature (special formulas)
function convertTemperature(value, from, to) {
let celsius;
if (from === 'C') celsius = value;
else if (from === 'F') celsius = (value - 32) * 5 / 9;
else if (from === 'K') celsius = value - 273.15;
if (to === 'C') return celsius;
if (to === 'F') return celsius * 9 / 5 + 32;
if (to === 'K') return celsius + 273.15;
}
console.log(convertTemperature(100, 'C', 'F')); // 212
console.log(convertTemperature(32, 'F', 'C')); // 0
// Data size with binary/decimal toggle
function convertDataSize(value, fromUnit, toUnit, binary = true) {
const base = binary ? 1024 : 1000;
const units = ['B', 'KB', 'MB', 'GB', 'TB', 'PB'];
const fromIndex = units.indexOf(fromUnit);
const toIndex = units.indexOf(toUnit);
return value * Math.pow(base, fromIndex - toIndex);
}
console.log(convertDataSize(1, 'GB', 'MB', true)); // 1024
console.log(convertDataSize(1, 'GB', 'MB', false)); // 1000