Ideal Gas Law CalculatorSolve PV = nRT for pressure, volume, moles or temperature in any units

Enter three values, pick your units, and get the fourth, plus gas density and molar volume. Enter the gas by mass if you know its formula.

PV=nRT
Add DexoCalc as a preferred source on Google

How do you use the ideal gas law?

Rearrange PV = nRT for the unknown, using kelvin and a matching R. One mole of gas at 25 °C (298.15 K) and 1 atm occupies V = nRT ÷ P = 1 × 0.082057 × 298.15 ÷ 1 = 24.47 L. With R = 8.314 J/(mol·K), use pascals and cubic meters; with R = 0.082057, use atmospheres and liters.

Used only for density and mass outputs.
Volume
24.47L

24.47 L/molMolar volume
1.145 g/LGas density
28.01 gMass of gas
298.15 KAbsolute T

   

PV = nRT rearranged

P = nRT ÷ Vpressure
V = nRT ÷ Pvolume
n = PV ÷ RTmoles
T = PV ÷ nRtemperature

Two useful extensions: density ρ = PM ÷ RT and molar mass M = ρRT ÷ P, where M is molar mass in kg/mol for SI units.

Values of the gas constant R

R valueUnitsUse with
8.314462618J/(mol·K) = Pa·m³/(mol·K)Pa and m³ (SI)
0.082057366L·atm/(mol·K)atm and L
8.314462618L·kPa/(mol·K)kPa and L
0.083144626L·bar/(mol·K)bar and L
62.363598L·mmHg/(mol·K)mmHg (torr) and L
1.987204cal/(mol·K)energy in calories

Since 2019, R is exact: it equals the Avogadro constant times the Boltzmann constant. This calculator converts everything to SI first, so you never have to choose R yourself.

Worked examples

1. Volume of one mole at room temperature

n = 1.00 mol, T = 25 °C = 298.15 K, P = 1.00 atm. V = 1.00 × 0.082057 × 298.15 ÷ 1.00 = 24.47 L. This is the calculator’s default.

2. Moles in a gas cylinder

A 10.0 L cylinder at 200 bar and 20 °C: n = PV ÷ RT = (2.00 × 10⁷ Pa × 0.0100 m³) ÷ (8.3145 × 293.15) = 82.1 mol. At such high pressure real gases deviate from ideal, so treat this as an estimate.

3. Density of carbon dioxide

At 0 °C and 1 atm: ρ = 101,325 × 0.044009 ÷ (8.3145 × 273.15) = 1.96 g/L, about 1.5 times denser than air, which is why CO₂ pools in low places.

When the ideal gas law is not accurate

  • High pressure (above roughly 10 atm), where molecules take up a noticeable share of the volume.
  • Low temperature near condensation, where intermolecular attraction matters.
  • Polar or large molecules such as water vapour and ammonia, which attract each other strongly.

For a fixed amount of gas moving between two sets of conditions, the combined gas law calculator is quicker.

Ideal gas law FAQs

The ideal gas law is PV = nRT, linking pressure (P), volume (V), amount of gas in moles (n) and absolute temperature (T) through the gas constant R.

R = 8.314462618 J/(mol·K) in SI units. Equivalent values are 0.082057 L·atm/(mol·K), 8.314 L·kPa/(mol·K) and 62.364 L·mmHg/(mol·K).

The ideal gas law is based on absolute temperature, where zero means no thermal motion. Using °C would give wrong or even negative volumes. K = °C + 273.15.

At 0 °C and 1 atm one mole of an ideal gas occupies 22.414 L. At IUPAC's standard of 0 °C and 1 bar it is 22.711 L, and at 25 °C and 1 atm it is 24.465 L.

Rearrange to n = PV ÷ RT. 10.0 L of gas at 1.00 atm and 25 °C holds 1.00 × 10.0 ÷ (0.082057 × 298.15) = 0.409 mol.

Density = PM ÷ RT, where M is molar mass. CO2 at 0 °C and 1 atm has a density of 101,325 × 0.044009 ÷ (8.3145 × 273.15) = 1.96 g/L.

Rearrange the density form: M = ρRT ÷ P. Measure the gas density at a known temperature and pressure, then solve for M.

It becomes less accurate at high pressure and low temperature, where molecules are close together and attract each other. Real gases are then better described by the van der Waals equation.

Yes. Choose grams and type the gas formula, such as CO2 or O2. The calculator converts grams to moles using the molar mass.

atm, kPa, Pa, bar, mmHg, torr and psi. 1 atm = 101.325 kPa = 1.01325 bar = 760 mmHg = 14.696 psi.

Not for P, V, n and T: all ideal gases behave the same. The gas type only matters when converting between moles and grams or calculating density.

At everyday temperatures and pressures air behaves very close to ideal, typically within a fraction of a percent, so PV = nRT works well for most practical problems.

Sources

  1. NIST CODATA: Molar gas constant R
  2. NIST CODATA: Molar volume of ideal gas
  3. OpenStax Chemistry 2e, Section 9.2: Relating Pressure, Volume, Amount, and Temperature
  4. IUPAC Gold Book: Standard conditions for gases
  5. NIST SP 811: Unit conversion factors

This ideal gas law calculator assumes ideal behaviour. For compressed-gas safety, high-pressure design or cryogenic conditions, use real-gas equations of state and professional guidance.