Unit Conversion
The /convert endpoint allows you to convert values between units of the same category. You need to provide a value to convert, a source unit, and the target unit.
gethttps://api.moxon.dev /v5/convert
Try itget/v5/convert
curl -X GET \ "https://api.moxon.dev/v5/convert"Send the request to see the response here.
valuestringrequiredThe numeric value to convert
fromstringrequiredThe source unit (see available units below)
- celsius
- fahrenheit
- kelvin
- km
- mi
- m
- ft
- cm
- in
- yd
- kg
- lb
- oz
- g
- ton
- b
- kb
- mb
- gb
- tb
- km/h
- mph
- m/s
- knots
tostringrequiredThe target unit (must be in the same category as
from)- celsius
- fahrenheit
- kelvin
- km
- mi
- m
- ft
- cm
- in
- yd
- kg
- lb
- oz
- g
- ton
- b
- kb
- mb
- gb
- tb
- km/h
- mph
- m/s
- knots
Temperature:
| Unit | Description |
|---|---|
celsius | Celsius degrees |
fahrenheit | Fahrenheit degrees |
kelvin | Kelvin |
Length:
| Unit | Description |
|---|---|
km | Kilometers |
mi | Miles |
m | Meters |
ft | Feet |
cm | Centimeters |
in | Inches |
yd | Yards |
Weight:
| Unit | Description |
|---|---|
kg | Kilograms |
lb | Pounds |
oz | Ounces |
g | Grams |
ton | Metric tons |
Data:
| Unit | Description |
|---|---|
b | Bytes |
kb | Kilobytes |
mb | Megabytes |
gb | Gigabytes |
tb | Terabytes |
Speed:
| Unit | Description |
|---|---|
km/h | Kilometers/hour |
mph | Miles/hour |
m/s | Meters/second |
knots | Knots |
fromstringSource unit
tostringTarget unit
valuenumberOriginal value to convert
resultnumberConverted value
If parameters are missing or invalid, the API will return an error:
- 400
Please provide a valid value (?value={value})Thevalueparameter is missing or invalid - 400
Please provide a valid source unit (&from={unit})Thefromparameter is missing or invalid - 400
Please provide a valid target unit (&to={unit})Thetoparameter is missing or invalid - 400
Value must be a numberThe value is not a valid number - 400
Invalid conversion unitThefrom/tocombination is not valid - 400
Value must be greater than absolute zeroThe value is below absolute zero (temperature only)
Last updated on May 25, 2026