PV The Backyard Scientist

Ideal gas law calculator (PV = nRT)

This free ideal gas law calculator solves PV = nRT for pressure, volume, moles (or grams) and temperature in any units — atm, kPa, bar, psi, mmHg, L, m³, ft³, °C, °F, K — and shows gas density and the working. A second tab handles the combined gas law, Boyle's, Charles's and Gay-Lussac's laws.

Presets:

How to use the ideal gas law calculator

Pick what you want to find — pressure, volume, amount (moles or mass) or temperature — and fill in the other three in whatever units you have. The answer updates as you type, in your chosen unit and in every other common unit, with the formula and the numbers substituted in SI units so you can copy the working into homework. Choose a gas (air, nitrogen, oxygen, CO₂, helium, hydrogen, methane, propane…) to work with grams instead of moles and to get the gas density. The second tab solves the combined gas law and, by leaving a pair blank, Boyle's, Charles's and Gay-Lussac's laws.

The ideal gas law: PV = nRT

P is absolute pressure, V volume, n amount of gas in moles, T absolute temperature in kelvin, and R the molar gas constant, 8.314 462 618 J mol⁻¹ K⁻¹ (exact since the 2019 SI). Rearranged: P = nRT/V, V = nRT/P, n = PV/RT and T = PV/nR. The equation combines the older gas laws and describes most gases well at everyday temperatures and pressures.

R in different units

Value of RUnitsUse when
8.314J/(mol·K) = Pa·m³/(mol·K)SI: Pa and m³
0.082057L·atm/(mol·K)atm and litres
8.314L·kPa/(mol·K)kPa and litres
0.08314L·bar/(mol·K)bar and litres
62.364L·Torr/(mol·K)mmHg/Torr and litres
10.732ft³·psi/(lb-mol·°R)US engineering units

You never need to pick R here: the calculator converts every input to SI, solves, and converts back.

Worked examples

Combined gas law and the classic laws

For a fixed amount of gas, P₁V₁/T₁ = P₂V₂/T₂. Hold one quantity constant and it reduces to:

In the combined tab, leave both boxes of the constant quantity empty and the tool applies the right law and names it.

Units and the most common mistakes

  1. Use kelvin. Celsius or Fahrenheit in PV = nRT gives nonsense (and division by zero at 0 °C). The calculator converts for you: K = °C + 273.15.
  2. Use absolute pressure. Tyre and cylinder gauges read pressure above atmospheric.
  3. Match R to the units if you calculate by hand (see the table).
  4. Litres vs m³: 1 m³ = 1000 L; 1 L = 1 dm³ = 1000 cm³ (mL).

When is a gas "ideal"?

The ideal gas law assumes molecules take up no volume and do not attract each other. Real gases follow it within about 1 % at room temperature and pressures up to a few bar. Deviations grow at high pressure (hundreds of bar) and near the boiling point — water vapour, CO₂ near liquefaction and refrigerants are the usual exceptions; there the van der Waals equation or compressibility factor Z = PV/nRT is used. For the stoichiometry that produces a gas, start with the chemical equation balancer and the molar mass calculator.

Frequently asked questions

What is the ideal gas law formula?

PV = nRT, where P is absolute pressure, V volume, n moles, T absolute temperature in kelvin and R = 8.314 J/(mol·K) = 0.082057 L·atm/(mol·K).

What value of R should I use?

It depends on your units: 8.314 for Pa and m³ (or kPa and L), 0.08206 for atm and L, 62.36 for Torr and L. This calculator converts units for you, so any combination works.

What volume does 1 mole of gas occupy?

22.41 L at 0 °C and 1 atm, 22.71 L at 0 °C and 1 bar (IUPAC STP), and 24.47 L at 25 °C and 1 atm.

Why must temperature be in kelvin?

Gas volume and pressure are proportional to absolute temperature. Celsius has an arbitrary zero, so using it breaks the proportionality.

How do I use mass instead of moles?

Tick “I know the mass”, enter grams and choose the gas. The calculator divides by the gas's molar mass to get moles.

How do I calculate gas density?

ρ = PM/RT. Choose the gas and the calculator shows the density at your pressure and temperature, e.g. 1.225 kg/m³ for air at 15 °C and 1 atm.

What is the combined gas law?

P₁V₁/T₁ = P₂V₂/T₂ for a fixed amount of gas. Leave the pair of a constant quantity blank and the tool applies Boyle's, Charles's or Gay-Lussac's law.

More tools