# Air Density Calculator

> Computes the density of humid air from temperature, station pressure and relative humidity as a mixture of ideal gases (dry air plus water vapour, vapour pressure from the Magnus formula), and the ISA density altitude.

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

## Purpose

Computes the density of humid air from temperature, station pressure and relative humidity as a mixture of ideal gases (dry air plus water vapour, vapour pressure from the Magnus formula), and the ISA density altitude.

**Use when:** You need air density for aerodynamics, engine or fan performance, ballistics or HVAC, or the density altitude for aircraft performance planning.

**Do not use when:** You only have sea-level (QNH) pressure and no elevation (convert to station pressure with pressure-altitude first), or you need gas density for a gas other than air (use ideal-gas-law).

## Input

| Parameter | Type | Unit | Required | Description |
| --- | --- | --- | --- | --- |
| `temperature` | number |  | required | Air temperature in temperature_unit. (min -80, max 140) |
| `temperature_unit` | enum: c \| f |  | optional, default "c" | Unit of the temperature input(s). |
| `pressure` | number |  | required | Actual barometric pressure at the location, in pressure_unit (not the sea-level-corrected QNH/altimeter setting). (> 0, max 1200) |
| `pressure_unit` | enum: hpa \| kpa \| inhg \| mmhg |  | optional, default "hpa" | Unit of the pressure input. |
| `relative_humidity_percent` | number | % | optional, default 0 | Relative humidity in percent; 0 gives dry air. (min 0, max 100) |

## Output

| Field | Type | Unit | Description |
| --- | --- | --- | --- |
| `air_density_kg_m3` | number | kg/m³ | Density of the moist air. |
| `air_density_lb_ft3` | number | lb/ft³ | Same density in pounds per cubic foot. |
| `dry_air_density_kg_m3` | number | kg/m³ | Density at the same temperature and pressure with 0 % humidity, for comparison. |
| `vapor_pressure_hpa` | number | hPa | Partial pressure of water vapour. |
| `percent_of_isa_sea_level` | number | % | Density as a percentage of 1.225 kg/m³ (ISA, 15 °C, 1013.25 hPa, dry). |
| `density_altitude_m` | number | m | Altitude in the ISA at which dry air would have this density. |
| `density_altitude_ft` | number | ft | Density altitude in feet. |

## Formula

`pv = RH/100 · 6.1094·exp(17.625·T/(243.04 + T)) hPa; ρ = (p − pv)·100/(287.058·T_K) + pv·100/(461.495·T_K); density altitude = 44330.8 × [1 − (ρ/1.225)^0.23497] m`

Ideal-gas mixture with Rd = 287.058 and Rv = 461.495 J/(kg·K); the compressibility factor (≈ 0.9996 at sea level) is ignored. Density altitude inverts the ISA troposphere density profile (exponent 1/(g·M/(R·L) − 1)).

## Data Sources

- Wikipedia – Density of air (humid air, density altitude) — https://en.wikipedia.org/wiki/Density_of_air (reference, retrieved 2026-09-24)
- NWS El Paso – Density altitude formula — https://www.weather.gov/media/epz/wxcalc/densityAltitude.pdf (government, retrieved 2026-09-24)
- Wikipedia – International Standard Atmosphere (ICAO Doc 7488) — https://en.wikipedia.org/wiki/International_Standard_Atmosphere (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/air-density?temperature=…&pressure=…`
- `POST https://tttkmbb.com/api/v1/calculate/air-density` 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/air-density · OpenAPI operationId `calculate_air_density` 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": "air-density", "inputs": {…}}`

## Example

- ISA sea level: 15 °C, 1013.25 hPa, dry: inputs `{"temperature":15,"temperature_unit":"c","pressure":1013.25,"pressure_unit":"hpa","relative_humidity_percent":0}` → `{"air_density_kg_m3":1.225,"dry_air_density_kg_m3":1.225,"percent_of_isa_sea_level":100,"density_altitude_m":0,"density_altitude_ft":0}`
- 30 °C, 1000 hPa, 50 % RH: inputs `{"temperature":30,"temperature_unit":"c","pressure":1000,"pressure_unit":"hpa","relative_humidity_percent":50}` → `{"air_density_kg_m3":1.1399,"dry_air_density_kg_m3":1.1491,"vapor_pressure_hpa":21.18,"air_density_lb_ft3":0.07116,"density_altitude_m":743,"density_altitude_ft":2439}`

```
GET https://tttkmbb.com/api/v1/calculate/air-density?temperature=15&temperature_unit=c&pressure=1013.25&pressure_unit=hpa&relative_humidity_percent=0
```

## Limitations

You only have sea-level (QNH) pressure and no elevation (convert to station pressure with pressure-altitude first), or you need gas density for a gas other than air (use ideal-gas-law). Ideal-gas mixture with Rd = 287.058 and Rv = 461.495 J/(kg·K); the compressibility factor (≈ 0.9996 at sea level) is ignored. Density altitude inverts the ISA troposphere density profile (exponent 1/(g·M/(R·L) − 1)). All values are computed from the formula above; no measurement or live data is involved.

## FAQ

**Why is humid air lighter than dry air?**

Water vapour (molar mass 18 g/mol) displaces nitrogen and oxygen (29 g/mol average) at the same pressure, so the mixture has lower density; at 30 °C the effect is about 1 %.

**Which pressure should I enter?**

The station (absolute) pressure. Weather reports usually give sea-level-reduced pressure; use pressure-altitude with your elevation to derive the station pressure first.

**How does density altitude affect aircraft?**

Higher density altitude means less lift, less engine power and less propeller thrust: takeoff distances grow and climb rates fall; pilots use it in performance charts.

## Related

- [Pressure Altitude Calculator](https://tttkmbb.com/weather/pressure-altitude.md) — Convert QNH and elevation to station pressure and pressure altitude.
- [Ideal Gas Law Calculator](https://tttkmbb.com/chemistry/ideal-gas-law.md) — General PV = nRT calculations.
- [Dew Point Calculator](https://tttkmbb.com/weather/dew-point.md) — Humidity measures used in the vapour-pressure term.
