How to use the ideal gas law (PV = nRT)
The ideal gas law, PV = nRT, links a gas's pressure, volume, amount and temperature in one equation. Here is what each symbol means, which value of R to use with which units, how to solve for any variable, and the mistakes that trip people up, starting with Kelvin.
Find the moles of a gas from its pressure, volume and temperature using PV = nRT.
The ideal gas law is one equation that ties together the four things that describe a gas: its pressure, its volume, how much of it there is, and its temperature. It is written PV = nRT, and it says that for a fixed amount of gas these quantities move together in a predictable way, so if you know any three you can find the fourth. It is called "ideal" because it assumes the gas molecules take up no space and do not attract each other, which is close enough to true for most everyday conditions. This guide explains each symbol, the one thing that causes most wrong answers (the value of R), how to rearrange the equation, and worked examples.
What the ideal gas law says
In PV = nRT, the left side is pressure times volume, and the right side is the amount of gas times a constant times the temperature. The five symbols are: P pressure, V volume, n the amount in moles, R the gas constant (a fixed number), and T the temperature. Change one of P, V, n or T and the equation tells you how the others must respond to keep both sides equal. Heat a sealed rigid container (T up, V fixed) and the pressure rises; that is PV = nRT at work.
What each variable is, and its units
Getting the units right is most of the battle. The standard choices are: P in pascals (Pa) or atmospheres (atm); V in cubic metres (m³) or litres (L); n in moles (mol); T in kelvin (K), always; and R, the gas constant, whose value depends on the units you picked for the others. Note that n is an amount in moles, not a mass in grams: if you are given grams, convert to moles first by dividing by the molar mass.
Which value of R to use
This is the single biggest source of wrong answers, because R comes in different values for different units, and they are not interchangeable. The two you will meet most are:
- R = 8.314 J/(mol·K), used with SI units: pressure in pascals and volume in cubic metres.
- R = 0.0821 L·atm/(mol·K), used with pressure in atmospheres and volume in litres.
Pick the R that matches your units and the numbers come out right; mix them up (say, atm with the 8.314 value) and the answer is off by a factor of about 100. A good habit is to decide your units first, then choose R to match, rather than the other way round.
Temperature must be in kelvin
Temperature in the ideal gas law is always absolute temperature, in kelvin, never Celsius or Fahrenheit. Convert from Celsius by adding 273.15: so 25°C is 25 + 273.15 = 298.15 K. This matters because pressure and volume are proportional to absolute temperature, and 0°C is not zero temperature, it is 273.15 K. Plug in a Celsius value and the answer is wrong, and putting in 0°C as "0" would make PV equal zero. Converting to kelvin first is the habit that prevents the most common ideal-gas mistake.
How to rearrange for each variable
Because it is one equation, a little algebra solves it for whichever quantity you need:
- Pressure: P = nRT ÷ V
- Volume: V = nRT ÷ P
- Amount: n = PV ÷ RT
- Temperature: T = PV ÷ nR
Each is just PV = nRT with one symbol moved across. Decide what you are solving for, use the matching form, and keep your units consistent with your chosen R.
Worked examples
Finding volume. What volume does 2 moles of an ideal gas occupy at 1 atm and 300 K? Using atm and litres, R = 0.0821, so V = nRT ÷ P = (2 × 0.0821 × 300) ÷ 1 = 49.26, about 49.3 litres.
Finding pressure. What pressure does 0.5 mol of gas exert in a 10-litre container at 298 K? P = nRT ÷ V = (0.5 × 0.0821 × 298) ÷ 10 = 12.23 ÷ 10 = about 1.22 atm. Notice both examples use the litre-atmosphere R because the units are litres and atmospheres; switch to pascals and cubic metres and you would use 8.314 instead.
In SI units. The same 1 mole at 300 K in 0.0249 m³ gives P = nRT ÷ V = (1 × 8.314 × 300) ÷ 0.0249 = 2494.2 ÷ 0.0249 ≈ 100,200 Pa, about 100 kPa, this time using the SI value 8.314 because the units are pascals and cubic metres. Starting from a mass. For 10 g of carbon dioxide (molar mass about 44 g/mol) at 1 atm and 300 K, first turn the mass into moles: 10 ÷ 44 = 0.227 mol. Then V = nRT ÷ P = (0.227 × 0.0821 × 300) ÷ 1 ≈ 5.6 litres. Forgetting that first step, and using 10 as if it were moles, is a classic way to get an answer about 44 times too big.
STP and molar volume
A useful shortcut comes from standard conditions. At the classic STP (standard temperature and pressure) of 0°C (273.15 K) and 1 atm, one mole of an ideal gas occupies about 22.4 litres. You can check it: V = nRT ÷ P = (1 × 0.0821 × 273.15) ÷ 1 = about 22.4 L. This "molar volume" is handy for quick estimates. One caveat: the current IUPAC definition of STP (since 1982) uses 100 kPa (1 bar) instead of 1 atm, which gives a molar volume of about 22.7 L. And at the common lab conditions of 25°C and 1 atm, sometimes called SATP, the molar volume is about 24.5 L. So note which standard a question intends before reaching for 22.4.
The combined gas law
When the amount of gas stays fixed and you are comparing the same gas in two different states, you do not even need n or R. Because nR is constant, PV ÷ T is the same before and after, giving the combined gas law: P₁V₁ ÷ T₁ = P₂V₂ ÷ T₂. This is the quick way to answer "a balloon at these conditions is moved to those conditions, what is its new volume?" without knowing how many moles it holds. Temperatures still must be in kelvin.
When the ideal gas law breaks down
Real gases are not quite ideal, and the equation drifts from reality at high pressure and low temperature. In those conditions the molecules are squeezed close enough that their own volume and the attractions between them stop being negligible, the two things the ideal model ignores. For everyday pressures and temperatures the ideal gas law is a good approximation; near condensation or in a highly compressed cylinder, more detailed models (like the van der Waals equation) do better.
Common mistakes
- Using Celsius instead of kelvin. Always add 273.15 to a Celsius temperature first. This is a very common error.
- Using the wrong R for your units. Match R to your units: 0.0821 for litres and atmospheres, 8.314 for cubic metres and pascals.
- Mixing unit systems. Do not pair litres with pascals or cubic metres with atmospheres; convert so everything matches one R.
- Treating n as grams. n is moles. Convert a mass to moles by dividing by the molar mass before using the equation.
Write down PV = nRT, convert temperature to kelvin, choose the R that matches your units, and rearrange for the unknown. When you want it solved instantly in any units, the free ideal gas law calculator does the arithmetic and the rearranging, the scientific notation calculator helps with the powers of ten that pressures in pascals often need, and our explainer on how to calculate density connects to working out the density of a gas.
Frequently asked questions
What is the ideal gas law?
The ideal gas law is PV = nRT, an equation linking a gas's pressure (P), volume (V), amount in moles (n) and temperature (T), with R the gas constant. For a fixed amount of gas, if you know any three of these you can find the fourth. It assumes the gas is ideal, meaning its molecules take up no space and do not attract each other, which is accurate enough for most everyday conditions.
What value of R should I use?
It depends on your units. Use R = 8.314 J/(mol·K) with SI units, meaning pressure in pascals and volume in cubic metres. Use R = 0.0821 L·atm/(mol·K) with pressure in atmospheres and volume in litres. Choose the R that matches your units; mixing them, like using atmospheres with the 8.314 value, gives an answer off by a factor of about 100.
Why does temperature have to be in kelvin?
Because the ideal gas law treats temperature as an absolute, proportional quantity, and only the kelvin scale starts at absolute zero. Convert Celsius to kelvin by adding 273.15, so 25°C becomes 298.15 K. Using Celsius gives wrong answers, and using 0°C as zero would make PV equal zero, since 0°C is really 273.15 K.
How do I rearrange PV = nRT?
Move one symbol across each time: P = nRT ÷ V for pressure, V = nRT ÷ P for volume, n = PV ÷ RT for amount, and T = PV ÷ nR for temperature. Decide what you are solving for, use the matching form, keep units consistent with your chosen R, and make sure temperature is in kelvin.
What is the molar volume of a gas at STP?
At the classic STP of 0°C (273.15 K) and 1 atm, one mole of an ideal gas occupies about 22.4 litres. You can verify it with V = nRT ÷ P = (1 × 0.0821 × 273.15) ÷ 1, which is about 22.4 L. The current IUPAC definition of STP (since 1982) uses 100 kPa, giving about 22.7 litres, and at 25°C and 1 atm (SATP) it is about 24.5 litres, so check which standard a question means.
When does the ideal gas law not work?
It drifts from reality at high pressure and low temperature, where gas molecules are close enough that their own volume and the attractions between them matter, the two things the ideal model ignores. For everyday pressures and temperatures it is a good approximation; near condensation or under heavy compression, models like the van der Waals equation are more accurate.
Is n in grams or moles?
n is the amount of gas in moles, not grams. If a problem gives you a mass in grams, convert it to moles first by dividing by the molar mass of the gas. For example, 32 g of oxygen (molar mass about 32 g/mol) is 1 mole, which is the n you put into PV = nRT.