Science

What Is the Ideal Gas Law? (PV = nRT, and What R Actually Is)

PV = nRT is four letters and an equals sign, and it describes the behaviour of every gas you have ever breathed, inflated or boiled. The equation itself is easy — the parts that trip students up are what that R is doing there and which units you're allowed to use. This covers the intuition first, then the formula, then R, then a full worked example.

Short answer

The ideal gas law says pressure × volume = moles × R × temperature. It ties together the four things that describe any gas: squeeze it and the pressure rises, heat it and it expands, add more gas and both go up. R is the gas constant, 8.314 J/(mol·K) — the number that makes the units on both sides agree. Temperature must always be in kelvin.

What Pressure, Volume and Temperature Actually Do

Before the formula, get the picture. Everything in the ideal gas law follows from one fact: a gas is a crowd of molecules flying around and bouncing off things.

Pressure is what you feel when those molecules hit a surface. Not one dramatic impact — billions of tiny ones every instant, adding up to a steady push. That's it. Every behaviour below is just a consequence of changing how often those hits happen, or how hard they land.

Squeeze a balloon: pressure goes up

Press a balloon between your hands and it gets harder to squeeze. You've made the container smaller without removing any air, so the same number of molecules now have less room. Each one reaches a wall sooner, so hits arrive more often, so the pressure rises.

Smaller volume, higher pressure. Halve the volume and you double the pressure.

Heat a balloon: it expands

Leave a balloon in a hot car and it swells. Put it in the freezer and it shrivels. Temperature is a measure of how fast the molecules are moving, so heating them makes them fly faster — hitting the walls harder and more often. The rubber stretches until it pushes back hard enough to balance.

Higher temperature, bigger volume (if the pressure is free to stay constant), or higher pressure if the container can't expand. That second version is why aerosol cans carry a warning about heat, and why tyre pressure reads higher after a long drive.

Blow more air in: both go up

Add more molecules and there are simply more of them to hit the walls. More gas means more pressure, more volume, or some combination — which is the least surprising part of the whole law.

The widget below is that microscopic picture, made visible. Change the box size and the molecular speed, and watch what happens to the rate of impacts on the walls.

Where pressure comes from

Every dot is a gas molecule. Pressure is nothing more than the sum of their impacts on the walls. Shrink the container or heat the gas and watch the impact rate climb.

Measured pressure 100
Wall impacts per second

A simplified two-dimensional picture, not an exact calculation: the molecules are drawn far larger and far fewer than reality, and the pressure reading is an index scaled to 100 at the starting conditions. The trends it shows — pressure rising as volume falls and as temperature climbs — are the real relationships in PV = nRT.

The Formula: PV = nRT

Instead of memorising three separate rules, the ideal gas law packs all of them into one statement:

P V = n R T Pressure × Volume = moles × gas constant × Temperature
What each variable means, and the unit it must be in
SymbolQuantityStandard unitIn plain language
PPressurepascals (Pa) How hard the gas pushes on its container. 1 atm ≈ 101,325 Pa.
VVolumecubic metres (m³) How much space the gas fills. 1 m³ = 1,000 L.
nAmountmoles (mol) How much gas there is, counted in molecules. One mole is 6.022×10²³ of them.
RGas constantJ/(mol·K) Always 8.314. The number that makes the units work out — see below.
TTemperaturekelvin (K) Always kelvin, never Celsius. K = °C + 273.15.

Read left to right, the equation says the two sides always balance. Change something on one side and something else must move to compensate. Squeeze the volume down and pressure climbs to keep the product the same. Heat the gas and the right side grows, so P or V must grow with it.

Why does temperature have to be in kelvin?

Because the equation only works if temperature counts up from actual zero — the point where molecular motion stops. The Celsius scale has its zero at the freezing point of water, which is an arbitrary place to start from as far as gas molecules are concerned.

Try it with Celsius and the absurdity is obvious: a gas at 0 °C would have T = 0, so PV = 0, so the gas would exert no pressure at all. A gas at −10 °C would somehow have negative pressure. Kelvin fixes this by starting at absolute zero, so T is always positive and always proportional to the real energy of the molecules. Forgetting this conversion is the single most common mistake in ideal gas problems.

Where does n come from?

You almost never measure moles directly — you weigh a gas in grams and convert. Divide the mass by the molar mass of the substance and you have n. If you need the molar mass of a compound from its formula, a molar mass calculator saves adding up atomic weights by hand.

What Is R in the Ideal Gas Law?

This is the part textbooks skip past, and it deserves a proper answer rather than "R is the gas constant."

R = 8.314 J/(mol·K) The full value is 8.31446261815324 J/(mol·K) — exact by definition since the 2019 revision of the SI units. For any problem you'll be set, 8.314 is more than enough.

Why does R need to exist at all?

Because the two sides of the equation are measured in units that were invented separately and have no reason to match.

On the left you have pascals times cubic metres. On the right, moles times kelvin. Nothing about counting molecules and measuring temperature automatically produces the same units as pressure times volume — so something has to bridge them. That's R, and you can read the job description straight off its units: joules per mole per kelvin. It converts "one mole of gas, one kelvin warmer" into "this much energy."

Which points at what R really is. Pressure times volume has units of energy — a pascal is a newton per square metre, and a newton times a metre is a joule. So PV = nRT is quietly an energy equation: it says the energy content of a gas is proportional to how much of it you have and how hot it is. R is the exchange rate between temperature and energy.

Where the number 8.314 comes from

R isn't arbitrary either. It's the energy-per-kelvin of a single molecule, scaled up to a whole mole:

R = NA × kB = (6.022×10²³ /mol) × (1.381×10⁻²³ J/K) = 8.314 J/(mol·K) NA is Avogadro's number, how many molecules are in a mole. kB is the Boltzmann constant, the energy-per-kelvin of one molecule. Multiply them and you get R.

So R is not a mysterious constant of nature so much as a unit-conversion convenience. Nature's actual constant is kB, which applies to one particle. R is the same thing repackaged for people who work in moles instead of individual molecules — which is to say, chemists.

Why do I keep seeing R = 0.08206?

Because there's a second version of R for people working in litres and atmospheres instead of cubic metres and pascals:

The two values of R you'll meet, and when to use each
Value of RUse when P is inand V is in
8.314 J/(mol·K)pascals (Pa)cubic metres (m³)
0.08206 L·atm/(mol·K)atmospheres (atm)litres (L)

They are the same physical quantity written in different currencies — 1 L·atm happens to equal 101.325 J, and 0.08206 × 101.325 = 8.314. Pick whichever matches the units in your problem and stay consistent. Mixing them is the second most common way to get these questions wrong.

A Worked Example, Step by Step

A 12.0 L cylinder holds 3.50 mol of oxygen at 22 °C. What is the pressure inside?

Step 1 — Identify what you have and what you want

You're given V, n and T, and you want P. Three known, one unknown — the standard shape of these problems.

Step 2 — Convert every unit before touching the equation

Do this first, every time. It is where nearly all lost marks live — our unit converter handles litres to cubic metres and the rest in one step.

Converting the given values to SI units
GivenConvertUse this
12.0 L÷ 10000.0120 m³
22 °C+ 273.15295.15 K
3.50 molalready correct3.50 mol

Step 3 — Rearrange for the unknown

PV = nRT   →   P = nRT ÷ V

Step 4 — Substitute and solve

  1. Multiply n × R: 3.50 × 8.314 = 29.10
  2. Multiply by T: 29.10 × 295.15 = 8,588.6
  3. Divide by V: 8,588.6 ÷ 0.0120 = 715,714
P = 716,000 Pa = 716 kPa = 7.06 atm Rounded to three significant figures, matching the precision of the values you were given.

Is that sensible? 716 kPa is about 104 psi — roughly the pressure in a road bicycle tyre, and about seven times atmospheric pressure. Entirely reasonable for a gas cylinder. Always run that check: if you get 0.0004 Pa or 40 million Pa from ordinary laboratory numbers, you've dropped a conversion somewhere.

To check your own working — or to solve for whichever of the four variables you're missing — you can run the numbers through an ideal gas law calculator.

A useful result worth memorising

Run the same equation for one mole at 0 °C and 1 atm and something familiar falls out:

V = nRT ÷ P = (1 × 8.314 × 273.15) ÷ 101,325 = 0.0224 m³ = 22.4 L One mole of any ideal gas occupies about 22.4 litres at standard temperature and pressure — whether it's hydrogen, oxygen or carbon dioxide.

That's a genuinely strange result when you first meet it. The molecules have wildly different sizes and masses, and it doesn't matter at all. In an ideal gas only the number of molecules counts, which is the clearest possible statement of what "ideal" is assuming.

What if the conditions change instead?

A very common variant gives you a gas in one state and asks what happens after it's heated, compressed or moved. Since n and R don't change, PV/T stays constant, and you can compare the two states directly with P₁V₁/T₁ = P₂V₂/T₂ — the combined gas law. That form needs no constant at all, because R cancels out of both sides — which is why it works even when you do not know how much gas you have.

What Does "Ideal" Actually Mean?

The name is a warning label. An ideal gas is a simplified model that assumes two things which are not quite true:

  • The molecules take up no space themselves — they're treated as points.
  • They don't attract or repel each other — they only interact by bouncing.

Real molecules do have volume, and they do feel faint attractions. Under everyday conditions those effects are so small that the ideal gas law is accurate to within about 1%, which is usually better than your measurements. The model earns its keep.

It breaks down where those assumptions stop being reasonable: at very high pressure, where molecules are packed close enough that their own volume matters, and at very low temperature, where they move slowly enough for attractions to take hold — which is exactly the condition under which gases condense into liquids, something an ideal gas can never do — you can watch that transition happen in our states of matter simulator. For those cases, chemists use corrected equations like van der Waals'.

For a balloon, a tyre, a lab flask or a weather balloon, PV = nRT is the right tool.

Checklist Before You Submit an Answer

  • Is temperature in kelvin? (°C + 273.15)
  • Does your R match your units? 8.314 with Pa and m³; 0.08206 with atm and L.
  • Did you convert litres to cubic metres if you're using 8.314? (÷ 1000)
  • Did you convert grams to moles if you were given a mass?
  • Is the answer plausible? Everyday gases sit within a few multiples of 101 kPa, not billionths or billions of it.

The Takeaway

PV = nRT is one equation doing the work of three separate gas laws, and every part of it comes back to molecules bouncing off walls. Squeeze the container and they hit more often. Heat them and they hit harder. Add more and there are simply more hits. R is the exchange rate that lets you state all of that in units people actually measure in, and it's really just the Boltzmann constant scaled up to mole-sized quantities.

Get the units right and these problems become arithmetic. Almost every wrong answer in this topic is a Celsius that should have been a kelvin, or a litre that should have been a cubic metre — not a misunderstanding of the physics.

Solve for the variable you're missing

Enter any three of pressure, volume, moles and temperature and get the fourth, with the unit conversions handled for you. Free, no sign-up, runs in your browser.

Try the calculator Ideal Gas Law Calculator (PV = nRT) Solve PV = nRT for pressure, volume, moles or temperature, with the exact 2019 SI gas constant.

Worked figures were recomputed independently: 3.50 mol at 295.15 K in 0.0120 m³ gives 715,714 Pa (716 kPa, 7.06 atm, ~104 psi), and one mole at STP occupies 22.4 L. R is exact by definition since the 2019 SI revision. Educational content for introductory chemistry.

Did this help? You can buy me a coffee.