Forwards: percent to g/m³
Three steps, and the only difficulty is unit bookkeeping.
Step 1 — saturation vapour pressure at the air temperature.
Step 2 — actual vapour pressure. Multiply by the relative humidity as a fraction:
Step 3 — apply the ideal gas law to the vapour.
Worked through
Air at 23.9°C, 60% relative humidity.
- eₛ = 6.112 × exp(17.62 × 23.9 / 267.02) = 29.6 hPa
- e = 29.6 × 0.60 = 17.8 hPa = 1,780 Pa
- ρᵥ = 1,780 / (461.5 × 297.05) × 1000 = 12.9 g/m³
Backwards: g/m³ to percent
The same chain reversed. Note you still need the temperature — a quantity of water is not a percentage of anything until you know what the ceiling is.
- Vapour pressure from density: e = ρᵥ / 1000 × 461.5 × (T + 273.15), then ÷100 for hPa.
- Saturation pressure at the same temperature, as above.
- Divide and scale: RH = 100 × e / eₛ(T).
Cap the answer at 100%. A figure above saturation means liquid water suspended in the air — fog — rather than a humidity above 100%.
As one spreadsheet formula
With temperature in Celsius in A1 and relative humidity in percent in B1:
And the reverse, with g/m³ in A1 and temperature in Celsius in B1:
The three unit traps
Almost every wrong answer in this conversion comes from one of these:
- Celsius and kelvin in the same calculation. Magnus wants Celsius. The gas law wants kelvin. Both appear in step 3.
- Hectopascals and pascals. Meteorology quotes hPa; the gas constant expects Pa. Factor of 100.
- Kilograms and grams. The gas law gives kg/m³. Everyone quotes g/m³. Factor of 1000.
Get all three right and the answer is correct to well under a percent. Get one wrong and it will be out by a factor of 100 or 1000, which at least makes the mistake obvious.
Why you might want the mixing ratio instead
If the reason for converting is to compare two air masses, be aware that g/m³ is a density and drifts slightly as air expands. The mixing ratio in g/kg does not, and its conversion is w = 621.97 × e / (p − e) — one step from the same vapour pressure, but it needs the station pressure.
For a single reading at ground level the difference does not matter. For following one parcel of air around, it does.