How to use the Ideal Gas Law Calculator
- Pick the variable you want to solve for.
- Enter the remaining three in SI units: pascals, cubic metres, moles and kelvin.
- Convert first if needed — 1 atm is 101,325 Pa, 1 L is 0.001 m³, and kelvin is Celsius plus 273.15.
- Read the answer with the common alternative unit shown beneath it.
- Remember that absolute temperature is mandatory; entering Celsius produces nonsense.
How the calculation works
The ideal gas law combines Boyle's, Charles's and Avogadro's laws into a single equation of state. It treats gas molecules as point particles with no volume and no intermolecular forces, which is an excellent approximation at ordinary pressures and at temperatures well above the condensation point — typically within 1% for air at room conditions.
The gas constant R is now exact at 8.31446261815324 J/(mol·K), fixed by the 2019 redefinition of the kelvin and the mole in terms of the Boltzmann and Avogadro constants. Older tables list R in many unit systems — 0.08206 L·atm/(mol·K) is the most common alternative — and mixing unit systems mid-calculation is the dominant error in gas-law problems. Working in SI throughout avoids it entirely.
Real gases diverge from ideal behaviour as pressure rises and temperature falls, because molecular volume and attraction stop being negligible. The van der Waals equation adds a term for each. As a rule of thumb, deviations exceed a few percent above roughly 10 atmospheres or near the critical point, so for high-pressure cylinder and cryogenic work you need compressibility factors rather than this equation.
PV = nRT, with R = 8.31446261815324 J/(mol·K); molar volume at STP (273.15 K, 100 kPa) = 22.711 L/molSource: CODATA 2018 recommended values; BIPM SI Brochure, 9th edition; IUPAC standard temperature and pressure definition (100 kPa since 1982).
Worked example
A 20 L cylinder holds 2 mol of nitrogen at 300 K. What is the pressure?
- Convert the volume: 20 L = 0.02 m³.
- Solve for pressure with n = 2, T = 300, V = 0.02.
- P = (2 × 8.3145 × 300) ÷ 0.02 = 249,434 Pa.
- Convert: 249,434 ÷ 101,325 = 2.46 atm.
The cylinder sits at about 249 kPa, or 2.46 atmospheres — low enough that ideal-gas behaviour is a safe assumption.
Frequently asked questions
Why must temperature be in kelvin?+
The law is proportional to absolute temperature. Celsius has an arbitrary zero, so using it gives wrong or even negative results.
What is molar volume at STP?+
22.711 L/mol at the current IUPAC standard of 273.15 K and 100 kPa. The older 22.414 L/mol figure assumes 101.325 kPa.
When does the ideal gas law break down?+
At high pressure and low temperature, where molecular volume and attractive forces matter. Expect errors beyond a few percent above about 10 atm.
Can I use it for gas mixtures?+
Yes. Use total moles for total pressure, or apply it per component to get partial pressures via Dalton's law.
Last reviewed September 1, 2026. We review this page whenever the underlying formula, tax year, published rate or standard changes.