Ideal Gas Law Calculator (PV = nRT)
A free tool by DeepRit, a Google Ads agency that does PPC and nothing else. We build and run Google Ads accounts so every click is accounted for. Book a free audit call
Free ideal gas law calculator. Solve PV = nRT for pressure, volume, moles or temperature, with kPa, atm, bar, psi or mmHg and °C, °F or kelvin.
- Pressure (kPa)
- 0
- Volume (L)
- 0
- Temperature (K)
- 0
Free, no sign-up. Runs in your browser: nothing you type is uploaded or saved.
How to use the ideal gas law calculator
- Choose what to solve for: pressure (P), volume (V), amount of gas in moles (n) or temperature (T).
- Enter the other three values.
- Pick your units: pressure in kPa, atm, bar, psi or mmHg; volume in litres, millilitres or cubic metres; temperature in kelvin, degrees Celsius or degrees Fahrenheit.
The ideal gas law calculator shows the answer in the units you chose, and also gives the pressure in kPa, the volume in litres and the temperature in kelvin, so you can check your working against textbook values.
The ideal gas law
The ideal gas law connects the four properties of a gas in one equation:
PV = nRT
- P is the pressure.
- V is the volume.
- n is the amount of gas, in moles.
- R is the gas constant, 8.314462618 J/(mol·K).
- T is the absolute temperature, in kelvin.
It combines several older gas laws: Boyle's law (pressure and volume are inversely proportional at constant temperature), Charles's law (volume is proportional to temperature at constant pressure), Gay-Lussac's law (pressure is proportional to temperature at constant volume) and Avogadro's law (volume is proportional to the number of moles). The French engineer Émile Clapeyron first stated the combined law in 1834.
Units and the gas constant
The value of R depends on the units used. The ideal gas law calculator converts everything internally so you don't have to:
| Units | Value of R |
|---|---|
| J/(mol·K) or kPa·L/(mol·K) | 8.314462618 |
| L·atm/(mol·K) | 0.082057366 |
| L·bar/(mol·K) | 0.083144626 |
| L·mmHg/(mol·K) | 62.363598 |
Since the 2019 redefinition of the SI units, R is exact, because it's the product of two exact constants: the Boltzmann constant and the Avogadro constant.
Temperature must always be absolute. The calculator converts Celsius by adding 273.15, and Fahrenheit by first converting to Celsius. Using Celsius directly in PV = nRT is one of the most common mistakes: at 0 °C, the formula would give zero volume.
A worked example: molar volume at STP
How much space does one mole of an ideal gas take up at 0 °C (273.15 K) and 1 atmosphere (101.325 kPa)?
- Rearrange for volume: V = nRT ÷ P.
- Substitute: V = 1 × 8.314462618 × 273.15 ÷ 101.325.
- Result: about 22.414 litres.
This is the famous molar volume of an ideal gas at standard temperature and pressure. Choose "Volume", enter 101.325 kPa, 1 mole and 273.15 K in the ideal gas law calculator to see it. Note that IUPAC's current standard conditions use 100 kPa (1 bar) rather than 1 atm, which gives a molar volume of about 22.711 litres.
A worked example: gas in a cylinder
A 10-litre cylinder holds 2 moles of gas at 25 °C. What's the pressure?
- Temperature: 25 + 273.15 = 298.15 K.
- Pressure: P = nRT ÷ V = 2 × 8.314462618 × 298.15 ÷ 10 ≈ 495.8 kPa.
- In atmospheres: 495.8 ÷ 101.325 ≈ 4.89 atm.
Choose "Pressure", set the unit to atm, and enter 10 L, 2 mol and 25 °C to check.
When is a gas ideal?
An ideal gas is a model in which the molecules take up no space and don't attract or repel each other. Real gases behave almost ideally at low pressures and high temperatures, when molecules are far apart and moving fast. At room temperature and atmospheric pressure, gases like nitrogen, oxygen, helium and argon follow the ideal gas law to within a fraction of a percent.
Deviations grow at high pressures, where the volume of the molecules themselves becomes significant, and at low temperatures, near the point where the gas would condense, where attractions between molecules matter. For those conditions, chemists use more complex equations of state, such as the van der Waals equation, which adds correction terms for molecular size and attraction.
Finding the molar mass or density of a gas
The ideal gas law can also find a gas's molar mass or density. Because n = mass ÷ molar mass:
Molar mass = mass × R × T ÷ (P × V)
Density = P × molar mass ÷ (R × T)
For example, air has an average molar mass of about 28.96 g/mol. At 20 °C and 101.325 kPa, its density is 101.325 × 28.96 ÷ (8.314462618 × 293.15) ≈ 1.204 g/L, or 1.204 kg/m³. Use the molar mass calculator to find a gas's molar mass from its formula.
Who uses an ideal gas law calculator
Chemistry and physics students use it for homework, exams and lab reports. Engineers use it to size tanks, pipes and compressors and to estimate gas quantities. Divers and scuba instructors use the same principles to understand how air volume changes with depth. Meteorologists, HVAC technicians and brewers use gas laws to understand pressure and temperature changes, and teachers use the calculator to prepare worked examples.
Need more customers from Google?
This tool is free and runs in your browser. If your business also needs more leads or sales, Google Ads is where people search with their wallet out. That is the whole job of DeepRit: a PPC-only agency that sets up and runs Google Ads accounts so every click is accounted for. You keep full ownership of your account, get a written report every week, and can stop at any time. See our pricing or ask for a free audit.
The combined gas law
When the amount of gas stays the same but conditions change, the ideal gas law simplifies to the combined gas law:
P₁V₁ ÷ T₁ = P₂V₂ ÷ T₂
For example, a balloon holding 2 litres at 20 °C (293.15 K) and 101.3 kPa is taken somewhere with a pressure of 80 kPa and a temperature of 5 °C (278.15 K). Its new volume is 2 × (101.3 ÷ 80) × (278.15 ÷ 293.15) ≈ 2.40 litres. You can check problems like this in the ideal gas law calculator by first finding n at the starting conditions, then solving for the new volume with that n.
Gauge and absolute pressure
Tyre gauges and many industrial gauges show gauge pressure: the pressure above atmospheric. The ideal gas law needs absolute pressure, which is gauge pressure plus atmospheric pressure. A car tyre at 32 psi on the gauge is at about 32 + 14.7 = 46.7 psi absolute. Using gauge pressure in PV = nRT underestimates the amount of gas, sometimes badly. The pressure converter helps move between pressure units.
Partial pressures
In a mixture of gases, each gas behaves as if it were alone in the container, and the total pressure is the sum of the partial pressures of each gas. This is Dalton's law. Air at sea level is roughly 78% nitrogen and 21% oxygen by volume, so the partial pressure of oxygen is about 21% of 101.3 kPa, roughly 21.2 kPa. The ideal gas law applies to each gas separately, using its own number of moles.
Common mistakes
- Using degrees Celsius instead of kelvin.
- Using gauge pressure instead of absolute pressure.
- Mixing units, such as atm with a value of R meant for kPa.
- Applying the ideal gas law near condensation or at very high pressure, where real gases deviate.
Gas laws in everyday life
The ideal gas law explains many everyday effects. A sealed bag of crisps puffs up on a flight or a mountain road because the outside pressure drops while the amount of gas inside stays the same, so its volume grows. Car tyres lose pressure on a cold morning because the temperature in kelvin falls: a drop from 25 °C to 0 °C is a fall from 298.15 K to 273.15 K, about 8.4%, so the absolute pressure falls by roughly the same proportion. Aerosol cans carry warnings not to heat them, because pressure rises with temperature in a fixed volume. Each of these can be worked out with the ideal gas law calculator by holding one quantity fixed and changing another.
Scuba diving and pressure
Divers learn the gas laws early. For every 10 metres of seawater, pressure increases by about one atmosphere, so at 10 metres a diver is at about 2 atmospheres absolute, and the air in their lungs and equipment is compressed to about half its surface volume. This is why divers must never hold their breath while ascending: the air expands as pressure falls. It also explains why a tank of air lasts a shorter time at depth, because each breath takes more molecules of gas. The ideal gas law calculator can show how volume changes with pressure at constant temperature, a relationship known as Boyle's law.
Moles, molecules and mass
The ideal gas law calculator works in moles, but it's easy to move to molecules or grams. Multiply moles by the Avogadro constant, 6.02214076 × 10²³, to get the number of molecules, or by the molar mass to get the mass in grams. Two moles of oxygen gas, O₂, with a molar mass of about 31.998 g/mol, weigh about 64 grams and contain about 1.2 × 10²⁴ molecules.
Sources and further reading
- Ideal gas law on Wikipedia: history, derivation and forms of the equation.
- NIST: Molar gas constant, the official value of R.
- Standard temperature and pressure on Wikipedia: the different definitions in use.
Frequently asked questions
What is the ideal gas law?
PV = nRT, linking pressure, volume, moles and absolute temperature.
What is the value of R?
8.314462618 J/(mol·K), which is the same as kPa·L/(mol·K), or 0.082057 L·atm/(mol·K).
Why must temperature be in kelvin?
The law depends on absolute temperature. Celsius and Fahrenheit have arbitrary zero points.
What volume does one mole of gas occupy?
About 22.414 litres at 0 °C and 1 atm, or about 22.711 litres at 0 °C and 1 bar.
Does the ideal gas law work for real gases?
Closely at low pressure and high temperature; less well at high pressure or near condensation.
Is the ideal gas law calculator free?
Yes. It's free, needs no sign-up, and works in your browser.
Free PPC audit
See where your ad budget leaks.
We look at your Google Ads account before the call, then walk you through what we'd fix first, in dollars. No obligation, no hard sell.