This guide is for students learning the gas laws in high school or first-year university chemistry, and for anyone revising gas calculations.

“I cannot tell whether to use the ideal gas law or the combined gas law.” “My answer is wrong even though I followed the formula.” Both problems become manageable once you check two things first: does the amount of gas change, and did you convert temperature to kelvin? This guide covers how to choose the equation, unit conversion, worked examples, common mistakes, and how to check your answers with a free browser calculator.

Decide by asking whether the amount of gas changes

Situation Equation to use Why
A sealed container changes from state 1 to state 2 with the same amount of gas P₁V₁/T₁ = P₂V₂/T₂ n is constant, so nR is the same on both sides
One state, with three of P, V, n and T known PV = nRT The fourth quantity follows directly
Gas is added or released Write PV = nRT for each state n is not constant, so the ratio equation does not apply
Pressure and volume at constant temperature P₁V₁ = P₂V₂ (Boyle’s law) PV = nRT with T fixed
Volume and temperature at constant pressure V₁/T₁ = V₂/T₂ (Charles’s law) PV = nRT with P fixed

If you forget the special cases, go back to PV = nRT and hold one variable constant. What you must not do is apply the combined gas law when gas enters or leaves an open container, because n changes.

Check the units before substituting

Most wrong answers come from units. Match everything to the units of your gas constant first.

Quantity Common unit Convert to Notes
Temperature T °C K = t + 273.15 (some textbooks use 273) 27 °C = 300.15 K
Pressure P atm × 1.01325×10⁵ → Pa 1.013×10⁵ Pa is fine in most problems
Pressure P mmHg × 133.3 → Pa 760 mmHg = 1 atm
Volume V mL ÷ 1000 → L Convert before computing moles too
Volume V m³ × 1000 → L 1 m³ = 1000 L
Amount n g ÷ molar mass → mol Use the formula of the actual substance

With P in pascals and V in litres, use R = 8.31×10³ Pa·L/(K·mol). The physics value 8.31 J/(mol·K) belongs with V in m³, because 1 J = 1 Pa·m³ = 1000 Pa·L. Mixing 8.31 J/(mol·K) with a volume in litres makes the answer 1000 times too small. The defining value of R is 8.314462618… J/(mol·K) (NIST CODATA).

Example 1: Why one mole at STP is 22.4 L

At standard conditions (0 °C, 1.013×10⁵ Pa), solve PV = nRT for V with n = 1 mol.

  1. T = 0 + 273.15 = 273.15 K
  2. V = nRT / P
  3. V = 1 × 8.31×10³ × 273.15 ÷ (1.013×10⁵) = 22.4 L

Using T = 273 K, as many textbooks do, also gives 22.4 L. The key point is that 22.4 L/mol is tied to those conditions: at 27 °C one mole occupies about 24.6 L instead. Do not reuse 22.4 L when the temperature is different.

There are two conventions for standard pressure: 1 atm (1.013×10⁵ Pa) and 1 bar (1.00×10⁵ Pa). The 22.4 L value refers to 1 atm; at 1 bar and 0 °C one mole occupies about 22.7 L, as noted in the footnote of OpenStax 9.2.

Example 2: Finding pressure with the ideal gas law

A 0.50 mol sample occupies 5.0 L at 27 °C. Find the pressure.

  1. T = 27 + 273.15 = 300.15 K (300 K with the textbook conversion)
  2. P = nRT / V
  3. P = 0.50 × 8.31×10³ × 300.15 ÷ 5.0 = 2.494×10⁵ Pa → 2.49×10⁵ Pa

Using R = 8.3×10³ and T = 300 K gives 2.49×10⁵ Pa as well, so both conventions agree to three significant figures. As a check, PV/T = 2.49×10⁵ × 5.0 ÷ 300.15 ≈ 4.15×10³, which matches nR = 0.50 × 8.31×10³ = 4.16×10³.

Example 3: Comparing two states

Constant temperature: Boyle’s law

A gas at 1.0×10⁵ Pa occupies 2.0 L. It is compressed to 4.0×10⁵ Pa at constant temperature. Find V₂.

P₁V₁ = P₂V₂, so V₂ = (1.0×10⁵ × 2.0) ÷ (4.0×10⁵) = 0.50 L

Quadrupling the pressure quarters the volume.

Changing pressure and temperature: combined gas law

The same gas goes from 1.0×10⁵ Pa at 27 °C to 4.0×10⁵ Pa at 127 °C. Find V₂.

  1. Convert temperatures: T₁ = 300.15 K, T₂ = 400.15 K
  2. Rearrange first: V₂ = P₁V₁T₂ / (T₁P₂)
  3. Substitute: V₂ = (1.0×10⁵ × 2.0 × 400.15) ÷ (300.15 × 4.0×10⁵) = 0.667 L

Raising the temperature pushes the volume up; raising the pressure pushes it down. The result combines both effects: a quarter from the pressure ratio and about four thirds from the temperature ratio. Rearranging before substituting prevents the classic mistake of placing T in the wrong part of the fraction.

Example 4: Density and molar mass

Density ρ = PM / (RT)

Find the density of oxygen, O₂ (molar mass 32 g/mol), at 1.013×10⁵ Pa and 27 °C.

ρ = (1.013×10⁵ × 32) ÷ (8.31×10³ × 300.15) = 1.30 g/L

A density in g/L is numerically equal to kg/m³.

Molar mass M = ρRT / P

A gas has a density of 1.34 g/L at 1.013×10⁵ Pa and 0 °C. Find its molar mass.

M = (1.34 × 8.31×10³ × 273.15) ÷ (1.013×10⁵) = 30.0 g/mol

That matches ethane, C₂H₆ (about 30 g/mol). The formula comes from substituting n = m/M into PV = nRT (OpenStax 9.3).

Common mistakes

  • Substituting Celsius directly: 27 °C is 300.15 K, not 27. Using 27 makes volumes roughly eleven times too small (or pressures too large)
  • Mixing mL and L: putting mL into V in P = nRT/V makes the answer 1000 times off. Convert to litres before computing moles
  • Mixing the two R values: 8.31 J/(mol·K) goes with cubic metres, 8.31×10³ Pa·L/(K·mol) goes with litres
  • Inverting the temperature ratio: V₂ = P₁V₁T₂/(T₁P₂). Sanity-check the direction: higher temperature means larger volume
  • Using the combined gas law when n changes: if gas is added or released, write PV = nRT for each state. An open container is not a constant-n system
  • Using 22.4 L/mol out of context: it only applies at 0 °C and 1.013×10⁵ Pa. At 27 °C the molar volume is about 24.6 L

Check your answers with the tool

The Tools Hub ideal gas law calculator mirrors the three examples above.

1

Example 2

Choose "Ideal gas law PV = nRT (one state)" and set the unknown to "Pressure P". Enter volume 5.0 (L), amount 0.50 (mol) and temperature 27 (°C), then press Calculate. The result is 2.49×10⁵ Pa, with the conversion T = 27.0 °C = 300 K and the substitution shown step by step.

2

Example 3

Switch to "Combined gas law P₁V₁/T₁ = P₂V₂/T₂ (two states)" and solve for "Volume V₂". Enter P₁ = 1.0×10⁵ (Pa), V₁ = 2.0 (L), T₁ = 27 (°C), P₂ = 4.0×10⁵ (Pa) and T₂ = 127 (°C) to get 0.667 L with the rearrangement shown. The preset "Boyle's law 2.0 L → 0.50 L" reproduces the constant-temperature case.

3

Density and molar mass

In "Density & molar mass ρ = PM/(RT)", solve for "Molar mass M (g/mol)" and enter density 1.34 (g/L), pressure 1.013×10⁵ (Pa) and temperature 0 (°C) to get 30.0 g/mol. You can switch the gas constant between 8.31×10³ and 8.3×10³. Results are shown to three significant figures, so round to the digits given in your problem before reporting.

Tool used in this guide

Ideal Gas Law Calculator

Solve PV = nRT, the combined gas law, and gas density or molar mass with unit conversions and the working shown. Free, no sign-up, and everything runs in your browser.

Open the tool

Applicability and limits

  • These calculations assume an ideal gas, a model that ignores molecular volume and intermolecular forces. Real gases follow it best at low pressure and high temperature
  • At high pressure or low temperature the deviation grows. A strongly compressed gas can occupy less volume than PV = nRT predicts, and corrections such as the van der Waals equation are needed (OpenStax 9.6)
  • Using 273 instead of 273.15 changes results by about 0.05%, usually invisible at three significant figures but relevant at higher precision (NIST)
  • For a mixture, PV = nRT applies to the total moles, and the partial pressures add according to Dalton’s law. Partial-pressure calculations are outside the scope of this guide
  • Converting a mass of gas to moles requires the molar mass of the actual substance, or an average molar mass for a mixture

FAQ

What is the difference between Boyle’s law and Charles’s law?

Boyle’s law applies at constant temperature and says PV is constant. Charles’s law applies at constant pressure and says V/T is constant. Both are special cases of PV = nRT, and both follow from the combined gas law P₁V₁/T₁ = P₂V₂/T₂.

What happens if I leave the temperature in Celsius?

Temperature enters the equation as an absolute quantity, so 27 °C must be 300.15 K. Using 27 makes results about eleven times off in the opposite direction, which usually shows up as an obviously unreasonable answer. Convert to kelvin before substituting.

Should I use R = 8.3×10³ or 8.31×10³?

Both appear in textbooks and give nearly identical results at two or three significant figures. Use the value your problem specifies; otherwise 8.31×10³ Pa·L/(K·mol) is a safe default. The measured value is about 8.314×10³.

When can I use 22.4 L/mol?

Only at 0 °C (273.15 K) and 1.013×10⁵ Pa, where one mole of ideal gas occupies about 22.4 L. At 27 °C the molar volume is about 24.6 L. Computing the volume from PV = nRT each time avoids this trap.

Does the ideal gas law work for real gases?

It is a good approximation at low pressure and high temperature. Most textbook problems assume ideal behaviour, but near liquefaction or at high pressure you need a real-gas correction.

How this guide was checked

On 4 October 2026 the definitions and applicability conditions were checked against the sources listed above, and the example values were recalculated by hand (22.4 L, 2.49×10⁵ Pa, 0.50 L, 0.667 L, 1.30 g/L, 30.0 g/mol). The examples are teaching calculations, not measured experimental results. The tool inputs and the steps it displays were also verified.