ForHosting KIT · Data & Files

Convert units

5 km is 3.106864 miles. Convert lengths, weights, volumes, temperatures, areas and storage sizes between the units people use in shops, labs and kitchens, with Celsius, Fahrenheit and Kelvin offsets handled correctly. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Converted value
5
Source unit
km
Target unit
mi
You get
Converted value
3.106864

Every product catalog, shipping form and scientific dataset eventually has to speak more than one system of measurement.

One value, two systems of measurement

Every product catalog, shipping form and scientific dataset eventually has to speak more than one system of measurement. The converter covers the categories that come up in commerce and engineering: length, such as meters and feet; weight, such as kilograms and ounces; volume, such as liters and fluid ounces; temperature in Celsius, Fahrenheit and Kelvin; area, such as square feet and hectares; and digital storage, including the decimal versus binary confusion between megabytes and mebibytes. You enter a value, a starting unit and a target unit, and you get the converted number.

Where conversions usually go wrong

Temperature is the classic trap: it is not a simple multiplication, because the scales start at different points, and that offset is where home-made formulas most often break. The second trap is a mislabeled ounce, fluid or weight, and the third is a decimal cut short along the way. Typical uses are a shop showing weights and sizes in both metric and imperial, a logistics team bringing supplier sheets that mix kilograms, pounds and stones into one unit, lab readings reported for readers in the US and elsewhere, and recipes switching between milliliters, cups and fluid ounces.

The categories under the hood

Length, weight/mass, volume, temperature, area and digital storage are covered, each with the units people actually use in commerce and engineering: meters and feet, kilograms and ounces, liters and fluid ounces, Celsius/Fahrenheit/Kelvin, square feet and hectares, and the perennial confusion of decimal versus binary data units (megabytes versus mebibytes). Temperature conversions handle their non-linear offsets correctly instead of being treated as a simple multiplier, which is where hand-rolled conversion code most often breaks.

Precision as a habit, not an afterthought

Unit conversion looks trivial until a mislabeled ounce (fluid vs. weight) or a truncated decimal costs someone real money or a failed shipment. Treating it as a dedicated, tested service rather than an inline snippet is a small decision that quietly prevents a whole class of bugs.

E-commerce catalogs

Display product weight and dimensions in both metric and imperial automatically based on the shopper's region, without maintaining two parallel data fields.

Import/export logistics

Normalize supplier data sheets that mix kilograms, pounds and stones into a single consistent unit before it hits your warehouse system.

Scientific and engineering tools

Convert lab measurements or sensor readings between metric and imperial for reports that need to satisfy both US and international readers.

Recipe and nutrition apps

Switch between milliliters, cups and fluid ounces on demand so a single recipe database serves cooks anywhere.

Does it handle temperature correctly, including the offset?

Yes. Celsius, Fahrenheit and Kelvin conversions apply the correct offset math, not a simple multiplier, avoiding the classic scaling bug.

Can I convert data storage units like GB to GiB?

Yes, the digital data category distinguishes decimal (SI) units like gigabytes from binary units like gibibytes, which are commonly confused.

What happens if I send an unsupported unit pair?

The task fails with a clear error after up to three retries, and — per policy — a failed task is never charged.

How many miles is 5 km?

5 kilometers is 3.106864 miles. Enter the value, pick kilometers as the starting unit and miles as the target, and the same works for meters to feet or liters to fluid ounces.

Is a fluid ounce the same as an ounce of weight?

No. A fluid ounce measures volume and an ounce measures weight, so they live in different categories. Mixing them up is a classic labeling mistake that can wreck a recipe or a shipment.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/data/convert-units

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/data/convert-units \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":100,"from":"km","to":"mi"}'
{
  "value": 100,
  "from": "km",
  "to": "mi"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "data.convert_units",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_mb25
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

The unit conversion API takes a value, a source unit and a target unit, and hands back a precise numeric result in JSON — no lookup tables to maintain, no rounding surprises baked into your own code.

Why this exists

Teams shipping to both metric and imperial markets end up writing the same conversion helper three or four times across different services, and it inevitably drifts: one function rounds centimeters differently than another, temperature offsets get typo'd, and nobody remembers which service is right. This endpoint centralizes that logic once, so a checkout page, a warehouse system and a mobile app can all call the same source of truth instead of trusting their own copy-pasted math.

What you send and get back

POST a value, a from-unit and a to-unit — say, kilograms to pounds, liters to gallons, Celsius to Fahrenheit, square meters to acres, or gigabytes to gibibytes — and the task runs asynchronously. You get a task_id immediately, and the converted value arrives moments later through a signed webhook or a signed link valid for 24 hours, whichever fits your pipeline better.

Fitting it into automation

Because the endpoint is stateless and async by design, it drops cleanly into batch jobs — normalize a supplier's spreadsheet of mixed units before importing it, localize product specs for a storefront, or standardize IoT sensor readings coming in from devices calibrated in different regions. Each call is billed only on success, so a malformed request or an unsupported unit pair never costs you anything.

What unit categories does the unit conversion API support?

Length, weight/mass, volume, temperature, area and digital data (bytes, kilobytes, mebibytes, gigabytes and related units).

Is there a free tier for this API?

The tool above runs free in your browser. The API is paid — each call draws from your prepaid ForHosting KIT balance: top up from $10.00 (it never expires), pay each request's published price, and a call with no balance returns HTTP 402. No subscription, no tokens, and a failed task is never charged.

How much does each conversion cost?

$0.002 per request, billed only when the task succeeds — a failed or invalid request is never charged.

How do I get the result — polling or webhook?

The call is asynchronous: you receive a task_id right away, and the result is delivered via a signed webhook (recommended) or a signed link valid for 24 hours.

Is this suitable for bulk conversion jobs?

Yes. Because each request is independent and async, it's well suited to batch pipelines converting large spreadsheets or datasets one call at a time.

Read the full KIT documentation →