Chemistry

Ideal gas law calculator (PV = nRT)

The ideal gas law, PV = nRT, relates the pressure, volume, amount and absolute temperature of a gas. This ideal gas law calculator solves for any one of the four, accepts pressure in atm, kPa, bar or mmHg and temperature in °C, K or °F, and also gives the number of gas particles.

mol

Runs in your browser. Nothing you type is sent to us.

Volume

22.41397 L

PV = nRT

Pressure
1 atm · 101.325 kPa
Volume
22.41397 L
Moles
1 mol
Temperature
273.15 K · 0 °C
Number of particles
6.022 × 10^23

Key facts

  • PV = nRT, with R = 0.082057 L·atm/(mol·K) = 8.314 J/(mol·K).
  • One mole of an ideal gas at 0 °C and 1 atm occupies 22.414 L.
  • Temperature must be absolute: K = °C + 273.15.
  • The law works well for most gases at ordinary temperatures and pressures.

What is the ideal gas law?

The ideal gas law combines Boyle’s law (P ∝ 1/V), Charles’s law (V ∝ T), Gay-Lussac’s law (P ∝ T) and Avogadro’s law (V ∝ n) into a single equation. It describes an "ideal" gas whose particles take up no space and do not attract each other. Real gases such as air, nitrogen and oxygen behave almost ideally at room temperature and normal pressures, so the law is used everywhere from tyre pressures to weather balloons to industrial chemistry.

How to use the ideal gas law calculator

  1. Choose what to solve for: volume, pressure, moles or temperature.
  2. Enter the other three values, choosing pressure and temperature units.
  3. Read the answer and the full set of values in standard units, plus the number of molecules.

Ideal gas law formula

P × V = n × R × TV = nRT ÷ P P = nRT ÷ V n = PV ÷ RT T = PV ÷ nR
SymbolMeaningUnit used here
PAbsolute pressureatm (converted from kPa, bar or mmHg)
VVolumeL
nAmount of gasmol
RGas constant0.082057 L·atm/(mol·K)
TAbsolute temperatureK

Values of the gas constant R

ValueUnits
0.082057L·atm/(mol·K)
8.3145J/(mol·K) = L·kPa/(mol·K)
0.083145L·bar/(mol·K)
62.364L·mmHg/(mol·K)

Step-by-step examples: the ideal gas law

Example 1: molar volume at STP

1 mol at 0 °C (273.15 K) and 1 atm: V = 1 × 0.082057 × 273.15 ÷ 1 = 22.414 L.

Example 2: a balloon at room temperature

2 mol of helium at 25 °C (298.15 K) and 1 atm: V = 2 × 0.082057 × 298.15 ≈ 48.9 L.

Example 3: pressure in a container

0.5 mol of gas in a 10 L container at 20 °C (293.15 K): P = 0.5 × 0.082057 × 293.15 ÷ 10 ≈ 1.20 atm (122 kPa).

Example 4: temperature from the other values

1 atm, 22.414 L and 1 mol give T = 1 × 22.414 ÷ (1 × 0.082057) ≈ 273.15 K, which is 0 °C.

Standard conditions

ConventionTemperaturePressureMolar volume
Older STP (many textbooks)0 °C1 atm22.414 L/mol
IUPAC STP (since 1982)0 °C1 bar22.711 L/mol
Room conditions (SATP-like)25 °C1 atm24.465 L/mol

Check which convention your course uses; the difference between 22.4 and 22.7 L often explains a "wrong" answer.

When the ideal gas law breaks down

At high pressure, molecules are squeezed close enough that their own volume matters; at low temperature, attractions between them become important. Near condensation or above roughly 10 atm, use the van der Waals equation or other real-gas models. Polar gases such as ammonia and water vapour deviate more than nitrogen or helium.

Common mistakes with the ideal gas law

  • Using °C instead of kelvin. At 0 °C the equation would give zero volume.
  • Using gauge pressure. A tyre gauge reading of 2.2 bar means about 3.2 bar absolute.
  • Mismatched units for R. With kPa and litres, use R = 8.3145.
  • Forgetting to convert grams to moles. Use the grams to moles calculator first.

How the gas laws came together

The ideal gas law combines rules discovered over almost two centuries: Robert Boyle’s law (1662) that pressure and volume are inversely related, Jacques Charles’ observation (about 1787, published by Joseph Louis Gay-Lussac in 1802) that volume grows with temperature, and Amedeo Avogadro’s hypothesis (1811) linking volume to the number of molecules. Émile Clapeyron first wrote them as a single equation in 1834. Since the 2019 SI revision, the gas constant R = 8.314462618 J/(mol·K) is exact, being the product of the Boltzmann constant and the Avogadro constant.

"Standard conditions" vary, which causes confusion. IUPAC has defined standard temperature and pressure as 273.15 K and 100 kPa since 1982, giving a molar volume of 22.711 L, while many textbooks still use 1 atm and the older 22.414 L. Real gases deviate from ideal behaviour at high pressure and low temperature, which Johannes Diderik van der Waals described with his 1873 equation, earning the 1910 Nobel Prize in Physics. Scuba diving tables, weather balloons and tyre pressures in cold weather are everyday cases of the law. Spreading a gas into a larger volume at constant temperature lowers its pressure in proportion (Boyle’s law, P₁V₁ = P₂V₂), the gas-phase cousin of the dilution formula C₁V₁ = C₂V₂. For pressure on its own, use the pressure calculator; for moles from a mass, the grams to moles calculator; and for density, the density calculator.

Related: pressure calculator and unit converter.

How this calculator works

  • PV = nRT with R = 0.082057366 L·atm/(mol·K); choose which of P, V, n or T to solve for.
  • Pressure can be in atm, kPa, bar or mmHg, and temperature in °C, °F or K; everything is converted to atm and kelvin first.
  • The number of molecules = n × 6.02214076 × 10²³.
  • Temperature must be above absolute zero; real-gas corrections are not applied.

Frequently asked questions

What is the ideal gas law?

PV = nRT: pressure × volume = moles × gas constant × absolute temperature.

What is the value of R?

R = 8.314 J/(mol·K), or 0.082057 L·atm/(mol·K). Choose the value that matches your pressure and volume units.

What volume does 1 mole of gas occupy?

22.414 L at 0 °C and 1 atm, 22.711 L at 0 °C and 1 bar, and about 24.47 L at 25 °C and 1 atm.

Why must temperature be in kelvin?

The ideal gas law is based on absolute temperature, which starts at absolute zero. Celsius and Fahrenheit have arbitrary zero points.

What is STP?

Standard temperature and pressure. Traditionally 0 °C and 1 atm; IUPAC now uses 0 °C and 1 bar.

How do I find moles of gas from pressure, volume and temperature?

n = PV ÷ RT. 2 atm × 5 L ÷ (0.082057 × 300 K) ≈ 0.406 mol.

When is the ideal gas law not accurate?

At high pressures, low temperatures, near the point where the gas condenses, and for strongly polar gases.

What is the combined gas law?

For a fixed amount of gas, P₁V₁ ÷ T₁ = P₂V₂ ÷ T₂. It follows from PV = nRT with n constant.

Sources

  1. OpenStax, Chemistry 2e
  2. NIST CODATA, molar gas constant

Updated November 25, 2026. Formulas checked against published sources and worked examples.

Cite this page: CalcRoster. "Ideal gas law calculator (PV = nRT)." calcroster.com/ideal-gas-law-calculator/. Updated November 25, 2026.

Results are estimates for general information. They are not financial, medical or legal advice. Check important decisions with a qualified professional.