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).

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

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.08206L·atm/(mol·K)General chemistry (this calculator)
8.314J/(mol·K) or Pa·m³/(mol·K)SI calculations, thermodynamics
62.36L·torr/(mol·K)Lab work with manometers
1.987cal/(mol·K)Thermochemistry (older texts)
0.08314L·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

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.

Related Calculators