Ideal Gas Law Calculator

Calculate pressure, volume, moles, or temperature of an ideal gas using PV = nRT.

0°C = 273 K, 25°C = 298 K
Please check your inputs and try again.

What the Ideal Gas Law Assumes

The equation PV = nRT is exact for a gas whose molecules have zero volume and no attraction to each other. No real gas satisfies either condition, but at ordinary temperatures and pressures both assumptions are close enough that the law works remarkably well.

PV = nRT
Value of RUnitsUse when
0.08206L·atm/(mol·K)Pressure in atm, volume in litres
8.314J/(mol·K)SI units, pressure in Pa, volume in m³
62.36L·mmHg/(mol·K)Pressure in mmHg or torr
0.08314L·bar/(mol·K)Pressure in bar

Choosing R to match your pressure and volume units is the whole trick. Temperature is always kelvin regardless — the law involves absolute temperature because at 0 K molecular motion ceases entirely and the equation must give zero volume.

Molar Volume and Standard Conditions

ConditionTemperaturePressureMolar volume
STP (IUPAC, current)273.15 K (0°C)1 bar22.71 L/mol
STP (older definition)273.15 K (0°C)1 atm22.41 L/mol
SATP298.15 K (25°C)1 bar24.79 L/mol
Room conditions293.15 K (20°C)1 atm24.06 L/mol

The familiar 22.4 L/mol figure uses the older 1 atm definition. IUPAC changed the standard pressure to 1 bar in 1982, which gives 22.71 L/mol — a 1.3% difference that matters in careful work and causes confusion when textbooks of different vintages disagree.

Where It Breaks Down

ConditionWhat failsDirection of error
High pressureMolecular volume no longer negligibleReal volume larger than predicted
Low temperatureIntermolecular attraction significantReal volume smaller than predicted
Near condensationBoth effects, plus phase changeLaw fails entirely
Polar gases (NH3, H2O)Strong dipole attractionDeviation at moderate conditions

The van der Waals equation corrects both effects with two parameters: a for intermolecular attraction and b for excluded molecular volume. At everyday conditions those corrections are small, which is why the ideal law survives as the everyday tool.

Worked Examples

Example 1: STP: 1 mol ideal gas at 0°C (273K), 1 atm
V = 1×0.08206×273/1
Result: 22.4 L
Molar volume of ideal gas at STP
Example 2: Car tire: P=2.5 atm, V=10L, T=300K
n = 2.5×10/(0.08206×300)
Result: 1.015 mol air
About 29 g of air in the tire
Example 3: Gas density from molar mass
CO2, M = 44 g/mol, at STP (1 atm, 273 K)
Result: ρ = 44/22.41 = 1.96 g/L
Density equals molar mass divided by molar volume. This is why CO2 sinks in air, whose average molar mass is about 29.
Example 4: Combined gas law
2.0 L at 300 K and 1 atm, warmed to 400 K at constant pressure
Result: V = 2.0 × 400/300 = 2.67 L
With n and P fixed, PV = nRT reduces to V1/T1 = V2/T2. The combined gas law is not a separate rule, just the ideal law with terms cancelled.
Example 5: Deviation at high pressure
Nitrogen at 300 atm and 273 K
Result: Real volume about 7% above ideal prediction
At high pressure, molecular volume dominates over attraction, so the gas is less compressible than the ideal law predicts.

Common Mistakes

⚠️
Using Celsius instead of Kelvin

The law requires absolute temperature. Using 25 instead of 298 gives an answer wrong by more than a factor of ten, and negative Celsius values produce nonsense.

⚠️
Mismatching R with the pressure units

R = 0.08206 requires atm and litres; R = 8.314 requires pascals and cubic metres. Mixing them is the most frequent error in gas calculations.

⚠️
Assuming 22.4 L/mol always applies

That value holds only at 0°C and 1 atm. At room temperature the molar volume is about 24 L/mol, and IUPAC's current STP definition gives 22.71.

⚠️
Applying the law near condensation

Close to the boiling point, attractive forces dominate and the gas is about to liquefy. Neither assumption behind the law survives there.

Frequently Asked Questions

When does ideal gas law fail?
At high pressures (>10 atm) and low temperatures (near condensation point), real gases deviate significantly. Use van der Waals equation for corrections.
What is STP vs SATP?
STP (Standard Temperature and Pressure): 0°C (273.15K), 1 atm — molar volume 22.4 L. SATP (25°C, 1 bar): molar volume 24.8 L. Check which standard a problem uses.
When does the ideal gas law fail?
At high pressure where molecular volume matters, at low temperature where attractions matter, and near condensation where both apply. Polar gases deviate at milder conditions.
Which value of R should I use?
Match it to your pressure and volume units: 0.08206 for atm and litres, 8.314 for SI units, 62.36 for mmHg. Temperature is always in kelvin.
Why is molar volume sometimes 22.4 and sometimes 22.71?
IUPAC redefined standard pressure from 1 atm to 1 bar in 1982. The older definition gives 22.41 L/mol and the current one gives 22.71.
What is the difference between STP and SATP?
STP is 0°C and 1 bar; SATP is 25°C and 1 bar. SATP is closer to laboratory conditions, giving a molar volume of 24.79 L/mol.
How does the van der Waals equation improve on it?
It adds a term for intermolecular attraction and subtracts one for the volume occupied by the molecules themselves, correcting both failing assumptions.

Formula Explorer connections

Interpretation: PV=nRT balances mechanical state (pressure and volume) with thermal state and amount. Holding two quantities fixed produces Boyle’s, Charles’s or Avogadro’s law. Assumption: particles have negligible volume and intermolecular forces; accuracy declines at high pressure and low temperature.

Boyle’s Law →Charles’s Law →Real-Gas Correction →Chemistry Formula Explorer →