Skip to content

Ideal Gas Law Calculator

Find the pressure, volume, amount or temperature of a gas from the other three with PV = nRT. Mix units freely and give the amount in moles or grams. Advanced adds the combined gas law, gas density, molar mass and standard conditions.

Combined law, density, STP, molar mass
What do you want to find?

V = n × R × T ÷ P

The answer appears in the highlighted box; change its unit to see it another way. Pick g or kg for the amount to work from a mass. Use absolute pressure: a tyre gauge reading + 1 atm (14.7 psi).

Significant figures
ResultUpdates as you type—Volume—Moles of gas—Molar volume (V ÷ n)—Density (g/L = kg/m³)—Mass of gas—Molecules
The answer in every unit

Standard conditions

One mole of ideal gas takes this much room. Tap Use to put the pressure and temperature into the calculator above.

STP (IUPAC, since 1982)0 °C and 100 kPa (1 bar)22.711 L/mol
STP (older textbook)0 °C and 1 atm (101.325 kPa)22.414 L/mol
SATP (room conditions)25 °C and 100 kPa (1 bar)24.79 L/mol
NTP20 °C and 1 atm24.055 L/mol

Combined gas law: before and after

The same gas changes from state 1 to state 2. Pick a law, what to find, and fill in the rest. Each row uses one unit for both states.

Gas law

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

Find
Pressure
Volume
Temperature
Amount
—Volume after—Change

How your gas sum is worked out

Your numbers: everything into SI units, multiply n × R × T, then divide by the pressure.

  1. 1

    Temperature in K

    0 °C= 273.15 K

  2. 2

    Into SI units

    1 atm = 101,325 Pan = 1 mol

  3. 3

    n × R × T

    1 × 8.3145 ×273.15 K= 2,271.1 J

  4. 4

    Divide by pressure

    2,271.1 ÷ 101,325 Pa= 0.022414 m³= 22.41 L

Read more: the formula, worked examples, standard conditions and gas data

A gas pushes on its container because its molecules keep hitting the walls. Squeeze it into less room, add more molecules or heat it up, and the hits get more frequent or harder, so the pressure rises. The ideal gas law puts all four together in one line, and every answer here is that line turned around.

The formula

pressure P × volume V = moles n × R × temperature T
R = 8.314462618 J/(mol·K) (exact: Avogadro constant × Boltzmann constant)
P = n × R × T ÷ V
V = n × R × T ÷ P
n = P × V ÷ (R × T)
T = P × V ÷ (n × R)
moles n = mass ÷ molar mass M
molar mass M = mass × R × T ÷ (P × V)
density ρ = P × M ÷ (R × T)
combined: P₁ × V₁ ÷ (n₁ × T₁) = P₂ × V₂ ÷ (n₂ × T₂)
P in pascals, V in cubic metres, T in kelvin (°C + 273.15)

Worked example

Volume (the default): 1 mol of gas at 0 °C and 1 atm. Temperature: 0 + 273.15 = 273.15 K. Pressure: 1 atm = 101,325 Pa. Then n × R × T = 1 × 8.314462618 × 273.15 = 2,271.0955 J, and V = 2,271.0955 ÷ 101,325 = 0.022414 m³ = 22.41 L.

Pressure: 2 mol in 10 L at 300 K. 10 L = 0.01 m³. P = 2 × 8.314462618 × 300 ÷ 0.01 = 498,868 Pa ≈ 498.9 kPa ≈ 4.923 atm.

Moles: 5 L at 200 kPa and 25 °C. P × V = 200,000 × 0.005 = 1,000 J. R × T = 8.314462618 × 298.15 = 2,478.957. n = 1,000 ÷ 2,478.957 = 0.4034 mol.

From grams: 10 g of carbon dioxide (44.009 g/mol) at 25 °C and 1 atm. n = 10 ÷ 44.009 = 0.22723 mol. V = 0.22723 × 8.314462618 × 298.15 ÷ 101,325 = 0.0055592 m³ = 5.559 L.

Molar mass of an unknown gas: 1.00 g fills 0.5 L at 1 atm and 25 °C. n = 101,325 × 0.0005 ÷ (8.314462618 × 298.15) = 0.020437 mol, so M = 1 ÷ 0.020437 = 48.93 g/mol.

Density: dry air (28.96 g/mol) at 0 °C and 1 atm: ρ = 101,325 × 0.02896 ÷ (8.314462618 × 273.15) = 1.292 kg/m³ (1.292 g/L).

Combined gas law: 10 L at 1 atm and 25 °C is squeezed to 2 atm and warmed to 50 °C. V₂ = 10 × (1 ÷ 2) × (323.15 ÷ 298.15) = 5.419 L.

The gas laws inside it

LawKept the sameEquationIn words
Boyle’s lawtemperature, amountP₁V₁ = P₂V₂Halve the volume, double the pressure.
Charles’s lawpressure, amountV₁ ÷ T₁ = V₂ ÷ T₂Heat a balloon and it grows.
Gay-Lussac’s lawvolume, amountP₁ ÷ T₁ = P₂ ÷ T₂A sealed can or tyre gets more pressure when hot.
Avogadro’s lawpressure, temperatureV₁ ÷ n₁ = V₂ ÷ n₂Twice the gas takes twice the room.
Combined gas lawamountP₁V₁ ÷ T₁ = P₂V₂ ÷ T₂All three change together.

Standard conditions and molar volume

Worked out from V ÷ n = R × T ÷ P. Watch which STP a book means: IUPAC changed it from 1 atm to 100 kPa in 1982.

NameConditionsMolar volume
STP (IUPAC, since 1982)0 °C and 100 kPa (1 bar)22.711 L/mol
STP (older textbook)0 °C and 1 atm (101.325 kPa)22.414 L/mol
SATP (room conditions)25 °C and 100 kPa (1 bar)24.79 L/mol
NTP20 °C and 1 atm24.055 L/mol

The gas constant R in other units

ValueUnits
8.314462618J/(mol·K) = Pa·m³/(mol·K)
8.314462618kPa·L/(mol·K)
0.0820574L·atm/(mol·K)
0.0831446L·bar/(mol·K)
62.3636L·mmHg/(mol·K)
1.9872cal/(mol·K)

Common gases (rounded textbook molar masses)

GasMolar mass (g/mol)Density at 0 °C, 1 atm (g/L)
Dry air28.961.292
Nitrogen (N₂)28.0131.25
Oxygen (O₂)31.9981.428
Carbon dioxide (CO₂)44.0091.963
Helium (He)4.00260.1786
Hydrogen (H₂)2.0160.08994
Argon (Ar)39.951.782
Methane (natural gas) (CH₄)16.0430.7158
Ammonia (NH₃)17.0310.7598
Propane (C₃H₈)44.0971.967
Water vapour (steam) (H₂O)18.0150.8037 (would condense)

Molar masses are rounded values from standard atomic weights as printed in most textbooks; dry air is the usual mean of about 28.96 g/mol. Densities are ideal-gas values; real ones differ slightly (for example CO₂ is about 0.7% denser at 0 °C and 1 atm).

Notes

  • Real gases are not perfectly ideal. At everyday conditions air, nitrogen, oxygen, helium and hydrogen are within about 1%. Above about 10 bar, or at low temperatures near where the gas turns liquid, the real answer can be several percent or more away (CO₂, propane, ammonia and steam stray first). The calculator warns you in those ranges.
  • Use absolute pressure. A tyre or cylinder gauge shows pressure above the air around it, so add about 1 atm (101.325 kPa, 14.7 psi) at sea level.
  • The temperature must be absolute too. The calculator converts °C, °F and °R to kelvin for you; anything at or below absolute zero (−273.15 °C) is rejected.
  • R is exact in the SI since 2019: it is the Avogadro constant (6.02214076 × 10²³ per mol) times the Boltzmann constant (1.380649 × 10⁻²³ J/K).

Common questions

What is the ideal gas law?

It links the pressure, volume, amount and temperature of a gas: P × V = n × R × T. P is the pressure in pascals, V the volume in cubic metres, n the amount in moles, T the temperature in kelvin and R the gas constant, 8.314462618 J/(mol·K). If you know three of them, the law gives the fourth.

What value of R should I use?

In SI units R = 8.314462618 J/(mol·K), which is also 8.314 Pa·m³/(mol·K) or 8.314 kPa·L/(mol·K). With litres and atmospheres it is 0.082057 L·atm/(mol·K). This calculator turns every unit into SI first, so you never have to pick an R.

Why must the temperature be in kelvin?

The law needs absolute temperature, counted from absolute zero. 0 °C is 273.15 K, so a gas at 20 °C is not "twice as hot" as one at 10 °C: it is only 293.15 ÷ 283.15 = 1.035 times. Using °C or °F directly gives wrong answers (and division by zero at 0 °C). Type any unit here and it is converted for you.

What is the volume of 1 mole of gas at STP?

At the IUPAC standard (0 °C and 100 kPa) one mole of ideal gas takes 22.711 L. Many older books use 0 °C and 1 atm, which gives 22.414 L. At room conditions (25 °C, 1 bar) it is 24.790 L.

How do I find the moles from grams?

Divide the mass by the molar mass. 10 g of carbon dioxide (44.009 g/mol) is 10 ÷ 44.009 = 0.2272 mol. Pick a mass unit in the amount box and this calculator does it for you, using the molar mass you give or a gas from the list.

When is the ideal gas law not accurate?

Real gases behave almost ideally at everyday pressures and temperatures, usually within 1%. At high pressure (above about 10 bar) or low temperature (near the point where the gas would turn liquid), the molecules’ own size and their pull on each other matter, and the real volume or pressure can differ by several percent or more. Then engineers use a correction such as the compressibility factor Z or the van der Waals equation.

Related calculators

Molarity CalculatorMass, molar mass, volume or molarity from the other three in mixed units, molar mass from a formula, common compounds, dilution C1V1 = C2V2, % w/v and ppm.Pressure converterpsi to bar, bar to psi, kPa, hPa, mbar, atm, mmHg, inHg and kg/cm², for tyres, weather, blood pressure and altimeters, with gauge ↔ absolute.Celsius to Fahrenheit converter°C to °F and °F to °C with the sum in your numbers, body, fever, weather and oven temperatures, gas marks, Kelvin, Rankine and charts.Half-Life CalculatorAmount left, starting amount, time or half-life from the other three, in mixed time units, with the decay constant, mean lifetime, a decay table and curve, and textbook isotopes.

Made by Zulu Calculator, part of AlphaZulu LLC. Formulas are shown in full and rule figures are checked against official sources; see how we build calculators.

Embed this calculator on your site

Free to use on your website or blog. Paste this code where you want the calculator to appear. Please keep the credit link.

Ideal Gas Law Calculator by Zulu Calculator ↗