chemistry calculators

Ideal Gas Law Calculator

Solve for moles of gas using pressure, volume, temperature, and the universal gas constant with the ideal gas law PV = nRT. Useful in chemistry, physics, and engineering for gas-phase reaction calculations.

About this calculator

The ideal gas law combines Boyle's law, Charles's law, and Avogadro's law into one equation: PV = nRT. Here P is pressure in atm, V is volume in liters, n is the number of moles, R is the universal gas constant (0.08206 L·atm·mol⁻¹·K⁻¹), and T is absolute temperature in Kelvin. Rearranged to solve for moles: n = (P × V) / (R × T). The ideal gas model assumes gas molecules have negligible volume and no intermolecular forces — a good approximation at low pressures and high temperatures. Real gases deviate from this model at high pressures or near their condensation point, where the van der Waals equation is more accurate. Converting Celsius to Kelvin (T(K) = T(°C) + 273.15) is essential before entering temperature.

How to use

A sealed container holds gas at P = 2.0 atm, V = 5.0 L, and T = 300 K. Using n = (P × V) / (R × T) with R = 0.08206 L·atm·mol⁻¹·K⁻¹: n = (2.0 × 5.0) / (0.08206 × 300) = 10.0 / 24.618 ≈ 0.406 mol. Enter pressure = 2.0, volume = 5.0, temperature = 300, and the gas constant = 0.08206 into the calculator. The result, approximately 0.406 mol, corresponds to about 244 × 10²³ molecules at those conditions.

Frequently asked questions

What value of R should I use in the ideal gas law and what are the units?

The gas constant R has different numerical values depending on the unit system you choose. The most common for chemistry is R = 0.08206 L·atm·mol⁻¹·K⁻¹ when using liters and atmospheres. If you work in SI units (pascals and cubic meters), use R = 8.314 J·mol⁻¹·K⁻¹. For pressures in bar, R = 0.08314 L·bar·mol⁻¹·K⁻¹. Always confirm that your pressure and volume units match the R value you select, or unit errors will make your answer wrong by factors of ~100.

When does the ideal gas law give inaccurate results for real gases?

The ideal gas law becomes inaccurate at high pressures (above ~10 atm) where molecules are forced close together and intermolecular attractions become significant, and at temperatures near the gas's boiling point where liquefaction begins. For example, CO₂ near its critical point (31 °C, 73 atm) deviates substantially from ideal behaviour. In these regimes, the van der Waals equation — (P + a/V²)(V − b) = nRT — or more complex equations of state like Peng-Robinson give much better predictions.

Why must temperature be in Kelvin and not Celsius for the ideal gas law?

The ideal gas law is derived from the kinetic theory of gases, where temperature represents the average kinetic energy of molecules. Kinetic energy is always positive and proportional to the absolute (Kelvin) temperature. At 0 K, molecular motion theoretically ceases and volume approaches zero. Using Celsius would give nonsensical or negative results — for example, at 0 °C (273.15 K) a gas still has substantial volume, but plugging in T = 0 would imply infinite or undefined moles. Always convert: T(K) = T(°C) + 273.15 before calculating.