A weather balloon is filled at ground level, a scuba tank is packed with air at high pressure, and an air bag inflates in a few hundredths of a second. In each case someone had to know how much gas fills a given space at a given pressure and temperature. One equation answers all of these questions for most gases near room conditions: the ideal gas law.
In this lesson you will use with consistent units, find the volume of a gas at standard conditions, and work out the density and the molar mass of a gas from measured data (Figure 1).
- DataP, V, T, n or m
- °C to K; mL to L; P in the unit of R
- Consistent units
- solve for the unknown
- Unknownn, V, P or T
- a mass, density or molar mass
- Answer3 s.f.
with T in K.At STP: . and .
Learning Objectives
After this lesson, you should be able to:
- Use with consistent units and the right value of .
- Calculate gas density and molar mass from PVT data.
Key Ideas
1. Pressure, Volume, Temperature and Amount
Four quantities describe a sample of gas: its pressure , its volume , its temperature and its amount of substance . Pressure is force per unit area. A barometer measures the pressure of the atmosphere as the height of a mercury column, which is where the units mmHg and torr come from (1 torr is the same as 1 mmHg). The SI unit is the pascal; chemists usually use kPa, atm or bar:
Gas laws need the absolute temperature, on the Kelvin scale. Add 273.15 to a Celsius temperature:
Figure 2 shows both conversions on one scale each. A temperature of 0 °C is 273.15 K, not zero: a gas at 0 °C still has plenty of thermal energy.
Key idea: before you use any gas law, put the temperature in K and know which unit your pressure is in. Every later step depends on these two choices.
2. The Ideal Gas Law
Boyle’s, Charles’s and Avogadro’s laws combine into one equation that links all four variables of a gas sample:
is the gas constant. Its value depends on the units you use for pressure and volume, so pick the whose units match your data (Figure 3). With the pressure in atm and the volume in L, use ; with kPa and L, use . Rearrange the equation for whichever variable is unknown, for example or .
P in atm:
P in kPa:
P in torr:
Energy units:
At constant volume and temperature, the pressure is proportional to the number of moles: twice as many molecules hit the walls twice as often (Figure 4). If the question asks for a mass, gives moles first; multiply by the molar mass from The Mole and Molar Mass to get grams.
Key idea: with in K, in L, in mol, and an whose pressure unit matches . The equation gives moles, not grams.
Note: a real gas follows closely at ordinary temperatures and pressures. At very high pressure or low temperature it deviates, because its molecules have volume and attract each other (Whitten Sec. 12-15). This lesson treats every gas as ideal.
3. Standard Conditions and Molar Volume
To compare gases, chemists use a reference called standard temperature and pressure (STP). In this lesson, as in Whitten, STP means exactly 273.15 K (0 °C) and 1 atm. One mole of any ideal gas then occupies the standard molar volume:
So at STP you can go straight from moles to liters: multiply the moles by 22.414 L for each mole. This shortcut works only at STP; at any other temperature or pressure, use .
Note: IUPAC now defines standard pressure as 1 bar (100 kPa). At 273.15 K and 1 bar one mole occupies 22.711 L, about 1.3% more (Figure 5). Every problem on this page states which standard it uses; when a problem says STP, it means 273.15 K and 1 atm.
Key idea: at STP (273.15 K and 1 atm), 1 mol of an ideal gas occupies 22.414 L. Convert grams to moles first, then multiply by the molar volume.
4. Gas Density and Molar Mass
Writing in the ideal gas law and dividing by gives the density of a gas:
A gas with a larger molar mass is denser (Figure 6), and any gas becomes denser when it is compressed or cooled. Unlike liquids, gas densities are usually quoted in g/L. Run the same idea backwards to identify an unknown gas: measure its mass, volume, pressure and temperature, find from , and divide:
Key idea: density in g/L; molar mass with from . Grams on top in both.
Try it: explore the ideal gas law
Pick the unknown, set the other three variables, switch the pressure unit to see which matches, and use the worked-example buttons to replay each example on the sliders.
Loading the simulator…
5. A Strategy for Ideal Gas Problems
Follow the roadmap in Figure 1:
- List the data and the unknown. Write each quantity with its unit.
- Convert: the temperature to K, the volume to L, and the pressure to the unit of your (or choose the that matches the pressure).
- Solve for the unknown; at STP you may use 22.414 L/mol instead.
- Finish: multiply moles by for a mass, use for a density, or divide grams by moles for a molar mass. Keep 4 significant figures until the last step and round the answer to 3.
Exam tip: check the size of your answer. One mole of gas near room conditions fills roughly 20 to 25 L. An answer far outside that range for about a mole usually means a Celsius temperature or a mismatched .
Worked Example 1: The Volume of a Gas Sample
Problem: A cylinder holds 0.425 mol of nitrogen gas, N2, at 745 torr and 26.5 °C. What volume does the gas occupy, in L?
Step 1. Convert the temperature to K.
Step 2. Convert the pressure to atm, to match in L·atm/(mol·K).
Step 3. Solve for and substitute in mol, , in K and in atm. The mol, K and atm cancel, leaving L.
Final Answer: 10.7 L of N2
The pressure, 0.9803 atm, is rounded to 4 significant figures; the unrounded value gives the same answer. Check: 0.425 mol at about room temperature and 1 atm should fill a little less than half of 22 L or so, and it does.
- Temperature in KStep 1
- Step 2: 745 torr to atm
- Pressure in atm
- Step 3: R in L·atm/(mol·K), n 0.425 mol
- Volume of N₂
Your turn: solve for one unknown
Same steps as Worked Example 1: temperature to K, match the pressure unit to , then solve for the unknown (a mass needs one more step).
Loading the practice problem…
Worked Example 2: A Volume at STP
Problem: What volume does 12.8 g of carbon dioxide, CO2, occupy at STP (0 °C and 1 atm)? The molar mass of CO2 is 44.01 g/mol.
Step 1. Convert the mass to moles.
Step 2. Multiply by the standard molar volume (273.15 K and 1 atm).
Final Answer: 6.52 L of CO2 at STP
The moles, 0.2908 mol, are rounded to 4 significant figures; the unrounded value gives the same answer. At the IUPAC standard (273.15 K and 1 bar) the molar volume is 22.711 L/mol, so the same gas would occupy a little more (moles kept to 5 significant figures here):
Always say which standard you mean.
- Mass of CO₂
- Step 1: molar mass of CO₂
- Moles of CO₂
- Step 2: STP: 273.15 K and 1 atm
- Volume at STP
Your turn: a volume at STP
Same two steps as Worked Example 2: grams to moles with the molar mass, then multiply by 22.414 L for each mole.
Loading the practice problem…
Worked Example 3: The Density of a Gas
Problem: What is the density of argon, Ar, at 1.75 atm and 42.0 °C, in g/L? The molar mass of Ar is 39.95 g/mol.
Step 1. Convert the temperature to K.
Step 2. Use the density form of the ideal gas law. The pressure is already in atm, so use .
Final Answer: 2.70 g/L
Check: at STP, argon’s density would be 1.78 g/L. Here the pressure is higher and the temperature only a little higher, so the gas is denser. It is.
- Temperature
- Step 1: to kelvins
- Temperature in K
- Step 2: P 1.75 atm, M 39.95 g/mol
- Density of Ar
Your turn: the density of a gas
Same steps as Worked Example 3: temperature to K, the that matches the pressure unit, then .
Loading the practice problem…
Worked Example 4: Identifying an Unknown Gas
Problem: A 0.655 g sample of an unknown gas fills a 255 mL flask at 98.6 kPa and 22.5 °C. Find its molar mass, in g/mol. The gas is one of C4H10, SO2, Cl2 or Kr.
Step 1. Convert the temperature to K and the volume to L.
Step 2. Find the moles from . The pressure is in kPa, so use .
Step 3. Divide the mass by the moles.
Final Answer: 64.0 g/mol: the gas is sulfur dioxide, SO2
The moles, 0.01023 mol, are rounded to 4 significant figures; the unrounded value gives the same answer. Of the four choices, SO2 (64.06 g/mol) is the only one within 1% of 64.0 g/mol; C4H10 (58.12) and Cl2 (70.90) are far off.
- Data
- Step 1: mL to L, °C to K
- Consistent units
- Step 2: R 8.314 for kPa
- Moles of gas
- Step 3: grams over moles
- Molar massSO₂
Your turn: the molar mass of an unknown gas
Same three steps as Worked Example 4: K and L, moles from , then grams divided by moles.
Loading the practice problem…
Common Mistakes
Throughout, keep 4 significant figures in intermediate values and round only the final answer to 3.
Common mistake: Using the Celsius temperature. In Worked Example 1, putting 26.5 instead of 299.65 into gives 0.943 L, more than ten times too small. Always add 273.15 first.
Common mistake: Using units that do not match R. Every contains L and K and one pressure unit, so the data must use the same units. In Worked Example 1, using 745 torr with gives 0.0140 L, about 760 times too small; convert to atm first, or use . In Worked Example 4, using 0.08206 with the pressure in kPa gives 0.632 g/mol, about 100 times too small, and using 255 instead of 0.255 L gives 0.0640 g/mol, 1000 times too small.
Common mistake: Mixing up grams and moles. When a question asks for a mass, gives only the moles: multiply by the molar mass to get grams. Molar mass is , in g/mol; in Worked Example 4, 0.01023 mol divided by 0.655 g is mol/g, the inverse.
Common mistake: Misusing the molar volume. The molar volume is the volume of 1 mol, so it multiplies moles, not grams. In Worked Example 2, 12.8 g times 22.414 L/mol gives 287 L, and dividing 0.2908 mol by 22.414 gives 0.0130 L. Convert the mass to moles first, then multiply: each mole occupies 22.414 L.
Common mistake: Turning the density formula upside down. In Worked Example 3, gives 0.370, which has the units L/g, not g/L. Density has and on top.
Common mistake: Using 22.414 L/mol away from STP. In Worked Example 3, dividing 39.95 g/mol by 22.414 L/mol gives 1.78 g/L, the density at STP, not at 1.75 atm and 42.0 °C. The molar volume shortcut holds only at STP.
Key Takeaway
The ideal gas law links the pressure, volume, temperature and amount of a gas. Use in K, in L, and the that matches your pressure unit. At STP (273.15 K and 1 atm) one mole occupies 22.414 L. The density of a gas is , and a molar mass is the mass divided by the moles found from .
Practice: randomized problems
Each problem below uses fresh numbers every time and mixes every kind of problem in this lesson: work it out, check your answer, then open the worked solution to compare your steps.
Loading the practice problem…
Your results
This summary collects every practice problem you try on this page and suggests what to review next.
Loading your results…
Figures and simulator: original work by Dr. Ray’s Learning Center, licensed CC BY 4.0. Data: Whitten, Davis, Peck and Stanley, Chemistry, 9th ed. (Brooks/Cole, Cengage Learning, 2010), Section 12-3 (pp. 403 to 405) for pressure and its units; Section 12-6 (p. 411) for standard temperature and pressure; Section 12-8 (pp. 413 to 414) for the standard molar volume; Sections 12-9 and 12-10 (pp. 414 to 419) for the ideal gas law, gas density and molar mass. Gas constant: R = NAk from the 2019 SI defining constants (CODATA 2022, NIST). Molar masses: IUPAC 2021 standard atomic weights (CIAAW). The simulator and the practice problems are audited; see the lesson audit log.