Skip to content

Ideal Gas Law Calculator

Solve PV = nRT for pressure, volume, moles or temperature in any units, plus the combined gas law, STP and SATP, and the gas mass and density.

Calculator Details

Volume (V):22.711 LSee results ↓

PV = nRT, or the combined gas law for a fixed amount of gas

The unknown; enter the other three

Absolute pressure (gauge pressure + atmospheric)

Amount of gas in moles (mass ÷ molar mass)

Gas temperature; converted to kelvin for the formula

g/mol, for the mass and density of the gas; dry air is about 28.96

Your Results

Volume (V): 22.711 L

Volume (V)

22.711 L

Molar volume

22.711 L/mol

22.711 L/mol at STP

Mass of gas

28.9644 g

At 28.9644 g/mol

Gas density

1.27535 kg/m³

ρ = PM ÷ RT

1 mol of an ideal gas at 100 kPa and 0 °C occupies 22.711 L (22.711 L/mol).

Compare scenarios

Save these inputs as a scenario, change them, and compare the results side by side.

Loading, available in a moment

Detailed Breakdown

All four values, in your units and in SI
QuantityYour unitsSI units
Pressure100 kPa100,000 Pa
Volume (calculated)22.711 L0.022711 m³
Amount1 mol1 mol
Temperature0 °C273.15 K

How This Calculator Works

How It’s Calculated

P × V = n × R × T    R = 8.31446261815324 J/(mol·K)

Your calculation (SI units): 100,000 Pa × 0.022711 m³ = 1 mol × 8.31446 J/(mol·K) × 273.15 K. The calculator converts your units to pascals, cubic metres and kelvin, solves for the unknown and converts back.

Frequently Asked Questions

What is the ideal gas law?

PV = nRT links the pressure P, volume V, amount n (in moles) and absolute temperature T of a gas. R is the molar gas constant, 8.31446261815324 J/(mol·K), exact since the 2019 SI redefinition because it is the product of the Avogadro and Boltzmann constants. Knowing any three quantities gives the fourth.

Which value of R should I use?

It depends on your units. In SI units (Pa, m³, K) R = 8.314 J/(mol·K). With litres and atmospheres it is 0.08206 L·atm/(mol·K); with litres and kilopascals it is 8.314 L·kPa/(mol·K). This calculator converts every input to SI first, so you never need to choose.

Why must temperature be in kelvin?

The gas law is a proportion: double the absolute temperature and, at fixed pressure, the volume doubles. That only works on a scale that starts at absolute zero. Going from 10 °C to 20 °C is not a doubling; in kelvin it is 283.15 K to 293.15 K, a 3.5% rise. The calculator converts °C and °F to kelvin for you.

What are STP and SATP?

IUPAC standard temperature and pressure (STP) has been 0 °C (273.15 K) and 100 kPa since 1982, where one mole of ideal gas occupies 22.711 L. Older textbooks use 1 atm (101.325 kPa), giving 22.414 L. SATP, standard ambient temperature and pressure, is 25 °C (298.15 K) and 100 kPa.

What is the combined gas law?

For a fixed amount of gas, PV ÷ T stays constant, so P₁V₁/T₁ = P₂V₂/T₂. It combines Boyle’s law (PV constant at fixed T), Charles’s law (V/T constant at fixed P) and Gay-Lussac’s law (P/T constant at fixed V). Choose the combined mode to find the new pressure, volume or temperature after a change.

When does the ideal gas law stop being accurate?

At high pressures and low temperatures, near the point where a gas condenses. Real molecules take up space and attract each other, which the ideal law ignores. For air, nitrogen and oxygen near room conditions the error is well under 1%; for steam, carbon dioxide under pressure or refrigerants, use an equation of state such as van der Waals or published property tables.

Should I use gauge or absolute pressure?

Absolute. A tire gauge reading of 32 psi means 32 psi above the atmosphere, about 46.7 psi absolute at sea level. Add the local atmospheric pressure (about 14.7 psi or 101.3 kPa at sea level) to a gauge reading before you use it in the gas law.

How do I find the density of a gas?

Rearranging PV = nRT with n = m ÷ M gives ρ = PM ÷ RT, where M is the molar mass in kg/mol. Dry air (28.96 g/mol) at 0 °C and 1 atm is about 1.29 kg/m³. Enter the molar mass in the calculator to see the gas density and the mass of gas in your volume.

Uses PV = nRT with the exact CODATA 2022 gas constant and exact unit factors (NIST SP 811); STP and SATP follow IUPAC (100 kPa). It assumes an ideal gas: no molecular volume or attraction, so it leaves out real-gas behaviour at high pressure or near condensation (van der Waals, compressibility factor), gas mixtures with partial pressures, and humidity. Pressures must be absolute, not gauge. Results are rounded to 6 significant figures.

Ideal Gas Law Calculator: PV = nRT and the Combined Gas Law

By FindMySum · Last reviewed

An ideal gas law calculator solves PV = nRT for whichever of the four quantities you don't know. The equation describes how most gases behave at everyday conditions: squeeze a gas and its pressure rises, heat it and it expands, add more of it and it fills more space. This article explains each term, the units that trip people up, the difference between STP and SATP, and the combined gas law for a gas that changes state.

The equation

P × V = n × R × T

  • P is the absolute pressure, in pascals in SI units.
  • V is the volume, in cubic metres.
  • n is the amount of gas in moles.
  • T is the absolute temperature in kelvin.
  • R is the molar gas constant, 8.314 462 618 153 24 J/(mol·K).

Since 2019 the Avogadro constant and the Boltzmann constant have exact defined values in the SI, and R is their product, so R is exact too. The calculator converts every input to pascals, cubic metres and kelvin, solves the equation for the unknown and converts the result back to your units.

Worked example: the calculator's defaults

One mole of gas at 0 °C and 100 kPa:

  1. Temperature in kelvin: 0 + 273.15 = 273.15 K.
  2. Pressure in pascals: 100 kPa = 100,000 Pa.
  3. V = nRT ÷ P = 1 × 8.314 462 618 × 273.15 ÷ 100,000 = 0.022 711 m³ = 22.711 L.

That is the molar volume of an ideal gas at IUPAC standard conditions, a value CODATA lists as 22.710 954 64 L/mol. At 1 atm instead of 100 kPa, the same calculation gives 22.414 L, the figure in older textbooks.

With the molar mass of dry air (28.9644 g/mol) the calculator also gives the mass, 28.96 g, and the density: ρ = PM ÷ RT = 1.275 kg/m³ at 0 °C and 100 kPa.

Units that cause mistakes

Absolute temperature. Celsius and Fahrenheit have arbitrary zeros, so the proportion doesn't hold on those scales. Always convert: K = °C + 273.15.

Absolute pressure. Tire and gas-cylinder gauges read pressure above the atmosphere. Add atmospheric pressure (about 101.3 kPa or 14.7 psi at sea level) to get absolute pressure.

Volume. One cubic metre is 1,000 litres and one litre is 1,000 cm³ (or mL). A tenfold slip here gives a tenfold wrong answer.

Matching R to units. If you work by hand in litres and atmospheres, use R = 0.082 057 L·atm/(mol·K). The calculator avoids the issue by working in SI.

STP and SATP

"Standard conditions" have changed over time. IUPAC's standard temperature and pressure (STP) has been 273.15 K and 100 kPa (1 bar) since 1982. Many textbooks and some industries still use 273.15 K and 1 atm (101.325 kPa). Standard ambient temperature and pressure (SATP) is 298.15 K and 100 kPa, closer to room conditions. The STP and SATP buttons fill in the IUPAC values in pascals and kelvin.

The combined gas law

When a fixed amount of gas changes from one state to another, n and R cancel and:

P₁V₁ ÷ T₁ = P₂V₂ ÷ T₂

Worked example. Gas at 100 kPa, 2 L and 300 K is compressed to 200 kPa while it warms to 400 K. V₂ = P₁V₁T₂ ÷ (T₁P₂) = 100 × 2 × 400 ÷ (300 × 200) = 1.333 L. Doubling the pressure alone would halve the volume to 1 L; the temperature rise of a third pushes it back up to 1.333 L.

Because pressure and volume appear on both sides, their units cancel: any pressure unit and any volume unit work, as long as both states use the same ones. Temperatures still have to be absolute.

The special cases have their own names. Hold T constant and you get Boyle's law, P₁V₁ = P₂V₂. Hold P constant and you get Charles's law, V₁ ÷ T₁ = V₂ ÷ T₂. Hold V constant and you get Gay-Lussac's law, P₁ ÷ T₁ = P₂ ÷ T₂.

When real gases differ

The ideal gas model treats molecules as points that don't attract each other. Real gases deviate when they are compressed hard or cooled close to condensing, because molecular size and attraction start to matter. Near room temperature and atmospheric pressure, air, nitrogen, oxygen, argon and helium follow the ideal law to within a fraction of a percent. Carbon dioxide in a pressurised cylinder, steam near its boiling point and refrigerants do not, and engineers use the van der Waals equation, a compressibility factor or property tables for them.

More questions

Why does a sealed bag of chips puff up on a mountain road?

The amount of gas in the bag and its temperature barely change, but the outside pressure drops with altitude. At 2,000 m the air pressure is roughly 80 kPa instead of 101 kPa. Boyle's law (P₁V₁ = P₂V₂ at constant temperature) says the gas expands until its pressure matches, so the volume grows by about a quarter, as far as the bag allows.

How much does tire pressure change with temperature?

At a fixed volume, absolute pressure is proportional to absolute temperature. A tire at 220 kPa gauge (about 321 kPa absolute) filled at 20 °C (293 K) drops to about 321 × 253 ÷ 293 = 277 kPa absolute at −20 °C, or 176 kPa gauge. That is why tire pressure warnings come on during the first cold snap in a Canadian autumn.

What is the universal gas constant in other units?

R = 8.314 462 618 J/(mol·K) = 8.314 L·kPa/(mol·K) = 0.082 057 L·atm/(mol·K) = 62.364 L·mmHg/(mol·K) = 1.987 cal/(mol·K). They are the same constant expressed in different units. Mixing a value of R with the wrong units is the most common error in hand calculations.

Does the ideal gas law work for a mixture like air?

Yes, as long as each component behaves ideally. Treat n as the total moles of all gases. Each gas then contributes a partial pressure in proportion to its mole fraction (Dalton's law), and the partial pressures add up to the total. Air at room conditions follows the ideal gas law to within a fraction of a percent.

What is Avogadro's law?

At the same temperature and pressure, equal volumes of any ideal gas contain the same number of molecules. It follows from PV = nRT: fix P and T and V is proportional to n. It is why one mole of any ideal gas occupies about 22.7 L at 0 °C and 100 kPa, whether it is hydrogen or carbon dioxide.

Sources

This article explains how the calculator works and is general information, not financial, tax, legal or medical advice. Rules change; check the sources above or a qualified professional before you act.

Spotted a wrong result or a bug? Report a problem

May we count your visits with Invoker Analytics? It keeps a random visitor number in your browser. Your calculator inputs are never sent. Privacy policy