curatedapi

Temperature converter

Convert temperatures between Celsius, Fahrenheit, kelvin and Rankine.

The temperature (or temperature difference) to convert.
Scale of the value. Options: C: degree Celsius; K: kelvin; F: degree Fahrenheit; R: degree Rankine
Scale to convert to. Omit to convert to every scale. Options: C: degree Celsius; K: kelvin; F: degree Fahrenheit; R: degree Rankine
Whether the value is a reading or a difference between two readings. Options: reading: a temperature reading, like 20 °C; difference: a change or interval, like a rise of 5 °C
More options: rounding and decimals
Precision and rounding
Rounding mode applied once to each result. Default half_even.
Round results to this many digits after the decimal point.
Round results to this many significant digits.

Examples

Result: Body temperature in Celsius

Result
The converted temperature.
37 exact

Rounding: Half even, 15 significant digits. Calculator units/temperature@1.

How it is calculated

K = °C + 273.15; °F = K × 9/5 − 459.67; °R = K × 9/5 (differences: no offsets)

Converts a temperature reading, or a temperature difference, between scales. A reading uses the scale offsets (0 °C = 32 °F); a difference does not (a rise of 10 °C is a rise of 18 °F). All factors are exact.

  • Readings below absolute zero are rejected. Differences may be negative.

References

Results follow each calculator's documented rules and the sources listed. They are not financial, tax or legal advice. Check that the rules fit your case before you rely on a result. See the terms.

Use it from your code

POST /v1/calc/units/temperatureVersion 1
curl https://api.curatedapi.com/v1/calc/units/temperature \
  -H "Authorization: Bearer $CURATEDAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "value": "98.6",
    "from_unit": "F",
    "to_unit": "C"
  }'
The same call in Python
import os

import requests

payload = {
    "value": "98.6",
    "from_unit": "F",
    "to_unit": "C",
}
response = requests.post(
    "https://api.curatedapi.com/v1/calc/units/temperature",
    headers={"Authorization": f"Bearer {os.environ['CURATEDAPI_KEY']}"},
    json=payload,
    timeout=10,
)
print(response.json()["result"])
The same call in JavaScript
const payload = {
    "value": "98.6",
    "from_unit": "F",
    "to_unit": "C",
};
const response = await fetch("https://api.curatedapi.com/v1/calc/units/temperature", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.CURATEDAPI_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify(payload),
});
console.log((await response.json()).result);

MCP tool calc_units_temperature at https://mcp.curatedapi.com. Inputs, outputs and errors in the API reference.

Put it on your website

<div data-curatedapi-widget="units/temperature" data-key="capi_public_…"></div>
<script src="https://widgets.curatedapi.com/v1/widget.js" async></script>

Use a public key registered for your site. Calculations are billed like API calls. How widgets work.

Related calculators

Add this calculator to your website

Paste two lines into your page and your visitors get this calculator. Each use counts as one call on your plan, the same as the API.

Free for up to 1,000 uses a month. 50,000 uses a month cost $9.00 on the Starter plan.