Gases

How to Use the Ideal Gas Law (pV = nRT): Units, Gas Laws and Worked Examples

pV = nRT links the pressure, volume, temperature and amount of a gas. Learn the SI unit conversions, Boyle's, Charles's, Gay-Lussac's and Avogadro's laws, worked AQA and AP calculations, and when real gases deviate.

V
Vectora Team
STEM Education
9 min read
2026-10-02

Try the interactive simulation for this topic

Explore this concept with our interactive 3D simulation.
Launch Simulator

The Ideal Gas Law in One Line

The ideal gas law states that for any gas behaving ideally:

pV=nRTpV = nRT

where pp is pressure, VV is volume, nn is the amount in moles, TT is the temperature in kelvin and R=8.314 J mol−1 K−1R = 8.314\ \text{J mol}^{-1}\,\text{K}^{-1} is the molar gas constant.

To use it: convert every quantity to SI units (Pa, m³, K, mol), rearrange for the unknown, substitute, and give the answer to a sensible number of significant figures. Almost every lost mark in gas calculations comes from the first step.

Learning Goals: By the end of this guide, you should be able to:

  1. Convert pressure, volume and temperature to the SI units required by R=8.314R = 8.314.
  2. Rearrange pV=nRTpV = nRT to find any one of pp, VV, nn or TT, and use it to find a molar mass.
  3. State Boyle's, Charles's, Gay-Lussac's and Avogadro's laws and explain each one with molecular collisions.
  4. Explain why real gases deviate from ideal behaviour at high pressure and low temperature.

What Each Symbol Means (and Its SI Unit)

SymbolQuantitySI unitCommon conversions
ppPressurePa (N m⁻²)1 kPa=103 Pa1\ \text{kPa} = 10^3\ \text{Pa}; 1 atm=101 325 Pa1\ \text{atm} = 101\,325\ \text{Pa}
VVVolumem³1 dm3=10−3 m31\ \text{dm}^3 = 10^{-3}\ \text{m}^3; 1 cm3=10−6 m31\ \text{cm}^3 = 10^{-6}\ \text{m}^3
nnAmount of gasmoln=mMn = \dfrac{m}{M}
TTTemperatureKT(K)=t(∘C)+273T(\text{K}) = t(^\circ\text{C}) + 273
RRMolar gas constantJ mol⁻¹ K⁻¹8.3148.314

Why these units? A joule is a pascal multiplied by a cubic metre (1 J=1 Pa m31\ \text{J} = 1\ \text{Pa m}^3), so pVpV in Pa m³ is an energy in joules, matching the joules in RR. Notice also that 1 kPa×1 dm3=103×10−3=1 J1\ \text{kPa} \times 1\ \text{dm}^3 = 10^3 \times 10^{-3} = 1\ \text{J}, so kPa and dm³ used together also work with R=8.314R = 8.314. Mixing kPa with m³, or Pa with dm³, is wrong by a factor of 1000.


How to Use pV = nRT: Four Steps

  1. List the data and identify the unknown.
  2. Convert to SI units: Pa, m³, K. Write each conversion down; examiners award marks for it.
  3. Rearrange before substituting: p=nRTVV=nRTpn=pVRTT=pVnRp = \frac{nRT}{V} \qquad V = \frac{nRT}{p} \qquad n = \frac{pV}{RT} \qquad T = \frac{pV}{nR}
  4. Substitute and calculate, then convert the answer back into the unit the question asks for (for example m³ to dm³).

Ideal Gas Law Simulator

Choose the unknown, type the other three values in any units, and watch every conversion and substitution laid out step by step. Then explore Boyle's, Charles's, Gay-Lussac's and Avogadro's laws with a particle model.
Launch the Simulator

The Four Gas Laws Hidden in pV = nRT

Hold two of the four variables constant and the ideal gas equation reduces to one of the classic gas laws.

LawHeld constantRelationshipGraph
Boyle's lawnn, TTp∝1Vp \propto \dfrac{1}{V}, so pV=constantpV = \text{constant}pp against VV is a curve (hyperbola)
Charles's lawnn, ppV∝TV \propto T, so VT=constant\dfrac{V}{T} = \text{constant}straight line through 0 K
Gay-Lussac's lawnn, VVp∝Tp \propto T, so pT=constant\dfrac{p}{T} = \text{constant}straight line through 0 K
Avogadro's lawpp, TTV∝nV \propto n, so Vn=constant\dfrac{V}{n} = \text{constant}straight line through the origin

For a fixed amount of gas whose conditions change, the laws combine into one equation:

p1V1T1=p2V2T2\frac{p_1 V_1}{T_1} = \frac{p_2 V_2}{T_2}

Here the units of pp and VV only need to be the same on both sides, but TT must still be in kelvin.

Why each law works: pressure comes from collisions

Pressure is the force per unit area exerted by molecules colliding with the walls of the container.

  • Boyle: halve the volume and each molecule reaches a wall twice as often. Twice as many collisions per second on each unit of area means twice the pressure.
  • Gay-Lussac: heating a gas in a rigid container makes the molecules move faster, so they hit the walls more often and harder (with more momentum). Pressure rises in proportion to the kelvin temperature.
  • Charles: if the gas can expand at constant pressure, the faster molecules push the piston out until the force per unit area falls back to its original value.
  • Avogadro: more molecules means more collisions, so at constant pp and TT the volume grows until the number of molecules per unit volume is back where it started. A consequence is that equal volumes of different gases at the same temperature and pressure contain equal numbers of molecules: one mole of any ideal gas occupies about 24.5 dm³ at 298 K and 101 kPa.

Why temperature must be in kelvin

The mean kinetic energy of gas molecules is proportional to the absolute temperature:

Ek‾=32kT\overline{E_k} = \tfrac{3}{2}kT

So doubling the kelvin temperature doubles the mean kinetic energy, and (at constant volume) doubles the pressure. Doubling a Celsius temperature from 20 °C to 40 °C only raises TT from 293 K to 313 K, an increase of about 7%. On a VV–TT or pp–TT graph, extrapolating the straight line back to V=0V = 0 or p=0p = 0 gives −273 ∘C-273\ ^\circ\text{C}, which is why that point is defined as 0 K.

The same equation explains a subtle result: at the same temperature, every gas has the same mean kinetic energy. Since Ek=12mv2E_k = \frac{1}{2}mv^2, lighter molecules must move faster. Helium atoms at 298 K move at about 1260 m s⁻¹ on average, while xenon atoms move at only about 220 m s⁻¹.


Worked Examples

Example 1 (AQA style): finding a pressure

Question: Calculate the pressure, in kPa, of 0.0500 mol of gas at 25 °C in a container of volume 1.20 dm³.

Step 1, convert to SI units:

T=25+273=298 KV=1.20 dm3=1.20×10−3 m3T = 25 + 273 = 298\ \text{K} \qquad V = 1.20\ \text{dm}^3 = 1.20 \times 10^{-3}\ \text{m}^3

Step 2, rearrange: p=nRTVp = \dfrac{nRT}{V}

Step 3, substitute:

p=0.0500×8.314×2981.20×10−3=1.03×105 Pap = \frac{0.0500 \times 8.314 \times 298}{1.20 \times 10^{-3}} = 1.03 \times 10^{5}\ \text{Pa}

Step 4, convert to the unit asked for: p=103 kPap = 103\ \text{kPa}.

Example 2 (AQA style): finding a relative molecular mass

Question: A 0.120 g sample of a gas occupies 75.0 cm³ at 100 kPa and 27 °C. Calculate the relative molecular mass of the gas and suggest its identity.

Convert: p=100×103=1.00×105 Pap = 100 \times 10^3 = 1.00 \times 10^5\ \text{Pa}; V=75.0×10−6=7.50×10−5 m3V = 75.0 \times 10^{-6} = 7.50 \times 10^{-5}\ \text{m}^3; T=27+273=300 KT = 27 + 273 = 300\ \text{K}.

Find the amount:

n=pVRT=(1.00×105)(7.50×10−5)8.314×300=3.01×10−3 moln = \frac{pV}{RT} = \frac{(1.00 \times 10^5)(7.50 \times 10^{-5})}{8.314 \times 300} = 3.01 \times 10^{-3}\ \text{mol}

Find MrM_r:

M=mn=0.1203.01×10−3=39.9 g mol−1M = \frac{m}{n} = \frac{0.120}{3.01 \times 10^{-3}} = 39.9\ \text{g mol}^{-1}

Mr=39.9M_r = 39.9, so the gas is likely to be argon.

Example 3 (AP style): using R in L atm

In AP Chemistry you can also use R=0.08206 L atm mol−1 K−1R = 0.08206\ \text{L atm mol}^{-1}\,\text{K}^{-1}, with pressure in atm and volume in litres.

Question: A 2.50 L flask contains nitrogen gas at 1.20 atm and 35 °C. What mass of N₂ is in the flask?

T=35+273.15=308.15 KT = 35 + 273.15 = 308.15\ \text{K} n=pVRT=1.20×2.500.08206×308.15=0.119 moln = \frac{pV}{RT} = \frac{1.20 \times 2.50}{0.08206 \times 308.15} = 0.119\ \text{mol} m=nM=0.119×28.02=3.32 gm = nM = 0.119 \times 28.02 = 3.32\ \text{g}

Rearranging the same equation with n=m/Mn = m/M gives a useful shortcut for gas density dd: M=dRTpM = \dfrac{dRT}{p}.


Real Gases: When pV = nRT Breaks Down

The ideal gas model assumes that:

  • gas molecules have negligible volume compared with the container;
  • there are no intermolecular forces except during collisions;
  • collisions are perfectly elastic, and molecules move randomly.

Real gases come close to this at low pressure and high temperature. They deviate at:

  • High pressure: the molecules are pushed so close together that their own volume is a significant fraction of the container. The space they can move in is less than VV, so the measured volume is larger than the ideal prediction.
  • Low temperature: the molecules move slowly enough for intermolecular attractions to matter. Attraction pulls them together and softens their collisions with the walls, so the volume (or pressure) is smaller than predicted. Close to the boiling point, the gas condenses into a liquid.

Chemists measure the deviation with the compressibility factor:

Z=pVnRTZ = \frac{pV}{nRT}

For an ideal gas Z=1Z = 1. Using the van der Waals model at 300 K and 5000 kPa: helium has Z≈1.05Z \approx 1.05 (molecular volume dominates), nitrogen Z≈0.97Z \approx 0.97, and carbon dioxide Z≈0.73Z \approx 0.73. CO₂ deviates most because its larger, more polarisable molecules have the strongest intermolecular forces of the three.


Common Mistakes

  1. Using °C instead of K. Always add 273 first. Using °C can even give a negative or zero volume.
  2. Leaving volume in dm³ or cm³ while using pressure in Pa. Divide dm³ by 1000 and cm³ by 1 000 000 to get m³.
  3. Leaving pressure in kPa while using volume in m³. Multiply kPa by 1000 to get Pa.
  4. Forgetting to convert the answer back. A volume calculated in m³ often needs to be given in dm³ or cm³.
  5. Using the wrong value of R. 8.3148.314 goes with Pa and m³ (or kPa and dm³); 0.082060.08206 goes with atm and L.
  6. Rounding too early. Keep intermediate values in your calculator and round only the final answer, usually to 3 significant figures.

Exam Tips (A-Level / AP / IB)

  • Write the conversions as separate lines, such as "V=250 cm3=2.50×10−4 m3V = 250\ \text{cm}^3 = 2.50 \times 10^{-4}\ \text{m}^3". This is often a mark on its own.
  • In "explain" questions about the gas laws, refer to frequency of collisions with the walls and, for temperature changes, the kinetic energy (or speed) of the molecules.
  • For real-gas questions, name both reasons: molecular volume becomes significant at high pressure, intermolecular forces become significant at low temperature.
  • AP questions often compare gases at the same temperature: same mean kinetic energy, but lighter molecules have higher mean speeds.

Frequently Asked Questions

What is the value of R in pV = nRT?

R=8.314 J mol−1 K−1R = 8.314\ \text{J mol}^{-1}\,\text{K}^{-1}, which is the same as 8.314 Pa m3 mol−1 K−18.314\ \text{Pa m}^3\,\text{mol}^{-1}\,\text{K}^{-1} or 8.314 kPa dm3 mol−1 K−18.314\ \text{kPa dm}^3\,\text{mol}^{-1}\,\text{K}^{-1}. In atm and litres it is 0.08206 L atm mol−1 K−10.08206\ \text{L atm mol}^{-1}\,\text{K}^{-1}.

What is the molar volume of a gas?

Rearranging to V/n=RT/pV/n = RT/p gives the volume of one mole: 24.5 dm³ at 298 K and 101 kPa (often rounded to 24 dm³), and 22.4 dm³ at 273 K and 101 kPa.

Does the ideal gas law depend on which gas I use?

No. For an ideal gas, one mole of any gas behaves the same way, regardless of its molar mass. That is why the equation has no term for the identity of the gas. Differences only appear for real gases at high pressure or low temperature.


  • Collision Theory: how molecular speed and the Maxwell–Boltzmann distribution control reaction rates.
  • Intermolecular Forces: the attractions that make real gases deviate from ideal behaviour.
  • Limiting Reagents: use gas volumes and moles in reacting-quantity calculations.

References & Further Reading

This article was created by the Vectora Editorial Team and is reviewed for alignment with AP, IB, and A-Level curricula. Content is based on standard academic sources in chemistry, physics, biology, and mathematics.

Published: 2026-10-02

For corrections or suggestions, contact support@vectora.one.