The ideal gas law relates the pressure, volume, temperature and amount of a gas: PV = nR_uT on a molar basis, or PV = mRT on a mass basis. It is accurate for most gases at low pressure and high temperature relative to their critical point, which covers air, nitrogen and many other gases at everyday conditions.
Last updated
Two forms of the same law
On a molar basis, PV = nR_uT, where n is the amount in moles and R_u is the universal gas constant, 8.314 J/(mol·K), the same for every gas.
Engineers often work in mass, so they divide R_u by the gas’s molar mass M to get its specific gas constant R = R_u / M. Then PV = mRT. For air, M ≈ 28.97 kg/kmol, so R ≈ 0.287 kJ/(kg·K).
For a fixed mass of gas moving from one state to another, R and m cancel and the law becomes the combined gas law, P₁V₁/T₁ = P₂V₂/T₂. Boyle’s and Charles’s laws are its constant-temperature and constant-pressure cases.
Absolute pressure and temperature
The law only works with absolute values. Temperature must be in kelvin (K = °C + 273.15) or rankine. Pressure must be absolute: a gauge reads pressure above the atmosphere, so P_abs = P_gauge + P_atm. Standard atmospheric pressure is 101.325 kPa.
A tire gauge that reads 220 kPa is measuring about 321 kPa absolute. Using the gauge value directly is the most common error in ideal-gas problems.
When the ideal gas model holds
Real molecules take up space and attract each other. The ideal gas model ignores both, which is a good approximation when the gas is far from condensing: at pressures well below its critical pressure, or temperatures well above its critical temperature.
The compressibility factor Z = Pv/(RT) measures the error. Z = 1 for an ideal gas. When Z differs noticeably from 1, use a generalized compressibility chart or property tables. Steam and refrigerants near saturation need tables, not PV = mRT.
Ideal-gas results feed straight into the first law for closed systems, where they give the mass of gas and the final pressure.
Key formulas
Formulas used on this page, with the textbook each is cited from
Formula
Expression
Where
Cited from
Ideal gas law, molar form
P·V = n·R_u·T
R_u = 8.314 J/(mol·K) = 8.314 kJ/(kmol·K)
CODATA value via NIST; form from Çengel & Boles
Ideal gas law, mass form
P·V = m·R·T
R = R_u / M, specific to each gas
Çengel & Boles, Thermodynamics: An Engineering Approach
Combined gas law
P₁V₁ / T₁ = P₂V₂ / T₂
fixed mass, absolute P and T
Moran & Shapiro, Fundamentals of Engineering Thermodynamics
Compressibility factor
Z = P·v / (R·T)
v = specific volume; Z = 1 for an ideal gas
Çengel & Boles, Thermodynamics: An Engineering Approach
Absolute pressure
P_abs = P_gauge + P_atm
P_atm = 101.325 kPa at standard conditions
Çengel & Boles, Thermodynamics: An Engineering Approach
Worked examples
Example: Mass of air in a compressor receiver tank
Given
A 0.5 m³ air receiver tank reads 700 kPa on its gauge at 25 °C.
Atmospheric pressure is 101.325 kPa.
For air, R = 0.287 kJ/(kg·K). Air at these conditions is far above its critical temperature (about 133 K), so the ideal gas model applies.
Overnight the tank cools to 10 °C with no air drawn off.
Find
The mass of air in the tank, and the gauge reading after it cools.
Solution
Absolute pressure and temperature:P₁ = 700 + 101.325 = 801.3 kPa; T₁ = 25 + 273.15 = 298.15 K
Mass from PV = mRT (kPa·m³ = kJ, so the units cancel to kg):m = P₁V / (R·T₁) = (801.3 × 0.5) / (0.287 × 298.15) = 400.7 / 85.57 = 4.68 kg
Rigid tank with fixed mass, so V and m cancel in the combined gas law:P₂ = P₁·(T₂ / T₁) = 801.3 kPa × (283.15 / 298.15) = 761.0 kPa (absolute)
Convert back to gauge pressure:P₂,gauge = 761.0 − 101.3 = 659.7 kPa
Answer: The tank holds about 4.68 kg of air, and the gauge drops from 700 kPa to about 660 kPa as it cools. No air leaked; only the temperature changed.
Example: Moles, mass and a compression for nitrogen
Given
A 20 L vessel holds nitrogen at 250 kPa absolute and 295 K.
The molar mass of nitrogen is 28.013 g/mol, and R_u = 8.314 J/(mol·K).
The gas is then compressed to 8 L, and its temperature rises to 340 K. Nitrogen’s critical pressure is about 3.4 MPa, so both states are low-pressure.
Find
The amount of nitrogen in moles and grams, and the final pressure.
Solution
Convert to SI base units:P₁ = 250 000 Pa; V₁ = 20 L = 0.020 m³
Final pressure from the combined gas law:P₂ = P₁·(V₁ / V₂)·(T₂ / T₁) = 250 kPa × (20 / 8) × (340 / 295) = 720.3 kPa
Answer: n ≈ 2.04 mol (about 57.1 g of nitrogen), and P₂ ≈ 720 kPa absolute. The volume change alone would give 625 kPa; the temperature rise adds the rest.
Common mistakes
Using gauge pressure. Add atmospheric pressure first. Convert back to gauge at the end only if the question asks for a gauge reading.
Using °C or °F. Convert to kelvin (or rankine) before every ideal-gas calculation, including ratios like T₂/T₁.
Mixing R_u and R. R_u goes with moles; R = R_u / M goes with mass. Check the units: J/(mol·K) or kJ/(kg·K).
Leaving volume in litres with pressure in pascals. 1 L = 0.001 m³. Pa·m³ = J, and kPa·m³ = kJ, so pick a consistent pair.
Applying PV = mRT to steam or a refrigerant near saturation. Close to condensing, Z is far from 1. Use property tables for those states.
In industry
Frequently asked questions
What is the value of R for air?
About 0.287 kJ/(kg·K), which is the universal gas constant 8.314 kJ/(kmol·K) divided by air’s molar mass of about 28.97 kg/kmol.
Why must temperature be absolute?
The law says pressure is proportional to temperature at fixed volume. That only works on a scale whose zero means zero molecular kinetic energy. On the Celsius scale, doubling 10 °C to 20 °C does not double the pressure.
Is the ideal gas law accurate for compressed air at 10 bar?
Generally yes. Air at room temperature is far above its critical temperature and 10 bar is well below its critical pressure, so the compressibility factor stays close to 1. For high-pressure work, check Z.
What is the difference between PV = nRT and PV = mRT?
They are the same law. One counts the gas in moles with the universal constant; the other counts it in kilograms with the gas’s specific constant.