# Relative Humidity Calculator

> Computes relative humidity from air temperature and dew point as the ratio of Magnus-formula vapour pressures, and the absolute humidity (grams of water vapour per cubic metre) from the ideal-gas law for water vapour.

- Calculator id: `relative-humidity` · Category: Weather & Environment (`weather`) · Tool name: `calculate_relative_humidity`
- Canonical page: https://tttkmbb.com/weather/relative-humidity · This document: https://tttkmbb.com/weather/relative-humidity.md · JSON definition: https://tttkmbb.com/weather/relative-humidity.json

## Purpose

Computes relative humidity from air temperature and dew point as the ratio of Magnus-formula vapour pressures, and the absolute humidity (grams of water vapour per cubic metre) from the ideal-gas law for water vapour.

**Use when:** A weather report gives temperature and dew point and you need the relative humidity, or you need the water-vapour content of air in g/m³ (e.g. for drying, greenhouses or HVAC).

**Do not use when:** You have relative humidity and need the dew point (use dew-point), or you need humidity ratio in g/kg of dry air, which also requires the air pressure.

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `temperature` | number |  | required | Air (dry-bulb) temperature in temperature_unit. (min -60, max 140) |
| `dew_point` | number |  | required | Dew point temperature in temperature_unit; cannot exceed the air temperature. (min -80, max 140) |
| `temperature_unit` | enum: c \| f |  | optional, default "c" | Unit of the temperature input(s). |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `relative_humidity_percent` | number | % | RH = 100 × es(Td) / es(T). |
| `absolute_humidity_g_m3` | number | g/m³ | Mass of water vapour per cubic metre of air, e / (Rv × T_K). |
| `vapor_pressure_hpa` | number | hPa | Partial pressure of water vapour, es(Td). |
| `saturation_vapor_pressure_hpa` | number | hPa | es(T) at the air temperature. |
| `saturation_absolute_humidity_g_m3` | number | g/m³ | Water vapour content the air could hold at 100 % RH and this temperature. |
| `dew_point_depression_c` | number | °C | T − Td in Celsius. |
| `comfort` | string |  | NWS dew-point comfort band. |

## Formula

`es(T) = 6.1094·exp(17.625·T/(243.04 + T)) hPa (T in °C); RH = 100·es(Td)/es(T); absolute humidity = 100·es(Td) / (461.5 · (T + 273.15)) kg/m³ × 1000`

Magnus formula with Alduchov & Eskridge (1996) coefficients; water vapour treated as an ideal gas with Rv = 461.5 J/(kg·K). Accurate to about 0.5 % RH for −40 to +50 °C.

## Data Sources

- Alduchov OA, Eskridge RE (1996) Improved Magnus form approximation of saturation vapor pressure, J Appl Meteorol 35:601-609 — https://journals.ametsoc.org/view/journals/apme/35/4/1520-0450_1996_035_0601_imfaos_2_0_co_2.xml (peer_reviewed, retrieved 2026-09-24)
- Wikipedia – Dew point — https://en.wikipedia.org/wiki/Dew_point (reference, retrieved 2026-09-24)

Data freshness: `static`. Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output.

## API

- `GET https://tttkmbb.com/api/v1/calculate/relative-humidity?temperature=…&dew_point=…`
- `POST https://tttkmbb.com/api/v1/calculate/relative-humidity` with JSON body `{"inputs": {…}}`
- Response: unified envelope (`success`, `request`, `result.values`, `result.units`, `sources`, `freshness`, `timestamp`, `next_actions`, `links`); see https://tttkmbb.com/docs/response-format.md
- Schema: https://tttkmbb.com/api/v1/calculators/relative-humidity · OpenAPI operationId `calculate_relative_humidity` in https://tttkmbb.com/openapi.json
- Authentication: none. Rate limit: fair use, see https://tttkmbb.com/docs/rate-limits.md.

## MCP

- Server: `https://tttkmbb.com/mcp` (Streamable HTTP, JSON-RPC 2.0, no auth)
- Tool:  `run_calculator` with `{"calculator_id": "relative-humidity", "inputs": {…}}`

## Example

- 25 °C, dew point 19.15 °C: inputs `{"temperature":25,"dew_point":19.15,"temperature_unit":"c"}` → `{"relative_humidity_percent":70,"absolute_humidity_g_m3":16.09,"vapor_pressure_hpa":22.13,"saturation_vapor_pressure_hpa":31.62,"dew_point_depression_c":5.9}`
- 30 °C, dew point 10 °C: inputs `{"temperature":30,"dew_point":10,"temperature_unit":"c"}` → `{"relative_humidity_percent":28.9,"absolute_humidity_g_m3":8.76,"saturation_absolute_humidity_g_m3":30.28}`

```
GET https://tttkmbb.com/api/v1/calculate/relative-humidity?temperature=25&dew_point=19.15&temperature_unit=c
```

## Limitations

You have relative humidity and need the dew point (use dew-point), or you need humidity ratio in g/kg of dry air, which also requires the air pressure. Magnus formula with Alduchov & Eskridge (1996) coefficients; water vapour treated as an ideal gas with Rv = 461.5 J/(kg·K). Accurate to about 0.5 % RH for −40 to +50 °C. All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Can relative humidity exceed 100 %?**

Not in this calculator: a dew point above the air temperature is physically impossible for saturated equilibrium and returns an error.

**What is the difference between absolute humidity and humidity ratio?**

Absolute humidity is grams of vapour per cubic metre of moist air; the humidity ratio (mixing ratio) is grams of vapour per kilogram of dry air and needs the total air pressure.

## Related

- [Dew Point Calculator](https://tttkmbb.com/weather/dew-point.md) — Inverse: dew point from temperature and relative humidity.
- [Air Density Calculator](https://tttkmbb.com/weather/air-density.md) — Density of moist air from temperature, pressure and humidity.
- [Heat Index Calculator](https://tttkmbb.com/weather/heat-index.md) — Apparent temperature from temperature and humidity.
