Ideal Gas Law Calculator

Share calculator:
Embed this tool:

Select the unknown, enter the other three properties of the gas in the units you have, and get the answer in the unit you prefer. The guide shows the equation, the special gas laws and a few worked cases.

Using the ideal gas law calculator

Use the Calculate buttons to say whether you are looking for pressure, volume, temperature or moles. The form then asks for the other three. Pressure can be given in Pa, kPa, MPa, GPa, mbar, bar, atm, mm Hg (Torr), mm H₂O or psi. Volume can be given in mm³, cm³, m³, ml, litres, US gallons, US fluid ounces, cubic inches, cubic feet or cubic yards. Temperature can be given in kelvin, °C, °F, °R (Rankine) or °Re (Réaumur).

When pressure, volume or temperature is the answer, an extra menu appears (Pressure Unit, Volume Unit or Temperature Unit) so you can pick the unit of the result. The amount of gas is always in moles, and pressure, volume and moles must be positive numbers.

  • The calculator converts every input to pascals, cubic metres, moles and kelvin, then applies the gas constant R ≈ 8.31446 J/(mol·K).
  • A temperature of exactly 0 K is rejected when solving for moles, since it would mean dividing by zero.
  • Always use absolute pressure, not the gauge pressure printed on a tyre or a cylinder dial (see below).

The ideal gas equation

P × V = n × R × TP pressure, V volume, n amount of gas in moles, T absolute temperature, R the gas constant

The equation combines three experimentally observed laws into one. Each variable can be isolated, which is what the four calculation modes do:

P = nRT ÷ V V = nRT ÷ P T = PV ÷ nR n = PV ÷ RT

In SI units R is 8.314 J/(mol·K), so pressure is in pascals, volume in cubic metres and temperature in kelvin. If you prefer litres and atmospheres, the same constant reads 0.08206 L·atm/(mol·K). Because the product P × V has the dimensions of energy, R is best read as an amount of energy per mole per kelvin.

Worked examples

Volume of one mole. At 273.15 K (0 °C) and 101,325 Pa (1 atm): V = nRT ÷ P = 1 × 8.31446 × 273.15 ÷ 101,325 = 0.022414 m³, which is 22.414 litres. At 298.15 K (25 °C) and the same pressure the molar volume rises to 24.465 litres.

Pressure in a cylinder. 2 mol of gas in a 10 L vessel at 25 °C (298.15 K): P = 2 × 8.31446 × 298.15 ÷ 0.010 = 495,791 Pa, about 495.8 kPa or 4.89 atm. Select 10 for the volume, L as its unit and 25 °C for the temperature.

Moles in a bottle. A 2.5 L bottle of air at 1 atm and 20 °C: n = 101,325 × 0.0025 ÷ (8.31446 × 293.15) = 0.1039 mol.

Temperature. 0.5 mol of gas occupies 12 L at 150 kPa: T = 150,000 × 0.012 ÷ (0.5 × 8.31446) = 432.98 K, which is 159.83 °C (319.7 °F).

The individual gas laws

When two of the four properties stay fixed, the ideal gas equation shrinks to one of the classical gas laws. These are handy for before-and-after problems, where the unknown final state is found from the initial state:

Special cases of PV = nRT (temperatures in kelvin)
LawHeld constantRelationship
Boyle's lawn, TP₁V₁ = P₂V₂
Charles's lawn, PV₁ ÷ T₁ = V₂ ÷ T₂
Gay-Lussac's lawn, VP₁ ÷ T₁ = P₂ ÷ T₂
Avogadro's lawP, TV₁ ÷ n₁ = V₂ ÷ n₂
Combined gas lawnP₁V₁ ÷ T₁ = P₂V₂ ÷ T₂

Quick checks: squeezing 3 L at 100 kPa to 1.5 L at constant temperature doubles the pressure to 200 kPa (Boyle). Warming 2 L of gas from 300 K to 450 K at constant pressure gives 3 L (Charles). Heating a sealed rigid tank from 300 K to 360 K takes 200 kPa up to 240 kPa (Gay-Lussac).

When the ideal gas law works

The law assumes gas particles are points that do not attract each other and collide perfectly elastically. Real gases come close at low pressure and high temperature, when molecules are far apart and moving fast. Near the point where a gas condenses, or at pressures of tens of atmospheres, the predicted values drift away from measured ones. For those cases try the van der Waals equation calculator, which adds corrections for molecular size and attraction.

Gas density follows directly from the same equation: ρ = P × M ÷ (R × T), with M the molar mass in kg/mol. For dry air (M ≈ 0.02897 kg/mol) at 101,325 Pa and 293.15 K that gives about 1.204 kg/m³. The density calculator converts the result into other units.

Common mistakes

  • Using gauge pressure. A tyre showing 32 psi on a gauge is at about 46.7 psi absolute (roughly 322 kPa), because the gauge ignores the atmosphere pressing on the outside. Add atmospheric pressure first.
  • Using Celsius in the raw equation. The law needs absolute temperature. The calculator converts °C, °F, °R and °Re for you, but if you work by hand, add 273.15 to Celsius readings.
  • Mixing units of R. The value 8.314 pairs with pascals and cubic metres; 0.08206 pairs with atmospheres and litres.
  • Forgetting that moles are not grams. Divide the mass of gas by its molar mass to get n.

Frequently asked questions

What is the ideal gas law?

PV = nRT. It links the pressure (P), volume (V), amount in moles (n) and absolute temperature (T) of an ideal gas through the gas constant R = 8.314 J/(mol·K).

What is the value of R?

R = 8.314 J/(mol·K) in SI units, which is the same as 0.08206 L·atm/(mol·K) or 62.36 L·Torr/(mol·K). The calculator uses about 8.31446 J/(mol·K).

Why must the temperature be in kelvin?

The pressure and volume of a gas are proportional to temperature measured from absolute zero. Using Celsius or Fahrenheit would give a gas of zero volume at the wrong temperature, so the calculator converts those scales to kelvin before it computes.

How much volume does one mole of gas occupy?

At 0 °C and 1 atm, 22.414 litres. At 25 °C and 1 atm, 24.465 litres. At 0 °C and exactly 1 bar the figure is 22.711 litres.

When does the ideal gas law fail?

At high pressure and low temperature, where molecules are close together and attract each other, and for gases near condensation. Real-gas equations such as van der Waals' are better there.

References

  1. Atkins, P. and de Paula, J., Physical Chemistry (Oxford University Press)
  2. NIST, CODATA recommended values of the fundamental physical constants (molar gas constant)
  3. BIPM, The International System of Units (SI Brochure)

Cite this calculator and page

If you use this page in your work, you can cite it as:

Reeliy Editorial Team. (2026). Ideal Gas Law Calculator. Reeliy. https://reeliy.com/calculators/ideal-gas-law-calculator“Ideal Gas Law Calculator.” Reeliy, 2026, https://reeliy.com/calculators/ideal-gas-law-calculator.