Unit converter
Convert between units of length, mass, temperature, area, volume, speed, time, data, pressure, energy and more.
Input
Result
Fill in the input and press Run.
Your input is processed in memory and then discarded. It is not stored or logged. Even so, don't paste live passwords or keys into any online tool.
Use it from code or an agent
curl -s https://setget.net/v1/tools/unit-convert \
-H 'Content-Type: application/json' \
-d '{"input":{"value":10,"from_unit":"km","to_unit":"miles"}}'
import json, urllib.request
body = {'input': {'value': 10, 'from_unit': 'km', 'to_unit': 'miles'}}
request = urllib.request.Request("https://setget.net/v1/tools/unit-convert", json.dumps(body).encode(),
{"Content-Type": "application/json"})
print(json.load(urllib.request.urlopen(request))["result"])
const response = await fetch("https://setget.net/v1/tools/unit-convert", {
method: "POST",
headers: {"Content-Type": "application/json"},
body: JSON.stringify({"input":{"value":10,"from_unit":"km","to_unit":"miles"}}),
});
console.log((await response.json()).result);
Tool: run_tool
Arguments:
{
"slug": "unit-convert",
"input": {
"value": 10,
"from_unit": "km",
"to_unit": "miles"
}
}
{
"input": {
"value": 10,
"from_unit": "km",
"to_unit": "miles"
}
}
Endpoint: POST /v1/tools/unit-convert. Over MCP: run_tool with slug: "unit-convert".
Machine-readable: input schema, Markdown. Connect an agent.
Inputs
| Name | Type | Required | What it does |
|---|---|---|---|
value |
number | yes | The amount to convert. From -1e+30 to 1e+30. |
from_unit |
string | yes | Unit to convert from, as a symbol or name. |
to_unit |
string | yes | Unit to convert to, as a symbol or name. |
Examples
Input
{
"value": 10,
"from_unit": "km",
"to_unit": "miles"
}Result
{
"value": 6.21371192237,
"text": "10 km = 6.21371192237 mi",
"from": {
"unit": "kilometre",
"symbol": "km",
"kind": "length"
},
"to": {
"unit": "mile",
"symbol": "mi",
"kind": "length"
},
"factor": 0.621371192237,
"formula": "1 km = 0.621371192237 mi",
"note": null
}Temperature
Input
{
"value": 100,
"from_unit": "C",
"to_unit": "F"
}Result
{
"value": 212,
"text": "100 °C = 212 °F",
"from": {
"unit": "degree Celsius",
"symbol": "°C",
"kind": "temperature"
},
"to": {
"unit": "degree Fahrenheit",
"symbol": "°F",
"kind": "temperature"
},
"factor": null,
"formula": "°F = °C * 9 / 5 + 32",
"note": null
}Binary and decimal data units
Input
{
"value": 1,
"from_unit": "GiB",
"to_unit": "MB"
}Result
{
"value": 1073.741824,
"text": "1 GiB = 1073.741824 MB",
"from": {
"unit": "gibibyte",
"symbol": "GiB",
"kind": "data"
},
"to": {
"unit": "megabyte",
"symbol": "MB",
"kind": "data"
},
"factor": 1073.741824,
"formula": "1 GiB = 1073.741824 MB",
"note": null
}Questions
- What is the difference between MB and MiB?
- MB is 1,000,000 bytes (decimal, used for disk sizes and network speeds). MiB is 1,048,576 bytes (binary, used for memory). The same goes for kB and KiB, GB and GiB.
- Is a gallon the US or the UK one?
- "gal", "pint", "fl oz", "ton" and "mpg" are read as the US measures and a note says so. Use gal_uk, pt_uk, floz_uk, "long ton" and mpg_uk for the imperial ones.
- How long are a month and a year?
- The average Gregorian lengths: a year is 365.2425 days and a month is one twelfth of that. For real calendar dates use date-add.
- How precise are the results?
- Conversions use exact definitions and results are rounded to 12 significant digits.
Related tools
- Calculator and expression evaluatorWork out an arithmetic expression safely: brackets, powers, functions such as sqrt and log, and variables.
math-eval - Duration parser and formatterTurn a duration such as "1h 30m", "PT1H30M" or "1:30:00" into seconds, ISO 8601 and plain words.
duration-parse - Number formatterFormat a number with thousands separators, in scientific or compact form, as an ordinal, or in words.
number-format - Add or subtract time from a dateAdd or subtract years, months, weeks, days, hours and minutes from a date and get the resulting date.
date-add - Age calculatorWork out an exact age in years, months and days on a given date, plus the next birthday.
age-calculator - Aspect ratio calculatorSimplify a width and height to a ratio such as 16:9, and scale to a new width or height.
aspect-ratio