value float required The numeric value to convert (|value| ≤ 10¹⁵).
Deterministic unit conversion across 14 categories — length, mass, pressure, energy, power, force, angle, time and more — with exact standard factors.
Authoritative reference data or standards computation
Pure computation: value × exact factors (or the temperature formulas). Unit ids are case-insensitive; the response echoes the canonical ids.
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
value
required
| float | allowed: -1000000000000000 – 1000000000000000 example: 5 | The numeric value to convert (|value| ≤ 10¹⁵). |
from
required
| string | example: km | Source unit id, case-insensitive (see the table at /api/units). |
to
required
| string | example: mi | Target unit id, case-insensitive — must be in the same category as 'from'. |
value float required The numeric value to convert (|value| ≤ 10¹⁵).
from string required Source unit id, case-insensitive (see the table at /api/units).
to string required Target unit id, case-insensitive — must be in the same category as 'from'.
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
fields | list | example: value,from | Return only these fields (comma-separated). Mutually exclusive with 'exclude'. |
exclude | list | example: formula | Return all fields except these (comma-separated). |
pretty | boolean | default: false example: true | Pretty-print the JSON response. |
unwrap | boolean | default: false example: true | Drop the envelope: return the raw array/object without data/meta wrapper. |
fields list Return only these fields (comma-separated). Mutually exclusive with 'exclude'.
exclude list Return all fields except these (comma-separated).
pretty boolean Pretty-print the JSON response.
unwrap boolean Drop the envelope: return the raw array/object without data/meta wrapper.
| Field | Type | Description | Example |
|---|---|---|---|
value | float | The input value, echoed back. | 5 |
from | string | Canonical id of the source unit. | km |
to | string | Canonical id of the target unit. | mi |
result | float | The converted value — accurate to at least 9 significant digits, and exact conversions (e.g. 1 acre → 4046.8564224 m², 1 atm → 101325 Pa) are returned exactly. | 3.10685596 |
category | string | The (shared) category of both units. | length |
formula | string | The conversion rule that was applied, e.g. '1 mi = 1.609344 km' or '°F = °C × 9/5 + 32'. | 1 km = 0.621371192237334 mi |
value float The input value, echoed back.
example: 5
from string Canonical id of the source unit.
example: km
to string Canonical id of the target unit.
example: mi
result float The converted value — accurate to at least 9 significant digits, and exact conversions (e.g. 1 acre → 4046.8564224 m², 1 atm → 101325 Pa) are returned exactly.
example: 3.10685596
category string The (shared) category of both units.
example: length
formula string The conversion rule that was applied, e.g. '1 mi = 1.609344 km' or '°F = °C × 9/5 + 32'.
example: 1 km = 0.621371192237334 mi
/api/units/convert?value=5&from=km&to=mi {
"data": {
"value": 5,
"from": "km",
"to": "mi",
"result": 3.10685596,
"category": "length",
"formula": "1 km = 0.621371192237334 mi"
},
"meta": {
"endpoint": "units",
"route": "/convert",
"params": {
"value": 5,
"from": "km",
"to": "mi"
},
"generatedAt": "2026-07-29T08:14:28.000Z"
}
} /api/units/convert?value=100&from=c&to=f {
"data": {
"value": 100,
"from": "c",
"to": "f",
"result": 212,
"category": "temperature",
"formula": "°F = °C × 9/5 + 32"
},
"meta": {
"endpoint": "units",
"route": "/convert",
"params": {
"value": 100,
"from": "c",
"to": "f"
},
"generatedAt": "2026-07-29T08:14:28.000Z"
}
} /api/units/convert?value=1&from=gib&to=mb {
"data": {
"value": 1,
"from": "gib",
"to": "mb",
"result": 1073.741824,
"category": "data",
"formula": "1 gib = 1073.741824 mb"
},
"meta": {
"endpoint": "units",
"route": "/convert",
"params": {
"value": 1,
"from": "gib",
"to": "mb"
},
"generatedAt": "2026-07-29T08:14:28.000Z"
}
} /api/units/convert?value=1&from=atm&to=psi {
"data": {
"value": 1,
"from": "atm",
"to": "psi",
"result": 14.6959488,
"category": "pressure",
"formula": "1 atm = 14.6959488 psi"
},
"meta": {
"endpoint": "units",
"route": "/convert",
"params": {
"value": 1,
"from": "atm",
"to": "psi"
},
"generatedAt": "2026-07-29T08:14:28.000Z"
}
} /api/units/convert?value=150&from=hp&to=kw {
"data": {
"value": 150,
"from": "hp",
"to": "kw",
"result": 111.854981,
"category": "power",
"formula": "1 hp = 0.745699872 kw"
},
"meta": {
"endpoint": "units",
"route": "/convert",
"params": {
"value": 150,
"from": "hp",
"to": "kw"
},
"generatedAt": "2026-07-29T08:14:28.000Z"
}
} /api/units/convert?value=90&from=deg&to=rad {
"data": {
"value": 90,
"from": "deg",
"to": "rad",
"result": 1.57079633,
"category": "angle",
"formula": "1 deg = 0.0174532925 rad"
},
"meta": {
"endpoint": "units",
"route": "/convert",
"params": {
"value": 90,
"from": "deg",
"to": "rad"
},
"generatedAt": "2026-07-29T08:14:28.000Z"
}
} | Parameter | Type | Default & allowed | Description |
|---|---|---|---|
category | enum | default: any allowed: length | mass | temperature | volume | data | speed | area | pressure | energy | power | force | angle | time | frequency | any example: data | Only list units of this category. |
category enum Only list units of this category.
| Parameter | Type | Default & allowed | Description |
|---|---|---|---|
count | int | default: all matches allowed: 1 – 100 example: 3 | Limit the number of returned records (1–100). Defaults to all matches. |
fields | list | example: id,name | Return only these fields (comma-separated). Mutually exclusive with 'exclude'. |
exclude | list | example: toBase | Return all fields except these (comma-separated). |
format | enum | default: json allowed: json | ndjson | csv example: csv | Response format: json envelope, ndjson (one record per line) or csv. |
pretty | boolean | default: false example: true | Pretty-print the JSON response. |
unwrap | boolean | default: false example: true | Drop the envelope: return the raw array/object without data/meta wrapper. |
count int Limit the number of returned records (1–100). Defaults to all matches.
fields list Return only these fields (comma-separated). Mutually exclusive with 'exclude'.
exclude list Return all fields except these (comma-separated).
format enum Response format: json envelope, ndjson (one record per line) or csv.
pretty boolean Pretty-print the JSON response.
unwrap boolean Drop the envelope: return the raw array/object without data/meta wrapper.
| Field | Type | Description | Example |
|---|---|---|---|
id | string | The unit id to pass as 'from'/'to' on /convert. | mi |
name | string | Full human-readable name. | mile |
category | string | One of: length, mass, temperature, volume, data, speed, area, pressure, energy, power, force, angle, time, frequency. | length |
toBase | string | Relation to the category's base unit (m, kg, °C, l, b, kmh, m2, pa, j, w, n, deg, s, hz), e.g. '1 mi = 1609.344 m'. Exact wherever an exact decimal exists; where none does (1 torr, 1 rad) the text says 'rounded' and gives the exact definition. | 1 mi = 1609.344 m |
id string The unit id to pass as 'from'/'to' on /convert.
example: mi
name string Full human-readable name.
example: mile
category string One of: length, mass, temperature, volume, data, speed, area, pressure, energy, power, force, angle, time, frequency.
example: length
toBase string Relation to the category's base unit (m, kg, °C, l, b, kmh, m2, pa, j, w, n, deg, s, hz), e.g. '1 mi = 1609.344 m'. Exact wherever an exact decimal exists; where none does (1 torr, 1 rad) the text says 'rounded' and gives the exact definition.
example: 1 mi = 1609.344 m
/api/units {
"data": [
{
"id": "mm",
"name": "millimeter",
"category": "length",
"toBase": "1 mm = 0.001 m"
},
{
"id": "cm",
"name": "centimeter",
"category": "length",
"toBase": "1 cm = 0.01 m"
},
{
"id": "m",
"name": "meter",
"category": "length",
"toBase": "1 m = 1 m"
},
{
"id": "km",
"name": "kilometer",
"category": "length",
"toBase": "1 km = 1000 m"
},
{
"id": "in",
"name": "inch",
"category": "length",
"toBase": "1 in = 0.0254 m"
},
{
"id": "ft",
"name": "foot",
"category": "length",
"toBase": "1 ft = 0.3048 m"
},
{
"id": "yd",
…
"generatedAt": "2026-07-29T08:14:28.000Z"
}
} /api/units?category=data {
"data": [
{
"id": "b",
"name": "byte",
"category": "data",
"toBase": "1 b = 1 b"
},
{
"id": "kb",
"name": "kilobyte (10^3 bytes)",
"category": "data",
"toBase": "1 kb = 1000 b"
},
{
"id": "mb",
"name": "megabyte (10^6 bytes)",
"category": "data",
"toBase": "1 mb = 1000000 b"
},
{
"id": "gb",
"name": "gigabyte (10^9 bytes)",
"category": "data",
"toBase": "1 gb = 1000000000 b"
},
{
"id": "tb",
"name": "terabyte (10^12 bytes)",
"category": "data",
"toBase": "1 tb = 1000000000000 b"
},
{
"id": "kib",
"name": "kibibyte (2^10 bytes)",
"category": "data",
"toBase": "1 kib = 1024 b"
},
{
"id": "mib",
…
"generatedAt": "2026-07-29T08:14:28.000Z"
}
} /api/units?category=pressure {
"data": [
{
"id": "pa",
"name": "pascal",
"category": "pressure",
"toBase": "1 pa = 1 pa"
},
{
"id": "hpa",
"name": "hectopascal (10^2 Pa)",
"category": "pressure",
"toBase": "1 hpa = 100 pa"
},
{
"id": "kpa",
"name": "kilopascal (10^3 Pa)",
"category": "pressure",
"toBase": "1 kpa = 1000 pa"
},
{
"id": "mpa",
"name": "megapascal (10^6 Pa)",
"category": "pressure",
"toBase": "1 mpa = 1000000 pa"
},
{
"id": "bar",
"name": "bar",
"category": "pressure",
"toBase": "1 bar = 100000 pa"
},
{
"id": "mbar",
"name": "millibar (= hectopascal)",
"category": "pressure",
"toBase": "1 mbar = 100 pa"
},
{
"id": "atm",
…
"generatedAt": "2026-07-29T08:14:28.000Z"
}
} /api/units?category=length&fields=id,toBase {
"data": [
{
"id": "mm",
"toBase": "1 mm = 0.001 m"
},
{
"id": "cm",
"toBase": "1 cm = 0.01 m"
},
{
"id": "m",
"toBase": "1 m = 1 m"
},
{
"id": "km",
"toBase": "1 km = 1000 m"
},
{
"id": "in",
"toBase": "1 in = 0.0254 m"
},
{
"id": "ft",
"toBase": "1 ft = 0.3048 m"
},
{
"id": "yd",
"toBase": "1 yd = 0.9144 m"
},
{
"id": "mi",
"toBase": "1 mi = 1609.344 m"
}
],
"meta": {
"endpoint": "units",
"count": 8,
"params": {
"category": "length"
},
"generatedAt": "2026-07-29T08:14:28.000Z"
}
} Converts between 110 units in 14 categories using the exact legal/standard definitions, not lookup-table approximations:
torr and mmhg are different units: 1 torr = 101325/760 Pa while the conventional mmHg = 133.322387415 Pa)cal is the thermochemical calorie, 4.184 J exactly — the one behind US nutrition labels; calit is the International Table calorie, 4.1868 J; btu is the IT Btu, 1055.05585262 J; 1 eV = 1.602176634 × 10⁻¹⁹ J, exact since the 2019 SI redefinition fixed the elementary charge)hp is the mechanical horsepower, 550 ft·lbf/s = 745.69987158227022 W; ps is the metric horsepower, 75 kgf·m/s = 735.49875 W — different units, both exact)year is the Julian year, exactly 365.25 days. Calendar months and years are deliberately absent: no exact factor exists for them)Id collisions are documented, never silent. ms is meter per second — it shipped before the time category existed and renaming it would break callers — so the millisecond is msec. ps is metric horsepower, mb is megabyte (the millibar is mbar), mw is megawatt and mpa is megapascal. Ask for a conversion that mixes those up and the 400 says which unit you actually named.
Rounded is labelled as rounded. Most factors are exact decimals. A few cannot be — 1 torr = 101325/760 Pa and 1 psi = 1 lbf ÷ 1 in² never terminate, 1 rad = 180/π° is irrational, and 1 hp = 550 ft·lbf/s has more digits than a double can round-trip. Those rows print the exact definition in toBase instead of pretending a decimal is exact.
Every /convert response includes the formula that was applied, so results are auditable. Unit ids are case-insensitive. Converting across categories (km → kg) is a 400 naming both categories, and an unknown unit is a 400 listing every supported id — plus a "did you mean" when your input is close to a real one. Nothing is ever silently guessed. Results are pure functions of the inputs: same query, same answer, forever.
Where an exact legal definition exists, yes — 1 inch = 25.4 mm, 1 lb = 0.45359237 kg, 1 atm = 101325 Pa — and the response's formula shows the math. Where no decimal can be exact (1 torr = 101325/760 Pa, 1 rad = 180/π°) the table says rounded and gives the exact definition.
Length, mass, temperature, volume, data, speed, area, pressure, energy, power, force, angle, time and frequency — 14 in all, and the reference route lists every unit per category.
Via the exact offset formulas (°F = °C × 9/5 + 32), not linear factors — so 100 °C converts to exactly 212 °F.
Use msec. The id ms was already the speed unit meter per second before the time category existed, and breaking existing callers would be worse than an unusual id — so millisecond is msec, and ps is metric horsepower rather than picosecond.
hp is the mechanical (imperial) horsepower, exactly 550 ft·lbf/s = 745.69987158227022 W. The metric horsepower (PS/CV, 75 kgf·m/s = 735.49875 W exactly) is a separate unit with the id ps.
/convert with an unknown from/to answers 400 with the full list of supported ids, and a did-you-mean suggestion when your input is close to a real one — never a silent guess.
Random integers or floats in any range — control decimal precision, draw guaranteed-unique values, and pin a seed for reproducible sequences.
Every active ISO 4217 currency — code, name, symbol, minor-unit decimals and the countries using it. Search the list or look up one code, with honest 404s.
Real calendar facts for any date — weekday, ISO week, day of year, quarter, leap year, days in month, weekend flag and Unix timestamp. Defaults to today.
Parse ISO 8601 durations, add them with documented end-of-month clamping, break down the gap between two dates, and humanize a span in any locale.