Ideal Gas Law Calculator (PV = nRT)
The ideal gas law ties together, in a single equation, the pressure, volume, amount and temperature of a gas: P·V = n·R·T. Pick the quantity you are missing, enter the others in whatever unit suits you, and read off the answer — or follow a fixed amount of gas from one state to another with the combined gas law.
The ideal gas model treats molecules as point particles with no interactions: it is remarkably accurate for air and everyday gases at ordinary pressures and temperatures. R = 8.314 J/(mol·K) is the universal gas constant. Temperatures are always converted to kelvin for the calculation.
Mode and inputs
Result
- Pressure P 22.71 bar
| Pressure P | 22.71 bar (2,270,969 Pa) |
| Volume V | 1.00 L (0.001000 m³) |
| Amount of substance n | 1.0000 mol |
| Temperature T | 0.00 °C (273.15 K) |
| Molar volume V/n | 1.000 L/mol |
P = n · R · T / V
Understanding the ideal gas law
Boyle, Charles, Gay-Lussac, Avogadro — four lab facts, one equation. P·V = n·R·T is the equation of state for a dilute gas: four quantities locked together, so any three pin the fourth. A tyre, a weather balloon, a cylinder of argon. Same relation.
Ideal here does not mean “perfect in the marketing sense”. It means the molecules have no size and no attraction. Room-temperature air, a few bar: that is close enough that the error usually sits under one percent. Liquid nitrogen at 77 K, or CO₂ in a fire extinguisher at 50 bar, is a different conversation.
P · V = n · R · T · R = 8.314 J/(mol·K)
The four quantities, and the units that go with them
- P — pressure. Force per area. SI unit the pascal (Pa). Everyday stand-ins: bar (10⁵ Pa), atmosphere (101,325 Pa), psi (6,894.8 Pa), mmHg, hPa on a weather chart.
- V — volume the gas occupies. SI unit m³. The litre (10⁻³ m³) is what you actually type.
- n — amount of substance, in moles. One mole is 6.022 × 10²³ molecules. Mass is n times the molar mass; air is about 29 g/mol.
- T — absolute temperature, always kelvin in the formula. T(K) = t(°C) + 273.15. Plug in 20 °C as “20” and the answer is nonsense. The calculator converts; a hand calculation does not forgive you.
R is 8.314 J/(mol·K), which is also 8.314 Pa·m³/(mol·K). That is the SI pairing: P in pascals, V in cubic metres. Mix bar with litres and you need a different wrapping of R, or — simpler — let this page do the unit work and keep R at 8.314.
The combined gas law, and the three named special cases
Hold n fixed and move from state 1 to state 2. Then P·V/T is the same at both ends:
P₁ V₁ / T₁ = P₂ V₂ / T₂
Freeze one of the three and a 17th-century name drops out:
- Isothermal (T fixed) → P·V = constant. Boyle's law. Halve the volume, double the pressure. A bicycle pump, slowly, before the air warms up.
- Isobaric (P fixed) → V/T = constant. Charles's law. Heat a gas and it expands in proportion to its kelvin temperature. A balloon over a radiator.
- Isochoric (V fixed) → P/T = constant. Gay-Lussac's law. Heat a sealed tin and the pressure climbs. A closed heating circuit, a gas cylinder left in the sun.
The transformation mode on this page is the combined statement. Tick the quantity that stays put, or leave all three free and solve for whichever you marked unknown.
Worked examples
- Molar volume — one mole, 0 °C, 1 atm: V = 22.4 L. Same mole at 25 °C and 1 atm: 24.5 L. That second figure is SATP, the one a lot of chemistry labs now quote. Type n = 1, T = 0 °C, P = 1 atm, solve for V, and check you land on 22.4.
- Car tyre — 2.2 bar at 20 °C, then a drive warms the air to 50 °C. Volume of the carcass barely changes, so isochoric: P₂ = P₁ × T₂/T₁ = 2.2 × 323.15/293.15 ≈ 2.43 bar. The gauge reading ticks up. You did not add air.
- Scuba cylinder — 12 L at 200 bar, 15 °C. Single-state, solve for n: about 100 mol of air, roughly 2.9 kg. Empty the tank to 50 bar at the same temperature and you have used three-quarters of the moles, not three-quarters of the “volume”. The volume never changed.
Which value of R to use if you work by hand
R is one constant. The number changes when the pressure and volume units change. A few that actually show up on exam papers:
- 8.314 J/(mol·K) — P in Pa, V in m³. Also 8.314 kPa·L/(mol·K) if you like litres with kilopascals.
- 0.08314 L·bar/(mol·K) — P in bar, V in litres. Handy for cylinders.
- 0.08206 L·atm/(mol·K) — the old chemistry value, still in a lot of US textbooks.
Mix them and you invent a wrong answer with the right digits. This calculator stays on 8.314 and converts your units into SI before the multiply. That is the boring, correct way.
Density and molar mass
Mass m = n·M, so the ideal-gas law also reads P·M = ρ·R·T, with ρ = m/V. Rearrange for density, or for the molar mass of an unknown gas from a measured P, V, T and a weighing.
ρ = P · M / (R · T) · M = ρ · R · T / P
Dry air at 1 atm and 20 °C: M ≈ 29 g/mol gives ρ ≈ 1.2 kg/m³. That is the number in a ventilation calculation. Helium at the same state is about seven times lighter. A helium balloon lifts because the displaced air weighs more than the helium plus the bag, not because helium “wants to go up”.
Mixtures: Dalton's law of partial pressures
In an ideal mixture each gas behaves as if it were alone in the volume, at its own partial pressure pᵢ = nᵢ R T / V. The measured pressure is the sum: P = p₁ + p₂ + … Air at 1 atm is roughly 0.78 atm of nitrogen plus 0.21 atm of oxygen plus a handful of argon and CO₂. Mole fractions add to one; partial pressures add to P.
A scuba fill of nitrox, a natural-gas mix, moist air in a condenser — same additivity, as long as nobody is close to condensing. Water vapour is the usual exception: once liquid water is present the vapour pressure is set by temperature, not by n.
The ideal-gas model peels away from reality at high pressure (molecules packed) and low temperature (near liquefaction). Interactions and the molecules' own volume start to matter; Van der Waals, virial expansions, or a real-gas chart then take over. For air at everyday workshop conditions the error stays below 1 %. A CO₂ fire-extinguisher bottle, or nitrogen at 200 bar and −20 °C, is not everyday workshop conditions.