🔬
🔬 Science & engineering

Ideal Gas Law Calculator (PV = nRT)

Results update as you type.

Your numbers

Understanding the ideal gas law calculator — concept and principle

The ideal gas law links the pressure, volume, temperature and amount of a gas in one equation. Enter pressure, volume and temperature, and the calculator returns the moles, the number of molecules and the mass the gas would have if it were dry air. It is used in chemistry labs and for quick engineering checks.

Ideal gas law: one mole of gas at standard conditions101.325 kPa × 22.414 L = 2271.10 J equals R × 273.15 K = 2271.10 J, so n = 1.000 mol, 6.022 × 10²³ molecules or 28.97 g of air.One mole of gas at 0 °C and 1 atmV = 22.414 La 28.2 cm cubepressure101.325 kPatemperature0 °C = 273.15 KPV = 2271.10 J÷RT = 2271.10 Jn = 1.000 mol6.022 × 10²³ molecules · 28.97 g of air
PV and RT both come to 2271.10 J, so the 22.414 L box holds one mole — 28.97 g of air.

How it is calculated

Pressure is in kPa and volume in litres. Because 1 kPa × 1 L = 1 Pa·m³ = 1 J, the product PV comes out directly in joules and matches the units of R. Temperature is entered in °C and converted to kelvin by adding 273.15.

The principle

In an ideal gas the molecules are treated as points that do not attract each other and only collide elastically. Kinetic theory then shows that the pressure on a wall is proportional to the number of molecules per unit volume and to their average kinetic energy, which is itself proportional to the absolute temperature. Combining Boyle's law (PV constant at fixed T), Charles's law (V proportional to T at fixed P) and Avogadro's law (V proportional to n) gives PV = nRT. Since 2019 R is an exact constant, the product of the Boltzmann and Avogadro constants.

Worked example

  1. Inputs: P = 101.325 kPa, V = 22.414 L, T = 0 °C.
  2. Absolute temperature: T = 0 + 273.15 = 273.15 K.
  3. PV = 101.325 × 22.414 = 2271.10 J; RT = 8.314462618 × 273.15 = 2271.10 J.
  4. n = 2271.10 / 2271.10 = 1.000001359 mol.
  5. Molecules: 1.000001359 × 6.02214076 × 10²³ = 6.022149 × 10²³.
  6. Mass of air: 1.000001359 × 28.97 = 28.97003936 g.
How Moles n changes with Volume (L)How Moles n changes with Volume00.511.522.55.611.216.822.42833.644.8Example: 1.000001359Volume (L)
Each point is the calculator re-run with only “Volume (L)” changed; the gold point is the default example. Change the inputs above and this chart follows your numbers.
Volume (L)Moles n
5.60.2500003397
11.20.5000006794
16.80.7500010191
22.41.000001359
281.250001698
33.61.500002038
44.82.000002718

How to read the result

The default inputs reproduce the classic molar volume: one mole of an ideal gas at 0 °C and 101.325 kPa fills about 22.414 L. Note that IUPAC's current standard pressure is 100 kPa, at which the molar volume at 0 °C is about 22.711 L, so always check which "standard conditions" a textbook uses. For gases other than air, multiply n by their own molar mass.

Common mistakes

Keep in mind: The ideal gas law is an approximation. It works well for most gases near room temperature and atmospheric pressure, but errors grow at high pressure, low temperature or near condensation. Use a real-gas model such as van der Waals for those cases.

Frequently asked questions

What value of R should I use with atm and litres?

R = 0.082057 L·atm/(mol·K). With kPa and litres use 8.314 L·kPa/(mol·K), which is the same number as J/(mol·K).

Does the ideal gas law depend on which gas it is?

No. For an ideal gas only the number of moles matters, not the type of molecule. The identity of the gas enters only when you convert moles to mass.

Sources: BIPM, The International System of Units (SI Brochure), 9th edition, 2019 · P. Atkins and J. de Paula, Atkins' Physical Chemistry, Oxford University Press · IUPAC, Compendium of Chemical Terminology (Gold Book), entry "standard conditions for gases"

Checked 8 Nov 2026. Standard textbook formulas in SI units, computed in your browser. For learning and estimates — real designs must follow your local codes and be checked by a qualified engineer.

</> Add this calculator to your website (free)

Copy this code into your blog or site. It is free to use; please keep the credit link.

Preview
🔬 All science & engineering tools →🌍 Calculators by country →