The Gas Laws: Formulas, Graphs, and Worked Examples

Every gas law with its formula, its graph and a worked example: Boyle's, Charles's, Gay-Lussac's, Avogadro's, Dalton's, Graham's, the combined law and PV = nRT, plus R in six sets of units.

Written and reviewed by the PrepOK team Last reviewed How we check these lessons

Pick a gas law and the held-constant quantities lock. Drag the one free control and watch the gas, the graph, and the equation respond, all from PV = nRT in real units.

Pressure
1.00atm
Volume
24.6L
Temperature
300K
27 °C
Amount
1.00mol

The indigo bar is a piston (its position shows the volume); dot colour shows temperature (blue = cold, red = hot). green = the quantity you control, brand = the result, grey = held constant.

Held constant
Temperature = 300 KAmount = 1.00 mol
smallbig
Pressure follows: P ∝ 1 / V
Pressure (atm) vs Volume (L)
Volume (L) →
The law, with your live numbers
P₁V₁ = P₂V₂
P ∝ 1 / V
1.00 × 24.6 = 1.00 × 24.6 (≈ 24.6 atm·L)

Left side is the starting state; right side is your current one. The two stay equal because the held quantities don't change.

These are real units (atm, L, K, mol) computed from the ideal gas law PV = nRT with R = 0.082057 L·atm/(mol·K). Temperature is in kelvin: gas laws are proportionalities measured from absolute zero, so 0 K (−273.15 °C), not 0 °C, is where a line of volume or pressure heads to zero. Real gases drift from these ideal lines at very high pressure or very low temperature.

Boyle's Law. Temperature held at 300 K, Amount held at 1.00 mol. Volume set to 24.6 L, so Pressure is 1.00 atm.

All the gas laws at a glance

LawHeld constantFormulaIn words
Boyle’sT, nP₁V₁ = P₂V₂P inversely proportional to V
Charles’sP, nV₁/T₁ = V₂/T₂V directly proportional to T
Gay-Lussac’sV, nP₁/T₁ = P₂/T₂P directly proportional to T
Avogadro’sP, TV₁/n₁ = V₂/n₂V directly proportional to n
CombinednP₁V₁/T₁ = P₂V₂/T₂merges the three above
Ideal(nothing)PV = nRTall four quantities at once
Dalton’sV, TP(total) = P₁ + P₂ + …the pressures in a mixture add
Graham’sP, Trate₁ / rate₂ = √(M₂ / M₁)lighter gases escape faster

Units throughout: P in atmospheres, V in litres, n in moles, and T in kelvin, always (see why).

Read down the held constant column of the first three rows and you find the same letter in every one: n. Boyle’s, Charles’s and Gay-Lussac’s laws all assume the amount of gas never changes, because they describe one sealed sample being squeezed or heated, not gas being added or let out.

So how many gas laws are there? There are four simple laws, one for each pair of quantities you can relate: Boyle’s, Charles’s, Gay-Lussac’s and Avogadro’s. Merge them and you get two more, the combined gas law and the ideal gas law, making six. Most courses then teach Dalton’s law of partial pressures and Graham’s law of effusion in the same unit, which makes eight. That is why you will see the topic called “the three gas laws”, “the five gas laws” and “the seven gas laws” in different books: they are counting different subsets of the same list above, not disagreeing about the chemistry.

Every gas law as a graph

Each law has a characteristic shape, and telling them apart is half of what exam questions test. All of them below are computed from PV = nRT for one mole of gas, so they are the real curves rather than sketches.

Boyle's law Pressure against volume (P vs V)
0 1 2 3 0 10 20 30 40 50 Volume (L) → Pressure (atm)

Shape: a curve that bends away from both axes (a hyperbola).

Halve the volume and the pressure doubles, so the product PV stays put. The curve approaches both axes but never reaches either: no matter how hard you squeeze, the volume does not hit zero.

Boyle's law Pressure against 1/volume (P vs 1/V)
0 1 2 3 0 0.05 0.1 1 / Volume (1/L) → Pressure (atm)

Shape: a straight line through the origin.

The same data, plotted against 1/V instead of V, comes out straight. This is how you check that a set of measurements really obeys Boyle's law: a curve can be eyeballed wrong, a straight line cannot.

Charles's law Volume against temperature in kelvin (V vs T)
0 10 20 30 40 0 100 200 300 400 500 Temperature (K) → Volume (L)

Shape: a straight line through the origin.

Volume is proportional to the kelvin temperature, so the line aims exactly at (0 K, 0 L). Double the kelvin temperature and you double the volume.

Charles's law The same line, plotted in degrees Celsius (V vs T (°C))
0 10 20 30 40 -300 -200 -100 0 100 200 −273.15 °C Temperature (°C) → Volume (L)

Shape: a straight line that reaches zero volume at −273.15 °C.

Nothing about the line changed, only the labels on the axis. It no longer passes through the origin, which is exactly why the formulas need kelvin. Run the line back and every gas points at the same temperature, and that is how absolute zero was found: the dashed part is extrapolation, because a real gas has long since become a liquid.

Gay-Lussac's law Pressure against temperature in kelvin (P vs T)
0 0.5 1 1.5 0 100 200 300 400 500 Temperature (K) → Pressure (atm)

Shape: a straight line through the origin.

Same shape as Charles's law, different quantity. In a sealed rigid container the gas cannot expand, so the energy you add shows up as pressure instead. This is the line behind the warning on an aerosol can.

Avogadro's law Volume against amount of gas (V vs n)
0 20 40 60 80 0 1 2 3 Amount (mol) → Volume (L)

Shape: a straight line through the origin.

Twice the moles, twice the volume. The slope does not depend on which gas it is, which is the surprising part: equal volumes of any two gases at the same temperature and pressure hold equal numbers of molecules.

Combined and ideal gas laws PV against temperature (PV vs T)
0 10 20 30 40 50 0 200 400 600 state 1 state 2 Temperature (K) → P × V (L·atm)

Shape: a straight line through the origin, with slope nR.

Every state a fixed sample of gas can reach sits somewhere on this line, however you shuffle P and V between them. Both marked states have the same PV/T, and that is the combined gas law: P₁V₁/T₁ = P₂V₂/T₂. Read the slope and you have PV = nRT.

Ideal gas law Pressure against volume at three temperatures (P vs V isotherms)
0 1 2 3 4 0 10 20 30 40 50 200 K 300 K 400 K Volume (L) → Pressure (atm)

Shape: a family of curves, one for each temperature, none of them crossing.

Each single curve is Boyle's law at one fixed temperature, which is what an isotherm means. Heat the gas and its whole curve moves outward. The family of them together is PV = nRT.

Two things are worth spotting across the whole set. Straight through the origin is the signature of a direct proportionality, and three of these laws have it. Curved means inverse, which only Boyle’s law is. And the odd one out, Charles’s law drawn in Celsius, is the same straight line as the one beside it: only the axis labels changed, and that alone is enough to move it off the origin.

Four numbers describe any gas

To pin down a gas you only need four measurements, and the gas laws are the rules that tie them together:

Change one and the others respond. The simulator above lets you change exactly one at a time: pick a law and it locks the two quantities that law holds constant, leaving you one slider. Everything you watch (the piston, the graph, the equation) is computed live from the single relationship that contains all the gas laws, the ideal gas law:

P V = n R T

The rest of this page takes that apart one law at a time. Each law just answers “if I hold these two steady and change that one, what happens to the fourth?”

Boyle’s law: squeeze it and pressure climbs

At constant temperature (and a fixed amount of gas), pressure and volume are inversely proportional. Halve the volume and the pressure doubles; the product stays constant.

P₁V₁ = P₂V₂

Boyle’s law in real life: pushing a capped syringe or a bicycle pump gets harder as the trapped air’s pressure climbs; a scuba diver’s lungs and air bubbles are squeezed as the total pressure on them roughly doubles by 10 m depth; and breathing itself works this way, as expanding your chest lowers your lung pressure so air flows in.

Charles’s law: heat it and it expands

At constant pressure, volume is directly proportional to absolute temperature. Heat the gas and it expands; cool it and it shrinks, in lockstep with the kelvin temperature.

V₁ / T₁ = V₂ / T₂

Charles’s law in real life: a hot-air balloon rises because heating the air expands it and lowers its density; a balloon shrinks in a freezing car overnight and re-inflates indoors; and bread and cakes rise as trapped gas pockets expand in the oven.

Gay-Lussac’s law: heat a sealed can and pressure rises

At constant volume (a rigid, sealed container), pressure is directly proportional to absolute temperature.

P₁ / T₁ = P₂ / T₂

Avogadro’s law: more gas, more volume

At constant temperature and pressure, volume is directly proportional to the amount of gas. Add twice the moles and the volume doubles.

V₁ / n₁ = V₂ / n₂

The combined gas law: when everything changes at once

When a fixed amount of gas moves from one set of conditions to another and pressure, volume, and temperature all change together, merge the three single laws into one:

P₁V₁ / T₁ = P₂V₂ / T₂

Worked example. A gas occupies 4.00 L at 1.00 atm and 300 K. The pressure is raised to 2.00 atm and the temperature to 600 K. Solving for V₂:

V₂ = (P₁V₁T₂) / (T₁P₂) = (1.00 × 4.00 × 600) / (300 × 2.00) = 4.00 L

Doubling the temperature alone would double the volume; doubling the pressure alone would halve it. Here the two effects exactly cancel, so the volume is unchanged.

The ideal gas law: PV = nRT

Hold nothing constant and you need the full relationship. The ideal gas law ties all four quantities together with one constant, R:

P V = n R T

SymbolMeaningUnit
Ppressureatm
VvolumeL
namount of gasmol
Ttemperature (absolute)K
Runiversal gas constant0.082057 L·atm/(mol·K)

R is the same physical constant everywhere. It does not change from problem to problem, and it is not different for different gases; the only thing that changes is the units it is written in, chosen to match the units your pressure and volume are already in.

The value of the universal gas constant R in 6 sets of units, with the kind of problem each one suits.
R Units Use it when
0.082057 L·atm/(mol·K) pressure in atm, volume in L
8.3145 J/(mol·K) SI units, or energy problems
8.3145 L·kPa/(mol·K) pressure in kPa, volume in L
0.083145 L·bar/(mol·K) pressure in bar, volume in L
62.364 L·mmHg/(mol·K) pressure in mmHg or torr
1.9872 cal/(mol·K) older texts, thermochemistry

If your pressure is in atmospheres and your volume in litres, use the first row and nothing needs converting. If the pressure arrives in kPa or mmHg, you can either convert the pressure to atm or switch to the matching row: both give the same answer, and the second is fewer steps.

Worked example. What volume does 2.00 mol of gas occupy at 3.00 atm and 27 °C? First convert the temperature: T = 27 + 273 = 300 K. Then

V = nRT / P = (2.00 × 0.082057 × 300) / 3.00 = 16.4 L

Two more laws you will be asked for

The six laws above all describe one gas. Two more come up in the same unit and are usually counted among the gas laws.

Dalton’s law of partial pressures

In a mixture, each gas pushes on the walls as though the others were not there, and the total pressure is the sum of those individual partial pressures.

P(total) = P₁ + P₂ + P₃ + …

Each gas’s share follows its share of the molecules, so a gas that is 21% of the moles supplies 21% of the pressure: P(gas) = X(gas) × P(total), where X is the mole fraction.

Worked example. Dry air at 1.00 atm is roughly 78% nitrogen and 21% oxygen by moles. So the partial pressure of nitrogen is 0.78 × 1.00 = 0.78 atm, and of oxygen 0.21 × 1.00 = 0.21 atm. This is why a diver breathing ordinary air at depth takes in more oxygen per breath: the total pressure has gone up, so every partial pressure has gone up with it.

Graham’s law of effusion

Lighter molecules move faster at the same temperature, so they escape through a small hole sooner. Rate of effusion is inversely proportional to the square root of the molar mass:

rate₁ / rate₂ = √(M₂ / M₁)

Worked example. Helium (M = 4.00 g/mol) against oxygen (M = 32.0 g/mol): √(32.0 / 4.00) = √8 = 2.83. Helium effuses about 2.8 times faster, which is why a helium balloon goes soft in a day or two while an air-filled one does not.

Always use kelvin

The single most common gas-law mistake is using Celsius. Every temperature in these formulas must be in kelvin. The laws are proportionalities measured from absolute zero: plot the volume of any gas against Celsius temperature, extend the line backward, and every gas reaches zero volume at the same point, −273.15 °C. That point is 0 K. Only on the kelvin scale does “twice the temperature” mean “twice the volume,” because 0 °C is an ordinary, energetic temperature, not zero. Convert with T(K) = T(°C) + 273.15.

Why the gas laws work, and where they bend

These laws are the large-scale shadow of what individual particles are doing. Pressure is countless tiny collisions with the walls; temperature is the particles’ average kinetic energy. Watch that microscopic story directly in the Particle Box, where the same PV ∝ nT emerges from a live box of bouncing atoms. The gas laws describe an ideal gas; real gases drift from them at very high pressure or very low temperature, where the particles’ own volume and their attractions start to matter.

It’s free to embed on your own site or LMS. Next, see the gas laws emerge from moving particles in the Particle Box, or connect amount to mass in the mole.

Frequently asked questions

What are the gas laws?
The gas laws describe how the pressure (P), volume (V), temperature (T), and amount (n, in moles) of a gas relate to each other. The four simple laws each hold two of these constant: Boyle's law (P inversely proportional to V at constant T, n), Charles's law (V directly proportional to T at constant P, n), Gay-Lussac's law (P directly proportional to T at constant V, n), and Avogadro's law (V directly proportional to n at constant P, T). Combined, they give the ideal gas law, PV = nRT.
What are the gas law formulas?
Boyle's law: P1V1 = P2V2. Charles's law: V1/T1 = V2/T2. Gay-Lussac's law: P1/T1 = P2/T2. Avogadro's law: V1/n1 = V2/n2. Combined gas law: P1V1/T1 = P2V2/T2. Ideal gas law: PV = nRT, where R = 0.082057 L·atm/(mol·K) or 8.3145 J/(mol·K). Dalton's law: P(total) = P1 + P2 + P3. Graham's law: rate1/rate2 = the square root of (M2/M1). All temperatures must be in kelvin.
How many gas laws are there?
There are four simple gas laws, one for each pair of quantities: Boyle's, Charles's, Gay-Lussac's and Avogadro's. Merging them gives two more, the combined gas law and the ideal gas law, for six. Most courses also teach Dalton's law of partial pressures and Graham's law of effusion in the same unit, which makes eight. Books that say 'the three gas laws' or 'the five gas laws' are counting different subsets of that same list, not disagreeing about the chemistry.
Which quantity is held constant in Boyle's, Charles's, and Gay-Lussac's laws?
The amount of gas, n, measured in moles. Boyle's law also holds temperature constant, Charles's law holds pressure constant, and Gay-Lussac's law holds volume constant, but all three assume the number of moles never changes, because each describes one sealed sample being squeezed or heated rather than gas being added or released.
What do the gas law graphs look like?
Boyle's law (P against V) is a curve, a hyperbola, because the relationship is inverse; plot P against 1/V instead and it straightens into a line through the origin. Charles's law (V against T), Gay-Lussac's law (P against T) and Avogadro's law (V against n) are all straight lines through the origin, because each is a direct proportionality. The ideal gas law drawn as P against V gives a family of curves, one per temperature, called isotherms.
What is Dalton's law of partial pressures?
In a mixture of gases, each gas exerts pressure as though the others were not there, and the total is the sum: P(total) = P₁ + P₂ + P₃ and so on. Each gas's share matches its share of the molecules, so P(gas) = X(gas) × P(total), where X is the mole fraction. Dry air at 1.00 atm is about 78% nitrogen by moles, so nitrogen's partial pressure is about 0.78 atm.
Why must temperature be in kelvin for the gas laws?
Because the gas laws are proportionalities measured from absolute zero. Volume and pressure head to zero at 0 K (-273.15 °C), so only on the kelvin scale does doubling the temperature truly double the volume or pressure. Using Celsius would make the ratios meaningless: 0 °C is an ordinary, energetic temperature, not zero. Convert with T(K) = T(°C) + 273.15.
What is R, the gas constant?
R is the universal (molar) gas constant, the single constant that makes PV = nRT balance. It is 0.082057 L·atm/(mol·K) when pressure is in atmospheres and volume in liters, 8.3145 J/(mol·K) in SI units, 8.3145 L·kPa/(mol·K), 0.083145 L·bar/(mol·K), 62.364 L·mmHg/(mol·K), or 1.9872 cal/(mol·K). R never changes from problem to problem, and it is the same for every gas; only its units change to match the units you are using.
What is the difference between Boyle's law and Charles's law?
Boyle's law holds temperature constant and relates pressure and volume inversely: squeeze the gas smaller and the pressure rises. Charles's law holds pressure constant and relates volume and temperature directly: heat the gas and it expands. Boyle is an inverse relationship (P up, V down); Charles is a direct one (T up, V up).

Sources

The figures in this interactive are computed from unit-tested code and the sources above, not typed in by hand. See how we build and check these lessons, and tell us at support@prepok.com if you spot an error.

Embed this on your site

Free to use. Paste this anywhere; a link back to PrepOK is included.

Related