Ideal Gas Law Calculator

Solve PV = nRT for pressure, volume, moles or temperature in any units, with gauge pressure, gas mass and density from molar mass, and the combined gas law.

The interactive tool loads here when JavaScript runs.

About this tool

What is the Ideal Gas Law Calculator?

This ideal gas law calculator solves PV = nRT for any one of pressure, volume, amount of gas or temperature. Pressures can be in Pa, kPa, MPa, bar, mbar, atm, psi, mmHg, Torr or inHg; volumes in m³, litres, mL, cm³, cubic feet, cubic inches or US and UK gallons; temperatures in kelvin, Celsius, Fahrenheit or Rankine. The tool converts everything to SI internally, so there is no need to remember which value of R goes with which units.

Enter the amount as moles or as a mass of a named gas (air, nitrogen, oxygen, CO₂, helium, hydrogen, argon, methane, propane, water vapour or your own molar mass), and the result also gives the mass, the gas density and the number of molecules. A gauge-pressure switch adds one atmosphere, because tyre and cylinder gauges read relative to the air around them.

The Combined gas law tab handles before-and-after problems for a fixed amount of gas, P1V1/T1 = P2V2/T2, which covers Boyle's, Charles's and Gay-Lussac's laws as special cases.

  • Solve for P, V, n or T in mixed units
  • Ten pressure units, gauge or absolute
  • Amount as moles or mass of a chosen gas
  • Gas density, molar volume and molecule count
  • Combined gas law tab with Boyle, Charles and Gay-Lussac
Read the guide: The Ideal Gas Law PV = nRT: Units, STP and When It Fails

How to use the Ideal Gas Law Calculator

  1. Choose what to solve for: Pressure, Volume, Moles (or Mass) or Temperature.
  2. Enter the other three values and choose their units. Mark the pressure as gauge if it comes from a tyre or cylinder gauge.
  3. To work in mass rather than moles, set Amount given as to Mass of gas and pick the gas or enter its molar mass.
  4. Read the result with its conversions, the molar volume, the molecule count and, with a gas selected, the mass and density.
  5. For a change of state of a fixed amount of gas, use the Combined gas law tab: pick the unknown and enter the other five values.

Worked examples

Molar volume at 0 °C and 1 atm

Input

Solve for volume; 1 atm, 1 mol, 0 °C

Output

22.414 L

With 100 kPa instead of 1 atm the answer is 22.711 L, which is the current IUPAC STP value.

How much air is in a scuba tank?

Input

Solve for mass of air; 200 bar gauge, 12 L, 15 °C

Output

100.7 mol, about 2.92 kg (ideal)

Real air at 200 bar is less compressible than ideal, so the true figure is a few percent lower. Use a real-gas table for filling calculations.

Helium in a party balloon

Input

Solve for mass of helium; 1 atm, 14 L, 20 °C

Output

0.582 mol, 2.33 g

The same volume of air would weigh about 16.9 g, so the balloon has about 14.5 g of lift before the weight of the rubber.

Tyre pressure on a hot day

Input

Combined law; 2.2 bar absolute at 10 °C, same volume, 40 °C

Output

2.433 bar absolute

Pressure rises in proportion to absolute temperature: 313.15 ÷ 283.15 = 1.106. Add 1 atm to a gauge reading before using the law.

Background and insight

The ideal gas law combines the experimental laws of Boyle (1662), Charles (1787) and Gay-Lussac (1802) with Avogadro's hypothesis, and was first stated in this form by Émile Clapeyron in 1834. It treats molecules as points that only interact by elastic collisions. R, the molar gas constant, equals the Avogadro constant times the Boltzmann constant; since the 2019 SI redefinition both are exact, so R = 8.314462618... J/(mol·K) exactly.

Two consequences are worth knowing by heart. At 0 °C and 1 atm one mole of any ideal gas occupies 22.414 L; at IUPAC's standard conditions of 0 °C and 100 kPa it is 22.711 L, and at 25 °C and 1 atm it is 24.465 L. Gas density follows from ρ = PM ÷ RT, which is why helium (4 g/mol) lifts balloons in air (29 g/mol) and CO₂ (44 g/mol) pools in low places.

Real gases deviate when molecules are crowded or attract each other strongly, that is at high pressure or near condensation. Air, nitrogen, oxygen, helium and hydrogen at room temperature stay within about 1% of ideal up to several bar. Air in a 200 bar scuba cylinder is roughly 3 to 4% less dense than the ideal law predicts, and steam, propane or CO₂ near their condensation points can be off by tens of percent. For those cases use the compressibility factor Z (PV = ZnRT) or a real-gas equation of state.

Common use cases

  • Chemistry problems

    Solve PV = nRT and combined gas law questions in whatever units the problem uses, with no R-value mix-ups.

  • Gas cylinders and tanks

    Estimate how many moles or kilograms of gas a cylinder holds at a given pressure and temperature.

  • Lab reactions

    Convert the volume of gas collected in an experiment into moles, or predict the volume a reaction will produce.

  • Ventilation and safety

    Work out the density of a gas such as CO₂ or propane in air to judge whether it rises or settles.

Tips and limitations

  • Always use absolute temperature (kelvin) and absolute pressure. The calculator converts °C and °F for you, and the gauge switch adds 101.325 kPa.
  • STP is not one fixed standard. IUPAC uses 0 °C and 100 kPa; older texts use 0 °C and 1 atm; NIST and many engineers use 20 °C and 1 atm. Say which one you mean.
  • For humid air, the water vapour lowers the average molar mass slightly, so moist air is a little less dense than dry air at the same temperature and pressure.
  • The ideal law is a poor model for vapours near condensation. Propane in a cylinder is a liquid with vapour above it, and its pressure is set by temperature, not by PV = nRT.
  • Molecule counts use the exact Avogadro constant, 6.02214076 × 10²³ per mole.

Frequently asked questions

What is the ideal gas law?

PV = nRT: pressure times volume equals moles times the gas constant times absolute temperature. With P in pascals, V in m³ and T in kelvin, R = 8.314462618 J/(mol·K).

Which value of R should I use?

It depends on units: 8.314 J/(mol·K) for Pa and m³, 0.08206 L·atm/(mol·K) for litres and atmospheres, 62.36 L·Torr/(mol·K) for litres and Torr. This calculator converts everything to SI, so you never have to choose.

What volume does one mole of gas occupy?

22.414 L at 0 °C and 1 atm, 22.711 L at 0 °C and 100 kPa (IUPAC STP) and 24.465 L at 25 °C and 1 atm, for any ideal gas.

Should I use gauge or absolute pressure?

Absolute. Gauges read pressure above the surrounding air, so add about 101.3 kPa (14.7 psi, 1.013 bar) to a gauge reading. Select Gauge and the calculator does it for you.

How do I find the density of a gas?

Use ρ = PM ÷ RT, with molar mass M in kg/mol. Dry air at 15 °C and 101.325 kPa is 1.225 kg/m³. Pick a gas and the calculator shows its density for your conditions.

When does the ideal gas law stop being accurate?

At high pressures, low temperatures and near condensation, where molecular size and attraction matter. Room-temperature air is within 1% up to several bar, but steam, CO₂ and propane near saturation can deviate strongly.

What is the combined gas law?

For a fixed amount of gas, P1V1 ÷ T1 = P2V2 ÷ T2. Holding temperature constant gives Boyle's law, holding pressure constant gives Charles's law, and holding volume constant gives Gay-Lussac's law.

Is there an in-depth guide to the Ideal Gas Law Calculator?

Yes. “The Ideal Gas Law PV = nRT: Units, STP and When It Fails” covers the background, how it works, common pitfalls and worked examples. Read the full guide.

People also search for

  • ideal gas law calculator with units
  • how many moles of gas in a container
  • molar volume of gas at stp 22.4 l
  • what value of r to use in pv=nrt
  • calculate gas density from pressure and temperature
  • combined gas law p1v1/t1 = p2v2/t2 calculator
  • gauge pressure vs absolute pressure in gas law
  • how much does the air in a scuba tank weigh