chemistry calculators

Ideal Gas Law Calculator

Solve for pressure, volume, temperature, or moles of a gas using the ideal gas law. Use it when working through chemistry problems or lab calculations involving gas behavior.

About this calculator

The ideal gas law combines Boyle's Law, Charles's Law, and Avogadro's Law into one equation: PV = nRT, where P is pressure (atm), V is volume (L), n is number of moles (mol), R is the universal gas constant (0.08206 L·atm/mol·K), and T is temperature (K). Rearranging for any unknown gives you P = nRT/V, V = nRT/P, T = PV/nR, or n = PV/RT. The formula provided uses a compressibility factor tied to gas type, so for real gases the effective expression becomes (P × V × Z) / (0.08206 × T × n) = 1, where Z corrects for non-ideal behavior. At standard conditions (1 atm, 273.15 K), one mole of an ideal gas occupies 22.4 L—a useful sanity check for your results.

How to use

Suppose you have 2 mol of nitrogen gas at 300 K and want to know the volume at 1.5 atm. Rearrange to V = nRT/P: V = (2 × 0.08206 × 300) / 1.5 = 49.236 / 1.5 = 32.84 L. Enter 1.5 atm for pressure, 2 mol for moles, 300 K for temperature, and select nitrogen as the gas type. The calculator fills in V = 32.84 L. If you then measure the actual volume as 32.5 L, the small deviation indicates mild non-ideal behavior at this pressure.

Frequently asked questions

What is the ideal gas law and when does it break down?

The ideal gas law (PV = nRT) models gases whose molecules have no volume and no intermolecular forces. It works well at low pressures and high temperatures. At very high pressures or low temperatures, real gases deviate significantly because molecular volume and attractive forces become important. In those cases, the van der Waals equation or a compressibility factor (Z) provides better accuracy.

How do I convert Celsius to Kelvin for the ideal gas law calculator?

Add 273.15 to your Celsius value: T(K) = T(°C) + 273.15. The ideal gas law always requires absolute temperature in Kelvin because gas properties scale linearly with absolute temperature. Using Celsius would produce nonsensical or negative results. For example, 25 °C becomes 298.15 K, which is the standard laboratory temperature used in most chemistry problems.

Why does the calculator include a gas type correction factor?

Real gases deviate from ideal behavior to different degrees depending on their molecular size and polarity. The gas type field applies a compressibility factor Z, which modifies the ideal law to PV = ZnRT. For hydrogen at moderate conditions Z ≈ 1.0006, while for CO₂ it can drop to 0.94 at 10 atm. Choosing the correct gas type ensures the calculator applies the appropriate correction, giving you more accurate volume or pressure predictions for non-ideal scenarios.