---
title: "Convert between units across 10 categories: length (m, km, mi, ft, in, yd, nmi), mass (kg, lb, oz, g, ton), volume (l, gal, ml, cup, fl_oz), area (m2, ft2, acre, hectare), speed (mps, kph, mph, knot), pressure (pa, psi, bar, atm, mmhg), energy (j, kwh, btu, cal, wh), data (b, kb, mb, gb, tb), time (s, ms, min, hr, day, year), and temperature (c, f, k). Accepts any value with source and target unit abbreviations. Returns the converted result with the formula used."
method: POST
path: "/api/unit_convert"
tags: ["general"]
---

# Convert between units across 10 categories: length (m, km, mi, ft, in, yd, nmi), mass (kg, lb, oz, g, ton), volume (l, gal, ml, cup, fl_oz), area (m2, ft2, acre, hectare), speed (mps, kph, mph, knot), pressure (pa, psi, bar, atm, mmhg), energy (j, kwh, btu, cal, wh), data (b, kb, mb, gb, tb), time (s, ms, min, hr, day, year), and temperature (c, f, k). Accepts any value with source and target unit abbreviations. Returns the converted result with the formula used.

`POST /api/unit_convert`

## Request

- Base URL: `https://calc.engineer`
- URL: `https://calc.engineer/api/unit_convert`
- Auth: none declared

## Request body

- object
  - `value` number, required: The numeric value to convert.
  - `from` string, required: Source unit abbreviation (e.g., 'km', 'lb', 'f', 'psi', 'kwh'). Case-insensitive.
  - `to` string, required: Target unit abbreviation (e.g., 'mi', 'kg', 'c', 'bar', 'btu'). Case-insensitive.

## Response `200`

Computed result for unit_convert

- object
  - `result` object, required
    - `result` number, required: The converted value.
    - `from_unit` string, required: Normalized source unit abbreviation.
    - `to_unit` string, required: Normalized target unit abbreviation.
    - `category` string, required: Unit category (length, mass, volume, area, speed, pressure, energy, data, time, temperature).
    - `formula` string, required: Human-readable conversion formula applied.
  - `tool` string, required
  - `version` string, required
  - `computed_at` string, date-time, required
  - `chain` object, required
    - `feeds` unknown[]
      - unknown
    - `accepts_from` unknown[]
      - unknown

## Other responses

- `400`: Validation error or invalid JSON
- `404`: Tool not found

---

[API](https://skmtc.dev/calc/apis/calc-engineer-api.md) · [All operations](https://skmtc.dev/calc/apis/calc-engineer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/calc/apis/calc-engineer-api/revisions/8830480ec488?raw)
