Toolvito

Works on this device

Ideal Gas Law Calculator

The ideal gas law links the pressure, volume, amount and temperature of a gas: P V = n R T. Choose the value you want, enter the others in the units you have, and see the formula with your numbers.

Enter your values

Enter the amount of gas, its volume and its temperature.

Your values

Absolute zero is 0 K, −273.15 °C or −459.67 °F.

Your values are worked out in this browser. They are not sent to a server.

Your result will show here

Fill in the values, then choose the button below them.

How to use this calculator

  1. Choose what you want to find: the pressure, the volume, the amount of gas or the temperature.
  2. Enter the other three values and choose a unit for each one. The amount can be moles, or a mass and the gas (a formula such as CO2, or a molar mass).
  3. Choose Calculate. The result shows the answer, and How it was worked out shows the formula with your numbers in SI units.
  4. For the density of a gas, or the molar mass from a measured density, choose Density of an ideal gas. For the value of R in L·atm or other units, choose The gas constant R in other units.

The formula

P V = n R T. P is the absolute pressure in pascals, V the volume in cubic metres, n the amount of gas in moles, T the temperature in kelvin and R the molar gas constant.

R = 8.31446261815324 J/(mol·K). This value is exact: since the SI was redefined in 2019, the Boltzmann constant k = 1.380649 × 10^-23 J/K and the Avogadro constant NA = 6.02214076 × 10^23 per mole are fixed numbers, and R = k × NA.

  • Pressure: P = n R T ÷ V. Volume: V = n R T ÷ P. Amount: n = P V ÷ (R T). Temperature: T = P V ÷ (n R).
  • Amount from a mass: n = m ÷ M, where M is the molar mass (32.00 g/mol for oxygen gas, O2).
  • Density: ρ = P M ÷ (R T). Turned round, a measured density gives the molar mass: M = ρ R T ÷ P.
  • In other units R is 0.0820574 L·atm/(mol·K), 0.0831446 L·bar/(mol·K), 62.3636 L·Torr/(mol·K), 1.98720 cal/(mol·K) and 10.7316 ft³·psi/(lb-mol·°R).

Worked example

One mole of gas at 0 °C (273.15 K) in a volume of 22.414 L (0.022414 m³): P = 1 × 8.31446 × 273.15 ÷ 0.022414 = 101,324.9 Pa, which rounds to 101.325 kPa, or 1 atm.

The other way round: oxygen with a measured density of 1.429 g/L at 0 °C and 101.325 kPa has M = 1.429 × 8.31446 × 273.15 ÷ 101,325 = 0.03203 kg/mol, which is 32.03 g/mol.

32 g of oxygen (O2, 31.998 g/mol) is 1.00006 mol. At 25 °C (298.15 K) and 101.325 kPa it fills V = 1.00006 × 8.31446 × 298.15 ÷ 101,325 = 0.0244669 m³, which is 24.467 L.

Oxygen at 0 °C and 101.325 kPa has a density of ρ = 101,325 × 0.031998 ÷ (8.31446 × 273.15) = 1.4276 kg/m³, which is 1.4276 g/L.

Temperature and pressure: two common mistakes

  • Use an absolute temperature. The tool turns °C and °F into kelvin for you. A temperature at or below absolute zero (0 K, −273.15 °C, −459.67 °F) is refused.
  • Use an absolute pressure. A tyre or gas cylinder gauge shows gauge pressure, which is the pressure above the air around it. Add the air pressure (about 101.325 kPa or 14.7 psi) to get the absolute pressure.

Limits you should know

  • The ideal gas law is a model. It is close for most gases near room temperature and normal pressure. At high pressure, at low temperature or near the point where the gas turns to liquid, real gases differ from it.
  • Molar masses from a formula use the IUPAC abridged standard atomic weights (2021). A typed molar mass is used as you type it.
  • For the volume of a gas at a named standard condition (STP, NTP, 15 °C or 60 °F), use the Gas Volume Calculator. For a gas that changes from one state to another (Boyle, Charles, combined gas law), use the Gas Law Calculator.
  • Results are for study and planning. They are not a safety check of a pressure vessel or a gas system.

Related tools