Forwards: percent to g/m³

Three steps, and the only difficulty is unit bookkeeping.

Step 1 — saturation vapour pressure at the air temperature.

es(T) = 6.112 × exp( 17.62 × T / (243.12 + T) ) T in Celsius, result in hectopascals.

Step 2 — actual vapour pressure. Multiply by the relative humidity as a fraction:

e = es(T) × RH / 100

Step 3 — apply the ideal gas law to the vapour.

ρv = (e × 100) / (461.5 × (T + 273.15)) × 1000 ×100 converts hPa to Pa; ×1000 converts kg/m³ to g/m³.

Worked through

Air at 23.9°C, 60% relative humidity.

  1. eₛ = 6.112 × exp(17.62 × 23.9 / 267.02) = 29.6 hPa
  2. e = 29.6 × 0.60 = 17.8 hPa = 1,780 Pa
  3. ρᵥ = 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.

  1. Vapour pressure from density: e = ρᵥ / 1000 × 461.5 × (T + 273.15), then ÷100 for hPa.
  2. Saturation pressure at the same temperature, as above.
  3. 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:

=1000*(B1/100*6.112*EXP(17.62*A1/(243.12+A1))*100)/(461.5*(A1+273.15)) Returns grams per cubic metre.

And the reverse, with g/m³ in A1 and temperature in Celsius in B1:

=100*(A1/1000*461.5*(B1+273.15)/100)/(6.112*EXP(17.62*B1/(243.12+B1))) Returns relative humidity in percent. Wrap in MIN(100, …) to cap it.

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.