Ideal Gas Law Calculator
How the Ideal Gas Law Works
The ideal gas law is a fundamental equation of state in chemistry and physics that relates the pressure, volume, temperature, and amount of a gas: PV = nRT. It was first stated in its modern form by Emile Clapeyron in 1834, combining the earlier empirical discoveries of Boyle's law (1662), Charles's law (1787), and Avogadro's law (1811). The equation is taught in every introductory chemistry and physics course worldwide, as established in the IUPAC standardized curriculum.
This calculator solves for any one unknown variable when the other three are provided. Set the unknown to 0 (or -999 for temperature) and the calculator determines its value. The ideal gas law is remarkably accurate for most gases at moderate conditions -- within 5% for air, nitrogen, oxygen, and noble gases at temperatures above -50°C and pressures below 10 atm. It is used in applications ranging from stoichiometry calculations to HVAC system design, scuba diving planning, and chemical engineering process modeling.
The Ideal Gas Law Formula
The equation and the universal gas constant R are defined by IUPAC and NIST (National Institute of Standards and Technology).
- PV = nRT, where P = pressure, V = volume, n = moles, R = gas constant, T = temperature (Kelvin)
- R = 0.08206 L·atm/(mol·K) when using liters and atmospheres
- R = 8.314 J/(mol·K) in SI units (Pa, m³, mol, K)
- R = 62.36 L·torr/(mol·K) when using liters and torr/mmHg
Worked example: What volume does 2.5 moles of an ideal gas occupy at 25°C (298.15 K) and 1.5 atm? V = nRT/P = (2.5 x 0.08206 x 298.15) / 1.5 = 61.15 / 1.5 = 40.77 liters. At STP (0°C, 1 atm), the same amount would occupy 2.5 x 22.414 = 56.04 liters.
Key Terms You Should Know
- Ideal Gas: A hypothetical gas where molecules have no intermolecular forces and occupy zero volume. Real gases approximate ideal behavior at low pressures and high temperatures. Noble gases (He, Ne, Ar) are the closest real-world approximations.
- STP (Standard Temperature and Pressure): Traditionally 0°C (273.15 K) and 1 atm. IUPAC updated the standard in 1982 to 0°C and 1 bar (0.987 atm), changing the molar volume from 22.414 L to 22.711 L. Many textbooks still use the original definition.
- Molar Volume: The volume occupied by one mole of gas. At STP (1 atm definition), the molar volume is 22.414 L for any ideal gas, regardless of molecular identity. Use molecular weight to convert between moles and grams.
- Partial Pressure: In a gas mixture, each component exerts a partial pressure proportional to its mole fraction (Dalton's law). The total pressure equals the sum of all partial pressures. This principle is critical in solution chemistry and respiratory physiology.
- Van der Waals Equation: A modified gas law that accounts for intermolecular forces and molecular volume: (P + a/V²)(V - b) = nRT. The constants a and b are specific to each gas and become significant at high pressures or low temperatures.
Values of the Gas Constant R
Choosing the correct value of R depends on your pressure and volume units. The NIST CODATA 2018 recommended value is R = 8.314462618 J/(mol·K) exactly.
| Value of R | Units | Common Use |
|---|---|---|
| 0.08206 | L·atm/(mol·K) | General chemistry (this calculator) |
| 8.314 | J/(mol·K) or Pa·m³/(mol·K) | SI calculations, thermodynamics |
| 62.36 | L·torr/(mol·K) | Lab work with manometers |
| 1.987 | cal/(mol·K) | Thermochemistry (older texts) |
| 0.08314 | L·bar/(mol·K) | IUPAC standard (1 bar STP) |
Practical Examples
Example 1 -- Finding pressure in a gas cylinder: A 50-liter steel cylinder contains 5 moles of oxygen at 20°C (293.15 K). P = nRT/V = (5 x 0.08206 x 293.15) / 50 = 120.23 / 50 = 2.40 atm. This is a safe, low-pressure scenario. Industrial cylinders at 200 atm would deviate from ideal behavior by about 5-8%, requiring the van der Waals correction.
Example 2 -- Calculating moles from volume: A weather balloon is filled with helium to a volume of 1,500 liters at sea level (1 atm) and 15°C (288.15 K). n = PV/RT = (1 x 1500) / (0.08206 x 288.15) = 1500 / 23.65 = 63.4 moles. Using helium's molecular weight (4.003 g/mol), this equals 253.8 grams of helium.
Example 3 -- Temperature change in a sealed container: A sealed 10-liter container holds 0.5 moles of nitrogen at 25°C (298.15 K), giving P = 1.22 atm. If heated to 100°C (373.15 K), the new pressure is P = nRT/V = (0.5 x 0.08206 x 373.15) / 10 = 1.53 atm -- a 25% increase. This is why pressurized containers carry temperature warnings.
Tips for Using the Ideal Gas Law
- Always convert temperature to Kelvin: K = °C + 273.15. The ideal gas law requires absolute temperature. Using Celsius or Fahrenheit will produce incorrect results. At 0 K (-273.15°C), an ideal gas would have zero volume and zero pressure.
- Match your units to your R constant: If using pressure in atm and volume in liters, use R = 0.08206. If pressure is in kPa and volume in liters, use R = 8.314 but divide pressure by 101.325 first, or use R = 8.314 with volume in cubic meters (1 L = 0.001 m³). Use the temperature converter for unit conversions.
- Check results against STP: At STP, 1 mole of ideal gas occupies 22.4 L. If your answer for 1 mole at near-standard conditions deviates significantly from 22.4 L, check your units and calculations.
- Know when ideal gas breaks down: The ideal gas law fails at pressures above ~10 atm, temperatures near the condensation point, and for polar molecules (water vapor, ammonia, HCl). At 100 atm, real gas volume can differ from ideal by 10-30%.
- Use combined gas law for two-state problems: When the amount of gas is constant (sealed container), use P1V1/T1 = P2V2/T2 to relate initial and final states without needing n or R.
Frequently Asked Questions
What are the units for the ideal gas law?
The units depend on which value of the gas constant R you use. With R = 0.08206 L·atm/(mol·K), pressure is in atmospheres, volume in liters, amount in moles, and temperature in Kelvin. With R = 8.314 J/(mol·K), pressure is in pascals, volume in cubic meters, and temperature in Kelvin. The NIST CODATA 2018 defines R = 8.314462618 J/(mol·K) exactly. Other R values accommodate torr, bar, or calorie units. The most common mistake is mixing unit systems -- for example, using pressure in kPa with R = 0.08206, which produces answers off by a factor of 101.325.
What is STP in chemistry?
STP stands for Standard Temperature and Pressure. The traditional definition used in most general chemistry courses is 0°C (273.15 K) and 1 atm, where one mole of ideal gas occupies 22.414 liters. In 1982, IUPAC redefined STP as 0°C and 1 bar (0.98692 atm), which gives a molar volume of 22.711 liters. The difference matters in precise calculations -- the 1 bar standard is about 1.3% larger. Most U.S. textbooks and AP Chemistry exams still use the 1 atm definition. Always check which standard your course or reference material uses.
When does the ideal gas law fail?
The ideal gas law fails when its two key assumptions break down: that gas molecules have no intermolecular forces and occupy zero volume. This happens at high pressures (above roughly 10 atm, where molecular volume becomes significant), low temperatures (near the gas's condensation point, where attractive forces dominate), and for polar molecules like water vapor, ammonia, and HCl (which have strong intermolecular attractions even at moderate conditions). At 100 atm, real gas volumes can differ from ideal predictions by 10-30%. The van der Waals equation (P + a/V²)(V - b) = nRT corrects for these effects using gas-specific constants a and b.
How do I convert between pressure units?
The key pressure conversions are: 1 atm = 101.325 kPa = 760 mmHg = 760 torr = 14.696 psi = 1.01325 bar. In SI, the pascal (Pa) is the standard unit (1 Pa = 1 N/m²), but it is inconveniently small for most gas calculations (1 atm = 101,325 Pa). Millimeters of mercury (mmHg) and torr are identical units used in laboratory settings with manometers. Pounds per square inch (psi) is common in engineering and industrial applications. Always ensure your pressure units match your chosen R constant to avoid calculation errors.
What is the difference between ideal gas law and combined gas law?
The ideal gas law (PV = nRT) calculates the state of a gas at a single set of conditions, requiring knowledge of the amount of gas (n) and the gas constant (R). The combined gas law (P1V1/T1 = P2V2/T2) compares a gas at two different states when the amount remains constant (sealed system), without needing n or R. Use the ideal gas law when you know or need to find the number of moles. Use the combined gas law for problems like "a gas at 1 atm and 300 K is compressed to half its volume -- what is the new pressure?" The dilution calculator applies similar proportional reasoning to solution concentrations.