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
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.
- 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.
- 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.
- 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.
- 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.
- Enter temperature in kelvin: K = °C + 273.15, or K = (°F − 32) × 5/9 + 273.15. Every input must be greater than zero.
- 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.
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.
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.
Frequently asked questions.
Why does temperature have to be in kelvin?
My tyre gauge says 220 kPa. Is that the pressure to enter?
Why do some books give 22.4 L per mole and others 22.7 L?
Which value of the gas constant should I use?
When does the ideal gas law stop being accurate?
How do I find the moles or mass of gas from grams?
Can I work out the density of a gas from this?
How do Boyle's, Charles's and the combined gas law fit in?
Does it work for mixtures such as air?
How many molecules are in a sample of gas?
References& sources.
- [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]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]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]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]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]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]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
- Overseen by
- Daniel, Quanta Calculator Researcher
- 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