Gas Density Calculator

Calculate density, molar mass, pressure, or temperature using D = PM/RT

Gas Density Calculator

STP: 273.15 K | Room temp: ~298 K

Gas Density Formula

From the ideal gas law PV = nRT, substituting n = m/M and rearranging for density (D = m/V):

D = PM/RT

D = density (g/L)

P = pressure (atm)

M = molar mass (g/mol)

R = 0.0821 L·atm/(mol·K)

T = temperature (K)

Applications: This formula is commonly used to determine the molar mass of an unknown gas from experimental density measurements, or to predict gas densities under different conditions. At STP (1 atm, 273.15 K), one mole of any ideal gas occupies 22.4 L.

What is Gas Density?

Gas density is the mass of gas per unit volume, typically expressed in grams per liter (g/L). Unlike solids and liquids, gas density is highly dependent on temperature and pressure because gases are compressible and expand to fill their containers.

Key properties of gas density:

  • Pressure-dependent: Higher pressure increases density (more molecules in same volume)
  • Temperature-dependent: Higher temperature decreases density (molecules spread out)
  • Mass-dependent: Gases with higher molar mass have higher density at same P and T
  • Compressible: Unlike liquids/solids, gas density can vary dramatically with conditions

Standard Conditions:

STP (Standard Temperature and Pressure): 0°C (273.15 K) and 1 atm
SATP (Standard Ambient Temperature and Pressure): 25°C (298.15 K) and 1 bar (~1 atm)
Molar Volume at STP: 22.4 L/mol for any ideal gas

Deriving the Gas Density Formula

The gas density formula comes from the ideal gas law and the definition of density:

Step 1: Start with the Ideal Gas Law

PV = nRT

Where n = number of moles, R = gas constant

Step 2: Express Moles in Terms of Mass

n = m/M

Where m = mass (g), M = molar mass (g/mol)

Step 3: Substitute into Ideal Gas Law

PV = (m/M)RT

Step 4: Rearrange to Isolate m/V

m/V = PM/RT

Multiply both sides by M/R, divide both sides by T

Step 5: Recognize m/V as Density

D = PM/RT

Where D = density (g/L)

Key Insight:

This formula shows that gas density is directly proportional to pressure and molar mass, but inversely proportional to temperature. Doubling the pressure doubles the density; doubling the temperature halves the density (at constant P).

Worked Example: Identifying an Unknown Gas

Problem:

An unknown gas has a density of 1.25 g/L at 25°C and 1.00 atm. What is the molar mass of this gas? Can you identify it?

Given:

  • D = 1.25 g/L
  • T = 25°C = 298.15 K
  • P = 1.00 atm
  • R = 0.0821 L·atm/(mol·K)

Solution:

Step 1: Write the formula for molar mass

M = DRT/P

(Rearranged from D = PM/RT)

Step 2: Substitute known values

M = (1.25 g/L × 0.0821 L·atm/(mol·K) × 298.15 K) / 1.00 atm

Step 3: Calculate

M = (30.58) / 1.00

M = 30.58 g/mol

Step 4: Identify the gas

A molar mass of approximately 30.6 g/mol is close to NO (nitric oxide), which has M = 30.01 g/mol, or possibly a mixture of gases.

Answer:

The molar mass is 30.58 g/mol, suggesting the unknown gas is likely NO (nitric oxide) or a mixture containing NO.

Real-World Applications

1. Gas Identification

Measuring the density of an unknown gas allows chemists to determine its molar mass and identify it. This is especially useful in industrial settings where gas mixtures need to be analyzed or when identifying products of chemical reactions.

2. Hot Air Balloons

Hot air balloons work because heated air has lower density than cool air. At higher temperatures, the same mass of air occupies more volume (D = PM/RT), creating buoyancy. Pilots control altitude by adjusting air temperature.

3. Air Quality Monitoring

Environmental scientists use gas density measurements to determine concentrations of pollutants. Different gases have different densities, affecting how they disperse in the atmosphere. Heavier gases tend to settle, while lighter ones rise.

4. Scuba Diving

As divers descend, increased pressure compresses breathing gases, increasing their density. This affects breathing resistance and gas consumption rates. Understanding gas density helps calculate air supply requirements at depth.

5. Chemical Manufacturing

In industrial processes, gas density calculations are crucial for designing storage tanks, pipelines, and reaction vessels. Knowing how density changes with temperature and pressure ensures safe and efficient operations.

6. Aviation and Meteorology

Air density affects aircraft lift and engine performance. Pilots must account for temperature and pressure (altitude) when calculating takeoff distances and climb rates. Weather forecasting also relies on air density variations.

Gas Densities at STP

At STP (0°C and 1 atm), the density of any gas can be easily calculated from its molar mass:

DSTP = M / 22.4 L/mol

Since at STP, 1 mole of gas occupies 22.4 L

GasFormulaMolar Mass (g/mol)Density at STP (g/L)
HydrogenH₂2.0160.090
HeliumHe4.0030.179
MethaneCH₄16.040.716
AmmoniaNH₃17.030.760
NitrogenN₂28.011.25
Air (mixture)-28.971.29
OxygenO₂32.001.43
ArgonAr39.951.78
Carbon DioxideCO₂44.011.96
ChlorineCl₂70.903.17

Problem-Solving Strategy

Step 1: Identify What You're Solving For

  • Density (D)? → Need P, M, and T
  • Molar Mass (M)? → Need D, P, and T
  • Pressure (P)? → Need D, M, and T
  • Temperature (T)? → Need D, M, and P

Step 2: Check Units

  • Temperature must be in Kelvin (K = °C + 273.15)
  • Pressure typically in atm (1 atm = 101.325 kPa = 760 mmHg)
  • Density in g/L matches R = 0.0821 L·atm/(mol·K)
  • Molar mass in g/mol

Step 3: Rearrange D = PM/RT

  • For M: M = DRT/P
  • For P: P = DRT/M
  • For T: T = PM/(DR)
  • For D: D = PM/RT

Step 4: Verify Your Answer

  • Does the density make sense? (Most gases: 0.1-3 g/L at STP)
  • Is the molar mass reasonable? (Common gases: 2-100 g/mol)
  • Are pressure and temperature physically realistic?
  • Check significant figures based on given data

Common Mistakes to Avoid

❌ Using Celsius Instead of Kelvin

Temperature MUST be in Kelvin for the gas laws. Using °C will give completely wrong answers.

Correct: Always convert °C to K by adding 273.15

❌ Mismatched Units for R

Using R = 0.0821 requires P in atm, V in L, and T in K. Don't mix with kPa or other units.

Correct: R = 0.0821 L·atm/(mol·K) or R = 8.314 J/(mol·K) with consistent units

❌ Confusing Molar Mass with Mass

M is molar mass (g/mol), not the total mass of gas. Molar mass is a property of the substance.

Correct: Molar mass is from the periodic table (e.g., O₂ = 32.00 g/mol)

❌ Forgetting Diatomic Molecules

H₂, N₂, O₂, F₂, Cl₂, Br₂, I₂ are diatomic. Don't use atomic mass; use molecular mass.

Correct: M(O₂) = 32.00 g/mol, not 16.00 g/mol

Quick Reference Guide

Master Formula

D = PM/RT

Rearrangements:

M = DRT/P

P = DRT/M

T = PM/(DR)

Standard Conditions

STP:

  • T = 273.15 K (0°C)
  • P = 1 atm
  • Molar volume = 22.4 L/mol

Room Conditions:

  • T ≈ 298 K (25°C)
  • P = 1 atm

Gas Constant (R)

R = 0.0821 L·atm/(mol·K)

(Use with P in atm, V in L)

R = 8.314 J/(mol·K)

(Use with P in Pa, V in m³)

Unit Conversions

Temperature:

K = °C + 273.15

Pressure:

1 atm = 101.325 kPa

1 atm = 760 mmHg (torr)