I have a digital weather station with a wireless outdoor sensor. In the photo, the top right quadrant of the display shows temperature and relative humidity for outdoors (6.2°C/94%) and indoors (21.6°C/55%).

I find this indoor-outdoor thing fascinating for some reason and revel in looking at the numbers. But when I do, I always end up asking myself if the air outside has more or less water vapor in it than the air inside. Simple question, which is more than can be said for the answer. Using the ideal gas law, the calculation of absolute humidity from temperature and relative humidity requires an added algorithm that generates saturated vapor pressure as a function of temperature, which complicates things a bit.

*Formula for calculating absolute humidity*

In the formula below, temperature (T) is expressed in degrees Celsius, relative humidity (rh) is expressed in %, and e is the base of natural logarithms 2.71828 [raised to the power of the contents of the square brackets]:

Absolute Humidity (grams/m^{3}) = 6.112 x e^[(17.67 x T)/(T+243.5)] x rh x 18.02

(273.15+T) x 100 x 0.08314

which simplifies to

Absolute Humidity (grams/m^{3}) = 6.112 x e^[(17.67 x T)/(T+243.5)] x rh x 2.1674

(273.15+T)

This formula is accurate to within 0.1% over the temperature range –30°C to +35°C

**– – – –**

gif format (decimal separator = .)

gif format (decimal separator = ,)

jpg format (decimal separator = .)

jpg format (decimal separator = ,)

**– – – –**

*Additional notes for students*

Strategy for computing absolute humidity, defined as density in g/m^3 of water vapor, from temperature (T) and relative humidity (rh):

1. Water vapor is a gas whose behavior approximates that of an ideal gas at normally encountered atmospheric temperatures.

2. We can apply the ideal gas equation PV = nRT. The gas constant R and the variables T and V are known in this case (T is measured, V = 1 m^{3}), but we need to calculate P before we can solve for n.

3. To obtain a value for P, we can use the following variant^{[REF, eq.10]} of the Magnus-Tetens formula which generates saturated vapor pressure P_{sat} (hectopascals) as a function of temperature T (Celsius):

P_{sat} = 6.112 x e^[(17.67 x T)/(T+243.5)]

4. P_{sat} is the pressure when the relative humidity is 100%. To compute the pressure P for any value of relative humidity expressed in %, we multiply the expression for P_{sat} by the factor (rh/100):

P = 6.112 x e^[(17.67 x T)/(T+243.5)] x (rh/100)

5. We now know P, V, R, T and can solve for n, which is the amount of water vapor in moles. This value is then multiplied by 18.02 – the molecular weight of water – to give the answer in grams.

6. Summary:

The formula for absolute humidity is derived from the ideal gas equation. It gives a statement of n solely in terms of the variables temperature (T) and relative humidity (rh). Pressure is computed as a function of both these variables; the volume is specified (1 m^{3}) and the gas constant R is known.

**– – – –**

UPDATES

**– – – –**

*Author comment: Weather station manufacturers should consider a toggled RH/AH display*

January 2017: Relative humidity (RH) is well understood by people trained in atmospheric science, but for ordinary folk who have an indoor-outdoor thermometer-hygrometer like the device pictured above, RH values can easily be misunderstood.

Consider the data illustrated. I would not blame anyone for thinking there is more water vapor in the air outside, since the RH outside (58%) is more than two-and-a-half times the RH inside (21%).

But the data is deceptive. Plug the numbers into my formula, which computes absolute humidity (AH) as water vapor density in g/m^3, and you will find that the AH inside is ** twice** the AH outside. Could you have predicted that result from looking at the T and RH numbers? Nor could I.

Which is why I think that adding AH as an extra feature could be something for manufacturers of these devices to consider. People understand concepts like mass per unit volume much more easily than percentages of variable temperature-dependent maxima.

For manufacturers, adding AH to the display is a no-brainer. My formula computes AH directly from T and RH, so the RH displays could simply be toggled to show AH. Maybe visitors to this blogpost who are actively involved in microprocessor projects could consider pioneering a prototype?

**– – – –**

*Igor uses my formula to keep his cellar dry*

October 2016: I am impressed by this basement humidity control system developed by Igor and reported on Amperka.ru forum.

Inside the short pipe is a fan equipped with a 3D-printed circumferential seal. The fan replaces basement air with outdoor air, and is activated when absolute humidity in the cellar is 0.5 g/m^3 higher than in the street, subject to the condition that the temperature of the outdoor air is lower. This ensures that water in the cellar walls is drawn into the vapor phase and pumped out; the reverse process cannot occur.

Full details (text in Russian) with lots of excellent photos → **here**

**– – – –**

*Formula powers AH measurements from high-precision RH&T sensor*

April 2016: ** Prof. Antonietta Frani** has made a miniature device for measuring absolute humidity, using my formula to power an Arduino Uno microcontroller board equipped with an SHT75 RH&T sensor which connects to a computer via a USB cable. Systems Integrator

**has developed an interface to transfer the data to Excel spreadsheets with their associated graphical display functions.**

*Roberto Valgolio***– – – –**

*Formula powers online RH←→AH calculator*

March 2016: German website *rechneronline.de* is using my formula to power an online RH/AH conversion calculator.

**– – – –**

*Formula cited in academic research paper*

January 2016: A research article in *Landscape Ecology* (October 2015) exploring microclimatic patterns in urban environments across the United States has used my formula to compute absolute humidity from temperature and relative humidity data.

**– – – –**

*Formula finds use in humidity control unit*

August 2015: Open source software/hardware project Arduino is using my absolute humidity formula in a microcontroller designed to control humidity in basements:

*“The whole idea is to measure the temperature and relative humidity in the basement and on the street, on the basis of temperature and relative humidity to calculate the absolute humidity and make a decision on the inclusion of the exhaust fan in the basement. The theory for the calculation is set forth here – carnotcycle.wordpress.com/2012/08/04/how-to-convert-relative-humidity-to-absolute-humidity.”* [на русском → здесь]

More photos on this link (text in Russian):http://arduino.ru/forum/proekty/kontrol-vlazhnosti-podvala-arduino-pro-mini

**– – – –**

*AH computation procedure applied in calibration of NASA weather satellite*

June 2015: My general procedure for computing AH from RH and T has been applied in the absolute calibration of NASA’s Cyclone Global Navigation Satellite System (CYGNSS), specifically in relation to the RH data provided by Climate Forecast System Reanalysis (CFSR). The only change to my formula is that P_{sat} is calculated using the August-Roche-Magnus expression rather than the Bolton expression.

The CYGNSS system, comprising a network of eight satellites, is designed to improve hurricane intensity forecasts and was launched on 15 December 2016.

Reference: http://ddchen.net/publications (Technical report “An Antenna Temperature Model for CYGNSS” June 2015)

**– – – –**

*Formula cited in draft paper on air quality monitoring*

May 2015: Metal oxide (MO) sensors are used for the measurement of air pollutants including nitrogen dioxide, carbon monoxide and ozone. A draft paper concerning the Air Quality Egg (AQE) which cites my formula in relation to MO sensors can be seen on this link:

MONITORING AIR QUALITY IN THE GRAND VALLEY: ASSESSING THE USEFULNESS OF THE AIR QUALITY EGG

**– – – –**

*Formula used by US Department of Energy in Radiological Risk Assessment*

June 2014: In its report on disused uranium mines, Legacy Management at DoE used my formula for computing absolute humidity as one of the meteorological parameters involved in modeling radiological risk assessment.

**– – – –**

Thanks thanks a lot Peter. Great job and awesome site!! I’ve been searching for a formula like this to calculate directly the water evaporation in sheets of water, taking the data from weather stations which show only RH and T. And finally I found it, so you saved my a** :)

excellent and easy to follow work. Thanks for sharing the information

Hi Pavel and thank you for the question.

Thermodynamics teaches us that vapor pressure is an inherent property of substances contingent only on temperature. It is independent of atmospheric pressure, whether measured at sea level or any other altitude.

Using my formula, all you need to compute the density of water vapor at the point of measurement is the temperature and relative humidity.

So in a meteostation, where both actual pressure and sea level pressure is measured (altitude is known), we should use what equation construction?

I have fulfiled my promice at http://bit.ly/2dCM1zq

Thank You a lot!

Thank You! I’ll take Yours formula to my home project and report You!

Thank you for the question. The Psat variant I use was developed by Bolton* for meteorological purposes as a best-fit in the -30°C to +35°C temperature range. At +40°C, the accuracy is 0.18%. For accuracy better than 0.005% in the +35°C to +60°C range, you could use the Psat formula developed by Wexler; this equation is numbered (9) in Bolton’s paper.

*a mouse-over link to Bolton’s paper has been included under point 3 of “Additional notes for students”

What would be the accuracy of the results of this equation for temperatures above 35°C, say 35-60?

Thank you so much for this wonderful resource!

Hey Peter, thank you so much for the equations. That you bothered to put equations in so many forms is really appreciable. Great work.

Thanks! :)

Hello lou and thank you for your question. The mathematical constant e is not equal to 10; the approximate value is 2.718

You can read more about e here:

http://en.wikipedia.org/wiki/E_(mathematical_constant)

Hello,

I have tried your formula several time but the result I get is not the right one. I have one question, “in the equation where to I get the value for ‘e'”? I thought e would equal 10 but it does not come out with the correct answer.

(following lou’s question, I added text to clarify the value of ‘e’ – PM)

Thanks for asking Martin. Remember you’re dividing by R and multiplying by the molecular weight of water; the factor is 18.02/8.314 = 2.1674

I still dont get the 2.1674 factor. When you devide P/T by R, there is just R_specific left, which should be 8.3/18.02 = 0.4615 . Can you please provide details on your calculation?

Very interesting derivation of AH formula base on RH and T. Thank you very much!

You’re welcome Robert. Regarding the formula: to simplify computation the factor 10^-2 is amalgamated, along with the molecular weight of water in grams and R in m^3.hPa.K^-1.mol^-1, in the 2.1674 figure.

Thank you for the formula. I’ve got one question though, what happens with the factor 1/100?

At 4. it says rh/100 but at the top of the page where you’ve written the formula, 1/100 is gone.

(following Robert’s comment, I added the uncondensed formula at the top of the page to clarify the math – PM)

Thanks a lot for this, which I can use in my reserch work.

Thanks a lot for this.