Ideal Gas Law Calculator
Calculate pressure, volume, moles, or temperature using the ideal gas law PV = nRT. Supports multiple units and shows conversions. See also our Carnot Efficiency Calculator and Boiling Point Calculator.
How to Use the Ideal Gas Law
The ideal gas law (PV = nRT) is the fundamental equation of state for gases. It relates four state variables — pressure (P), volume (V), amount of substance (n in moles), and temperature (T) — through the universal gas constant R. If you know any three of these variables, you can calculate the fourth. This equation combines Boyle's law, Charles's law, and Avogadro's law into a single relationship.
The gas constant R has different values depending on the units used: R = 8.314 J/(mol·K) in SI units, R = 0.08206 L·atm/(mol·K) for the common chemistry convention, or R = 8.314 Pa·m³/(mol·K). Temperature must always be in Kelvin (absolute temperature). The ideal gas law assumes gas molecules have negligible volume and no intermolecular forces — assumptions that work well at low pressures and high temperatures.
At standard temperature and pressure (STP: 0°C, 1 atm), one mole of any ideal gas occupies 22.414 liters — this is the molar volume. This remarkable fact means that equal volumes of different gases at the same temperature and pressure contain equal numbers of molecules (Avogadro's hypothesis). The ideal gas law breaks down at high pressures or low temperatures where real gas behavior (van der Waals forces, molecular volume) becomes significant.
Ideal Gas Law Formula
Ideal Gas Law:
PV = nRT
Gas Constant Values:
R = 8.314 J/(mol·K) = 8.314 Pa·m³/(mol·K)
R = 0.08206 L·atm/(mol·K)
R = 8.314 kPa·L/(mol·K)
Combined Gas Law (fixed n):
P₁V₁/T₁ = P₂V₂/T₂
Density Form:
ρ = PM/(RT) where M = molar mass
Molecular Form:
PV = NkT where k = R/Nₐ = 1.381×10⁻²³ J/K
Example Calculation
How many moles of gas are in 22.4 L at 1 atm and 273.15 K (STP)?
Given: P = 1 atm, V = 22.4 L, T = 273.15 K
n = PV/(RT) = (1 × 22.4)/(0.08206 × 273.15)
n = 22.4/22.414 = 0.9994 mol ≈ 1 mol
This confirms: 1 mole of ideal gas at STP = 22.414 L
Number of molecules: 0.9994 × 6.022×10²³ = 6.018×10²³
If this is air (M ≈ 29 g/mol):
Mass = 0.9994 × 29 = 28.98 g
Density = 28.98/22.4 = 1.294 g/L = 1.294 kg/m³
Standard Conditions Reference Table
| Condition | Pressure | Molar Volume | Temperature |
|---|---|---|---|
| STP (old) | 1 atm | 22.414 L | 273.15 K (0°C) |
| STP (IUPAC) | 1 bar | 22.711 L | 273.15 K (0°C) |
| NTP | 1 atm | 24.465 L | 293.15 K (20°C) |
| Room conditions | 1 atm | 24.790 L | 298.15 K (25°C) |
| Boiling water | 1 atm | 30.619 L | 373.15 K (100°C) |
| High pressure | 10 atm | 2.241 L | 273.15 K |
| Low pressure | 0.1 atm | 224.14 L | 273.15 K |
| Atmosphere (sea level) | 1 atm | — | 288 K (15°C) |
Frequently Asked Questions
What is the ideal gas law?
The ideal gas law (PV = nRT) relates the pressure, volume, temperature, and amount of an ideal gas. An ideal gas is a theoretical gas whose molecules occupy negligible volume and have no intermolecular attractions. Real gases approximate ideal behavior at low pressures and high temperatures. The equation combines Boyle's law (P∝1/V at constant T), Charles's law (V∝T at constant P), and Avogadro's law (V∝n at constant P,T) into one universal equation.
When does the ideal gas law fail?
The ideal gas law becomes inaccurate at high pressures (molecules are close together, so their volume matters), low temperatures (near condensation, intermolecular forces become significant), and for polar molecules (which have stronger attractions). For these conditions, use the van der Waals equation: (P + a/V²)(V - b) = nRT, where a accounts for intermolecular attractions and b for molecular volume. At room temperature and 1 atm, most gases deviate less than 1% from ideal behavior.
What is the universal gas constant R?
R is the universal gas constant, relating energy to temperature for one mole of substance. Its value is R = 8.314 J/(mol·K). It appears in many physics and chemistry equations beyond the ideal gas law, including the Boltzmann distribution, the Nernst equation, and the Stefan-Boltzmann law. It equals the product of Boltzmann's constant (k = 1.381×10⁻²³ J/K) and Avogadro's number (Nₐ = 6.022×10²³): R = kNₐ.
What is STP and why does it matter?
STP (Standard Temperature and Pressure) provides a reference condition for comparing gas properties. The traditional definition is 0°C (273.15 K) and 1 atm (101.325 kPa), giving a molar volume of 22.414 L. IUPAC redefined STP in 1982 as 0°C and 1 bar (100 kPa), giving 22.711 L/mol. STP matters because gas volume depends strongly on conditions — specifying STP allows meaningful comparison of gas quantities without ambiguity about temperature and pressure.
How do you convert between gas law units?
Key conversions: 1 atm = 101,325 Pa = 101.325 kPa = 760 mmHg = 14.696 psi = 1.01325 bar. For volume: 1 m³ = 1000 L = 10⁶ mL. Temperature must be in Kelvin: K = °C + 273.15. When using PV = nRT, ensure P, V, and R use consistent units. Common combinations: (atm, L, 0.08206) or (Pa, m³, 8.314) or (kPa, L, 8.314). Mixing units is the most common source of errors in gas law calculations.
What is the combined gas law?
The combined gas law (P₁V₁/T₁ = P₂V₂/T₂) applies when the amount of gas (n) is fixed but conditions change. It combines Boyle's and Charles's laws. For example, if a balloon at 1 atm, 2 L, 300 K is taken to altitude where P = 0.5 atm and T = 250 K: V₂ = V₁(P₁/P₂)(T₂/T₁) = 2×(1/0.5)×(250/300) = 3.33 L. This is useful for weather balloons, scuba diving, and any process where gas conditions change.
Applications of the Ideal Gas Law
The ideal gas law is used in chemistry (stoichiometry of gas reactions, determining molar mass), meteorology (atmospheric pressure and density calculations), engineering (pneumatic systems, combustion engines, HVAC), medicine (respiratory physiology, anesthesia gas mixtures), and everyday life (tire pressure changes with temperature, balloon behavior). It is the starting point for understanding more complex gas behavior and is essential for any calculation involving gases at moderate conditions.