Ideal Gas Law Calculator

Solve PV = nRT for any variable with unit conversions.

Ideal Gas Law:

  • PV = nRT
  • R = 8.314 J/(mol·K) = 0.08206 L·atm/(mol·K)
  • STP: 0°C, 1 atm, 22.4 L/mol

Deriving PV = nRT

The ideal gas law combines three experimentally established relationships. Boyle's Law states that at constant temperature, pressure and volume are inversely proportional (PV = constant). Charles's Law states that at constant pressure, volume is proportional to absolute temperature (V / T = constant). Gay-Lussac's Law states that at constant volume, pressure is proportional to absolute temperature (P / T = constant). Avogadro's Law adds that equal volumes of gas at the same temperature and pressure contain equal numbers of molecules. Combining all four gives PV = nRT, where n is the amount in moles and R is the universal gas constant.

R = 8.314 J/(mol·K) = 8.314 Pa·m³/(mol·K) = 0.08206 L·atm/(mol·K). Temperature must always be in kelvin (K = °C + 273.15).

STP, NTP, and Molar Volume

Standard Temperature and Pressure (STP) is defined by IUPAC as 0 °C (273.15 K) and 100 kPa. At STP, one mole of ideal gas occupies 22.711 L. The older definition used 1 atm (101.325 kPa) and gave 22.414 L/mol, which is still frequently cited in textbooks. NTP (Normal Temperature and Pressure) uses 20 °C and 1 atm, giving a molar volume of 24.04 L. These standard volumes are useful for quick stoichiometric calculations involving gases.

Worked Example

Problem: 2 mol of nitrogen gas at 300 K is placed in a 50 L container. What is the pressure?

P = nRT / V = (2 mol × 8.314 J/(mol·K) × 300 K) / (0.050 m³) = 99,768 Pa ≈ 0.985 atm

Note: volume must be in m³ when R is in J/(mol·K). 50 L = 0.050 m³.

Real Gas Deviations

The ideal gas law assumes molecules have no volume and exert no intermolecular forces — valid approximations at low pressure and high temperature. Real gases deviate significantly at high pressure (molecules occupy a non-negligible fraction of the container) and low temperature (intermolecular attractions become significant). The van der Waals equation corrects for these effects: (P + a/V²)(V - b) = nRT, where a accounts for intermolecular attraction and b for molecular volume. For most engineering calculations at ambient conditions, the ideal gas law is accurate to within 1%.

Worked Examples

Example 1 — Tire pressure on a cold morning. A tire at 32 psi gauge (about 46.7 psi absolute) at 25 °C (298 K) on a trip drops to −10 °C (263 K) overnight. Assuming constant volume, P₂ = P₁ × T₂/T₁ = 46.7 × 263/298 = 41.2 psi absolute = 26.5 psi gauge — a drop of 5.5 psi, large enough to trigger the TPMS warning.

Example 2 — Helium balloon at altitude. A 10 L balloon at sea level (1 atm, 20 °C = 293 K) rises to 5 000 m where P = 0.533 atm and T = 255 K. Combined gas law: V₂ = V₁ × (P₁/P₂) × (T₂/T₁) = 10 × (1/0.533) × (255/293) = 16.3 L. The balloon expands 63% — which is why high-altitude research balloons are launched only partially inflated.

Example 3 — Moles of air in a room. A 4 m × 5 m × 2.5 m office = 50 m³ at 20 °C (293 K) and 101 325 Pa. n = PV/(RT) = (101 325 × 50) / (8.314 × 293) = 2 079 mol, or about 60 kg of air (29 g/mol average).

Example 4 — Scuba tank capacity. A 12 L steel cylinder filled to 230 bar at 20 °C holds n = PV/(RT) = (2.3 × 10⁷ × 0.012) / (8.314 × 293) = 113.3 mol. Expanded to atmospheric pressure, that is 113.3 × 24.04 = 2 724 L = 2.72 m³ of breathable air — about 50 minutes for a relaxed diver at surface.

Common Pitfalls

  • Using Celsius instead of Kelvin. Doubling T from 20 °C to 40 °C is a 7% absolute increase (293 K → 313 K), not 100%. Always convert first.
  • Mixing unit systems for R. Use R = 8.314 J/(mol·K) with Pa and m³, or R = 0.08206 L·atm/(mol·K) with atm and L. Never cross them.
  • Gauge vs absolute pressure. Tire gauges read above atmosphere. For PV = nRT, use absolute pressure (gauge + 1 atm).
  • Extrapolating to condensation. The ideal gas law breaks down near boiling/condensation. Water vapour near 100 °C and 1 atm is still roughly ideal; steam at 400 °C and 200 bar is not.
  • Forgetting that PV = nRT applies to the total gas mix. For a mixture, P is total pressure and n is total moles (Dalton's law of partial pressures gives per-species detail).

Frequently Asked Questions

When does the ideal gas law fail? At high pressure (>10 atm) or low temperature (near condensation). For ambient air, CO₂ below 50 atm, and most industrial applications at moderate conditions, errors stay under 1%.

Why is 22.414 L/mol still cited? It is the molar volume at the older STP definition (1 atm, 0 °C). IUPAC redefined STP in 1982 to 100 kPa, giving 22.711 L/mol. Textbooks are slow to update; both show up in practice.

Does the gas law apply to a balloon with air trapped inside? Yes, as long as the air is not near condensing. The balloon walls exert extra pressure due to elasticity, so internal pressure slightly exceeds atmospheric — but the gas inside still obeys PV = nRT.

Why does a spray can get cold when you use it? Rapid depressurisation causes adiabatic expansion — gas doing work on its surroundings loses internal energy, so temperature drops. This is the same principle refrigeration uses.

What is the Boltzmann-constant version? PV = NkT, where N is molecule count and k = 1.381 × 10⁻²³ J/K. It is equivalent to PV = nRT; R = Nₐ × k, where Nₐ is Avogadro's number.

Related Calculators

For other chemistry tools try the Molar Mass Calculator to convert between moles and grams, and the Half-Life Calculator for radioactive decay problems. For pressure and temperature unit work, see the Temperature Converter. Browse the Science category for more.

Disclaimer

This calculator is provided for educational and informational purposes only. While we strive for accuracy, users should verify all calculations independently. We are not responsible for any errors, omissions, or damages arising from the use of this calculator.


Also in Science