# Temperature convert

`temperature-convert` · version 1.0.0 · Units & sizes · free, no key needed

Convert a decimal temperature between Celsius, Fahrenheit, and Kelvin as an exact rational.

**Use when you need to: temperature convert · convert temperature between C F K · celsius fahrenheit kelvin conversion.**

## Supported

- temperature convert
- convert temperature between C F K
- celsius fahrenheit kelvin conversion

## Not supported

- Rankine
- Reaumur
- IEEE-754 floats
- weather APIs
- locale formatted temperatures

## Behavior

- value is a canonical decimal string parsed as an exact rational; Number and parseFloat are not used.
- from and to are exactly C, F, or K.
- Kelvin is Celsius plus 273.15, with 273.15 equal to 5463/20.
- Fahrenheit is Celsius times 9/5 plus 32.
- Temperatures below absolute zero (K < 0) are rejected.
- The output value is the reduced canonical rational in the target unit.

## Input

- `value` (string, required): max length 32
- `from` (one of "C", "F", "K", required)
- `to` (one of "C", "F", "K", required)

## Output

- `value` (object, required)
- `unit` (one of "C", "F", "K", required)

## Limits

- max digits before point: 20
- max fractional digits: 10

## Example

Request input:

```json
{
  "value": "100",
  "from": "C",
  "to": "F"
}
```

Response:

```json
{
  "result": {
    "value": {
      "numerator": "212",
      "denominator": "1"
    },
    "unit": "F"
  }
}
```

## How to call it

### MCP

Connect `https://computefirst.net/mcp` ([setup](/docs#connect)), then call `execute` with:

```json
{
  "id": "temperature-convert",
  "version": "1.0.0",
  "input": {
    "value": "100",
    "from": "C",
    "to": "F"
  }
}
```

### HTTP (no key)

```sh
curl -X POST https://computefirst.net/v1/tools/temperature-convert/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"value":"100","from":"C","to":"F"}'
```

The machine-readable contract is at [/v1/tools/temperature-convert/versions/1.0.0](/v1/tools/temperature-convert/versions/1.0.0).

### CLI

```sh
node cli.mjs run temperature-convert 1.0.0 --input input.json --base-url https://computefirst.net
```

Get the client at [/clients/cli/](/clients/cli/).

## Related tools

- [Temperature compare](/tools/temperature-compare): Compare two temperatures in C, F, or K by converting both to Kelvin rationals.
- [Length convert](/tools/length-convert): Convert a canonical integer length between exact SI and international customary units.
- [Byte size convert](/tools/bytesize-convert): Convert a non-negative integer byte size between IEC binary units as an exact rational.
- [Mass convert](/tools/mass-convert): Convert a canonical integer mass amount between exact nanogram-based units as a reduced rational.
- [Byte size add](/tools/bytesize-add): Add non-negative integer byte-size terms in mixed IEC units and return the exact sum in a chosen unit.
- [Byte size compare](/tools/bytesize-compare): Compare two non-negative integer byte sizes by exact byte amounts.
