Audited 27 Jul 2026·Last updated 28 Oct 2026·7 citations·Tier 1·0 uses

Ideal Gas Law Calculator

Solve PV = nRT for pressure, volume, moles or temperature from the other three, in kPa, litres, moles and kelvin, with R = 8.314462618 J/(mol·K).

Ideal Gas Law Calculator

Solve for
Absolute pressure in kilopascals. Standard atmospheric pressure is 101.325 kPa (= 1 atm = 760 mmHg = 760 Torr). Required unless solveFor = pressure.
kPa
Volume in litres. 1 L = 0.001 m³ = 1000 mL. The molar volume of an ideal gas at STP (273.15 K, 101.325 kPa) is 22.414 L/mol. Required unless solveFor = volume.
L
Amount of substance in moles. One mole contains exactly 6.02214076 × 10²³ particles (Avogadro's number, fixed by the 2019 SI redefinition). Required unless solveFor = moles.
mol
Absolute temperature in kelvin — never Celsius or Fahrenheit. Convert: K = °C + 273.15. STP temperature is 273.15 K (0 °C). Required unless solveFor = temperature.
K
Pressure
101.3249
Absolute pressure P in kilopascals (kPa), solved as nRT ÷ V or repeated from your entry; divide by 101.325 for atmospheres.
Volume
22.414 L
Moles
1 mol
Temperature
273.15 K

Background.

Fill one balloon with helium and an identical one with carbon dioxide, at the same temperature and pressure, and they hold the same number of molecules, even though each carbon dioxide molecule is about eleven times heavier. That fact, first proposed by Amedeo Avogadro in 1811, is at the heart of the ideal gas law, PV = nRT. For a gas at modest pressure, pressure times volume depends only on how many particles there are and how hot they are, not on what the particles are.

The law ties four quantities together: pressure P, volume V, amount of gas n in moles, and absolute temperature T. Give any three and the fourth follows. Here pressure is in kilopascals, volume in litres, amount in moles and temperature in kelvin, and the constant R is 8.314462618. That number is the same whether you write its unit as joules per mole per kelvin or kilopascal-litres per mole per kelvin, because one kilopascal acting on one litre is exactly one joule.

The equation grew out of separate observations. Robert Boyle showed in 1662 that halving the volume of a fixed amount of gas at constant temperature doubles its pressure. Jacques Charles and Joseph Louis Gay-Lussac found that volume at constant pressure, and pressure at constant volume, rise in a straight line with temperature, a line that points back to an absolute zero. Avogadro supplied the link to the number of particles, and Émile Clapeyron combined the pieces into one equation in 1834.

Most wrong answers come from two slips rather than the algebra. Temperature must be absolute, so add 273.15 to a Celsius reading. Pressure must be absolute too, so a tyre or cylinder gauge reading needs atmospheric pressure, about 101.325 kPa at sea level, added to it. The other limit is physical: real molecules take up space and attract one another, so the law drifts at high pressure and close to condensation. For air near room conditions it is accurate to well under a tenth of a percent.

What is ideal gas law calculator?

The ideal gas law, PV = nRT, is the equation of state of an ideal gas, which IUPAC defines as a hypothetical gas that obeys the law exactly: its particles are points with no volume of their own, and they interact only through perfectly elastic collisions. No real gas behaves that way, but every gas comes closer to it as its pressure falls and its molecules spend less time near one another.

Kinetic theory gives the equation a physical meaning. Written per molecule, it reads PV = N k_B T, where N is the number of molecules and k_B the Boltzmann constant; temperature measures the average translational kinetic energy of the molecules, 3/2 k_B T each, and pressure is the force of their collisions with the walls. Multiplying k_B by Avogadro's constant converts molecules to moles and gives R. Since 2019 both constants have fixed, exact values in the SI, so R is exact as well: 8.31446261815324 J/(mol·K), which is 8.314462618 to ten significant figures.

How to use this calculator.

  1. In Solve for, choose the quantity you do not know. Its own box is ignored, and the result appears alongside the three values you entered.
  2. Enter pressure as absolute pressure in kilopascals: 1 atm = 101.325 kPa, 1 bar = 100 kPa, 1 psi = 6.8948 kPa, 1 mmHg = 0.1333 kPa. For a gauge reading, add the local atmospheric pressure first; that is lower at altitude, about 84.6 kPa at 1,500 m in the standard atmosphere.
  3. Enter volume in litres, the inside volume of the container or the space the gas fills: 1 m³ = 1,000 L, 1 mL = 0.001 L, 1 ft³ = 28.3168 L.
  4. Enter the amount in moles. If you know the mass, divide by the molar mass: about 28.97 g/mol for dry air, 28.01 for nitrogen, 32.00 for oxygen, 44.01 for carbon dioxide, 4.003 for helium.
  5. Enter temperature in kelvin: K = °C + 273.15, or K = (°F − 32) × 5/9 + 273.15. Every input must be greater than zero.
  6. Read the solved value. Pressure comes out in kPa (divide by 101.325 for atmospheres), volume in litres, amount in moles and temperature in kelvin (subtract 273.15 for °C).

The formula.

PV = nRT

Rearranged for each unknown, PV = nRT gives P = nRT ÷ V, V = nRT ÷ P, n = PV ÷ (RT) and T = PV ÷ (nR). R is 8.314462618 kPa·L/(mol·K). The same constant takes other numbers in other unit systems: 0.082057 L·atm/(mol·K), 62.3636 L·Torr/(mol·K), 1.9872 cal/(mol·K) and 1,545.35 ft·lbf/(lbmol·°R). If you copy R from a textbook, its units have to match the units of P and V you use.

The equation bundles four proportionalities. At fixed n and T, P is inversely proportional to V (Boyle). At fixed n and P, V is proportional to T (Charles). At fixed n and V, P is proportional to T (Gay-Lussac). At fixed P and T, V is proportional to n (Avogadro). Any relationship that holds all four at once must have the form PV ∝ nT, and R is the constant of proportionality, the same for every gas.

The ideal model ignores two things real molecules do. They occupy space, so less of the container is free than V suggests, and they attract each other, so they strike the walls a little less hard than they otherwise would. The van der Waals equation adds one constant for each: (P + a n²/V²)(V − nb) = nRT. For carbon dioxide, a = 3.640 L²·bar/mol² and b = 0.04267 L/mol. With those values, one mole of carbon dioxide in one litre at 300 K exerts about 2,241.5 kPa, against 2,494.3 kPa from the ideal law, roughly 10% less.

A common way to measure the departure is the compressibility factor, Z = PV ÷ (nRT). It equals 1 for an ideal gas, falls below 1 when attractions dominate and rises above 1 at very high pressure when molecular size dominates. Values of Z close to 1, as for air, nitrogen, oxygen and the noble gases at everyday conditions, mean this calculator's answer can be used directly.

A worked example.

Example

How much space does one mole of gas take up at 0 °C and one standard atmosphere? Choose Solve for: Volume and enter 101.325 kPa, 1 mol and 273.15 K. The numerator is n × R × T = 1 × 8.314462618 × 273.15 = 2,271.0955 kPa·L. Dividing by the pressure, 2,271.0955 ÷ 101.325 = 22.414 L. This is the molar volume quoted in most chemistry textbooks, and the calculator returns it alongside the three inputs: pressure 101.325 kPa, amount 1 mol, temperature 273.15 K. Because R carries no reference to any particular gas, the same 22.414 L applies to hydrogen, nitrogen or argon, within the accuracy of the ideal model. IUPAC has defined standard pressure as 100 kPa since 1982. Entering 100 instead of 101.325 gives 2,271.0955 ÷ 100 = 22.711 L, about 1.3% more, which is why newer books quote 22.7 L per mole and older ones 22.4. Both are right for their own reference pressure. For carbon dioxide, the van der Waals equation puts the true volume at 0 °C and 1 atm at about 22.30 L, roughly half a percent under the ideal figure.

temperature273.15
pressure101.325
moles1
solve Forvolume

Frequently asked questions.

Why does temperature have to be in kelvin?
Because the law's proportions are measured from absolute zero, where an ideal gas would exert no pressure. Warming air from 10 °C to 20 °C does not double its pressure; in kelvin the change is from 283.15 K to 293.15 K, a rise of about 3.5%. Entering Celsius values would even make a gas at 0 °C exert zero pressure. Add 273.15 to every Celsius reading first.
My tyre gauge says 220 kPa. Is that the pressure to enter?
No. A gauge reads pressure above atmospheric, so add about 101.325 kPa: 321.325 kPa absolute. If the tyre warms at constant volume from 10 °C to 40 °C, the absolute pressure becomes 321.325 × 313.15 ÷ 283.15 = 355.37 kPa, or 254.04 kPa on the gauge. Scaling the gauge reading directly would wrongly predict 243.31 kPa.
Why do some books give 22.4 L per mole and others 22.7 L?
They use different standard conditions. The older STP of 0 °C and 101.325 kPa gives 22.414 L; IUPAC's STP since 1982, 0 °C and 100 kPa, gives 22.711 L. Engineers often use 20 °C and 1 atm, where a mole occupies 24.0551 L, and thermochemistry uses 25 °C and 100 kPa, giving 24.7896 L. Check which convention your problem or data sheet assumes.
Which value of the gas constant should I use?
The one whose units match your other quantities. With kPa and litres, use 8.314462618, as here; with pascals and cubic metres it is the same number in J/(mol·K). With atmospheres and litres use 0.082057, with torr and litres 62.3636, and in US engineering units 1,545.35 ft·lbf/(lbmol·°R). Since the 2019 SI revision R is exact, not a measured constant.
When does the ideal gas law stop being accurate?
When molecules are crowded or slow enough for their size and mutual attraction to matter: at high pressure, at temperatures near the point where the gas would condense, and for strongly attracting molecules. One mole of carbon dioxide in one litre at 300 K is predicted at 2,494.3 kPa by the ideal law but about 2,241.5 kPa by van der Waals. Engineers then use equations such as Peng–Robinson.
How do I find the moles or mass of gas from grams?
Divide mass by molar mass to get moles, or multiply moles by molar mass to get mass. Five grams of carbon dioxide is 5 ÷ 44.01 = 0.1136 mol, which at 25 °C and 100 kPa fills about 2.8164 L. To find how much gas a container holds, solve for moles from its pressure, volume and temperature, then multiply by the molar mass.
Can I work out the density of a gas from this?
Yes. Substituting n = mass ÷ M into the law gives density ρ = P × M ÷ (R × T). For dry air, M = 0.0289647 kg/mol, so at 101,325 Pa and 273.15 K the density is 1.2923 kg/m³, and at 288.15 K (15 °C) it is 1.225 kg/m³, the sea-level value of the International Standard Atmosphere. Heavier gases and colder, higher-pressure gases are denser.
How do Boyle's, Charles's and the combined gas law fit in?
Each is the ideal gas law with some quantities held fixed. Boyle's law keeps n and T constant, Charles's law n and P, Gay-Lussac's law n and V. The combined gas law, P₁V₁ ÷ T₁ = P₂V₂ ÷ T₂, keeps only n fixed. To solve a before-and-after problem, find n from the first state, then solve for the unknown in the second.
Does it work for mixtures such as air?
Yes. An ideal mixture obeys PV = nRT with n as the total moles of all components. Each gas also contributes a partial pressure equal to its mole fraction times the total, which is Dalton's law. Oxygen makes up about 20.95% of dry air by moles, so at 101.325 kPa its partial pressure is about 21.23 kPa, the figure that matters for breathing and combustion.
How many molecules are in a sample of gas?
Multiply the moles by Avogadro's constant, exactly 6.02214076 × 10²³ per mole. One litre of air at 25 °C and 101.325 kPa contains 0.040874 mol, which is about 2.4615 × 10²² molecules. Because the count depends only on P, V and T, a litre of helium under the same conditions holds the same number.

References& sources.

  1. [1]Tiesinga, E., Mohr, P. J., Newell, D. B. & Taylor, B. N. (2021). CODATA recommended values of the fundamental physical constants: 2018. Reviews of Modern Physics, 93, 025010. The CODATA 2018 evaluation of R = 8.314462618 J/(mol·K), now an exact value following the 2019 SI redefinition that fixed the Boltzmann constant and Avogadro's number as exact integers.
  2. [2]Atkins, P. W. & de Paula, J. (2014). Atkins' Physical Chemistry, 10th ed. Oxford University Press. Chapter 1 'The properties of gases', §1A.1 'The states of gases', §1A.2 'The gas laws', and §1B 'The kinetic model' — the standard university-level derivation of PV = nRT from Boyle, Charles, Gay-Lussac, and Avogadro, plus the kinetic theory underpinning.
  3. [3]International Union of Pure and Applied Chemistry (IUPAC). Compendium of Chemical Terminology (the 'Gold Book'), entry 'ideal gas' — the formal IUPAC definition of an ideal gas as a hypothetical gas obeying PV = nRT exactly, with point particles and no inter-particle interactions other than perfectly elastic collisions.
  4. [4]Bureau International des Poids et Mesures (BIPM) (2019). The International System of Units (SI), 9th edition. The official SI brochure following the 2019 redefinition, including the fixed exact values of the Boltzmann constant k_B = 1.380649 × 10⁻²³ J/K and Avogadro's constant N_A = 6.02214076 × 10²³ mol⁻¹, which together fix R = N_A × k_B exactly.
  5. [5]International Union of Pure and Applied Chemistry (IUPAC). Compendium of Chemical Terminology (the 'Gold Book'), entry 'standard pressure' — the post-1982 IUPAC recommendation that 'standard pressure' for thermochemical data be 100 kPa (1 bar) rather than the older 101.325 kPa (1 atm), with the consequent shift of the molar volume of an ideal gas at STP from 22.414 L to 22.711 L.
  6. [6]Clapeyron, B. P. É. (1834). Mémoire sur la puissance motrice de la chaleur. Journal de l'École Polytechnique, 14, 153–190. The original publication in which Clapeyron combined Boyle's, Charles's, Gay-Lussac's, and Avogadro's laws into the single combined gas law PV = nRT — the first appearance in print of the equation in its modern form.
  7. [7]Laidler, K. J. (1993). The World of Physical Chemistry. Oxford University Press. Chapter 4 'The Behaviour of Gases' — a careful history of how Boyle (1662), Charles (1787), Gay-Lussac (1802, 1809), Avogadro (1811), and Clapeyron (1834) each contributed to the combined gas law, with attention to the experimental conditions under which each component law was first measured.

How this page was produced

Published by
Quanta Calculator
Primary sources
7 cited below
Method
PV = nRT
Published
Last verified

Built with AI assistance and verified by automated tests against the cited sources — every worked example on this page is computed by the same code that runs the calculator. How we build and check calculators.

In this category

Embed

Quanta Pro

Paid features are coming later.

  • All 1560 calculators remain free
  • No billing is enabled
Coming soon