Ideal Gas Law Calculator
Solve PV = nRT for pressure, volume, moles or temperature, in any units. Give the amount as a mass with the gas formula, find the density of a gas, or use the combined gas law.
How to Use
- Choose what to solve for: pressure, volume, amount (moles), temperature, the density of a gas, or the combined gas law.
- Enter the other values, each with its own unit: atm, kPa, bar, psi or mmHg; L, mL or m³; °C, K or °F.
- Give the amount in moles, or switch to mass and type the gas as a formula (CO2, He, N2), as
air, or as a molar mass such as 44.01. - For the combined gas law, fill in five of P₁, V₁, T₁, P₂, V₂, T₂ and leave the one you want blank.
- Read the answer and the volume at STP; the table converts the result to every unit, and Show Work has each step in SI units.
Worked Example
One mole at STP. V = nRT ÷ P = 1 × 8.314462618 × 273.15 ÷ 101,325 = 0.022414 m³ = 22.414 L at 0 °C and 1 atm. At the current IUPAC standard pressure of 1 bar (100,000 Pa) the same mole fills 1 × 8.314462618 × 273.15 ÷ 100,000 = 22.711 L.
A helium balloon. 2.00 g of helium is 2.00 ÷ 4.0026 = 0.49968 mol. At 25 °C (298.15 K) and 1 atm, V = 0.49968 × 8.314462618 × 298.15 ÷ 101,325 = 0.012225 m³ = 12.22 L.
The common mistake: leaving the temperature in Celsius. 2.00 L of gas is warmed from 25 °C to 50 °C at constant pressure. Doubling the Celsius number suggests 2.00 × 50 ÷ 25 = 4.00 L. In kelvin the temperature only rises from 298.15 K to 323.15 K, so V₂ = 2.00 × 323.15 ÷ 298.15 = 2.17 L, an increase of 8.4%.
Show Work
Formulas
From Boyle to Clapeyron
The ideal gas law joins several older laws. Robert Boyle published in 1662 that, at a fixed temperature, the pressure of trapped air is inversely proportional to its volume. Jacques Charles found around 1787 that gases expand in proportion to temperature, and Joseph Louis Gay-Lussac published the result in 1802. Amedeo Avogadro proposed in 1811 that equal volumes of gases at the same temperature and pressure contain the same number of molecules. Émile Clapeyron combined these into one equation in 1834.
The law treats molecules as points that never attract each other. That is a very good model for air and most gases near room conditions, but it overestimates the volume of gases at high pressure or close to the temperature at which they condense, where equations such as van der Waals’ (1873) do better.
About This Calculator
This calculator solves the ideal gas law for any one of pressure, volume, amount and temperature, finds the density of a gas from its formula, and solves the combined gas law for whichever of the six values you leave blank. Every value has its own unit; the working converts each one to SI (pascals, cubic metres, moles, kelvin) first, and temperatures at or below absolute zero are rejected.
It also gives the volume your gas would have at IUPAC STP (0 °C, 1 bar), at the older 0 °C and 1 atm, and at 25 °C and 1 bar. Molar masses come from IUPAC standard atomic weights. Everything runs in your browser; nothing is sent anywhere.
Related tools: Stoichiometry & Limiting Reagent Calculator, Molar Mass Calculator, and Density Calculator.
Frequently Asked Questions
What value of R should I use?
R = 8.314462618 J/(mol·K), which needs pressure in pascals and volume in cubic metres. With litres it is 0.082057 L·atm/(mol·K) or 0.083145 L·bar/(mol·K). This calculator converts every unit to SI first, so you never have to choose.
What is the molar volume of a gas at STP?
At IUPAC standard temperature and pressure, 0 °C and 1 bar, one mole of an ideal gas fills 22.711 L. The older definition, 0 °C and 1 atm, gives the familiar 22.414 L. At 25 °C and 1 bar (SATP) it is 24.790 L. The calculator shows all three for your amount of gas.
Why must the temperature be in kelvin?
Because volume and pressure are proportional to absolute temperature, which starts at 0 K (−273.15 °C). Heating 2.00 L of gas from 25 °C to 50 °C does not double it to 4.00 L; in kelvin it goes from 298.15 K to 323.15 K, so V = 2.00 × 323.15 ÷ 298.15 = 2.17 L.
Should I use gauge pressure or absolute pressure?
Always absolute. A tyre gauge reading of 32 psi is 32 + 14.696 = 46.70 psi absolute. Warming the tyre from 20 °C to 50 °C takes it to 51.47 psi absolute, which the gauge shows as 36.78 psi. Using the gauge figure directly gives 35.27 psi, about 1.5 psi too low.
How do I find the density of a gas?
Use ρ = PM ÷ RT with M in kg/mol. Carbon dioxide (44.009 g/mol) at 25 °C and 1 atm has a density of 101,325 × 0.044009 ÷ (8.314462618 × 298.15) = 1.799 kg/m³, against 1.184 kg/m³ for dry air, which is why CO2 collects in low places.
How do I use the Ideal Gas Law Calculator?
Simply type your numbers and read the result, which refreshes the instant you change something. There is nothing to submit and nothing to wait for.
Is it free? Does it work without internet?
Yes to both. It is free with no sign-up, and once the page has loaded it keeps working even with no internet.
Where does my data go?
Nowhere — every calculation runs on your own device. Nothing you enter is uploaded, logged, or stored.
Common Use Cases
Party balloons
2.00 g of helium (0.49968 mol) at 25 °C and 1 atm fills 12.22 L.
Air in a room
A 50 m³ room at 20 °C and 1 atm holds 2,078.6 mol of air, about 60.2 kg (dry air, 28.96 g/mol).
Heavier-than-air gases
CO2 at 25 °C is 1.799 kg/m³ against 1.184 kg/m³ for air, so it pools in cellars and pits.
Tyre pressure
A tyre at 32 psi gauge and 20 °C reads 36.78 psi at 50 °C, worked in absolute pressure.
Lab gas volumes
0.500 mol of gas in a 10.0 L vessel at 150 kPa is at 360.82 K (87.67 °C).
Last updated: