🔬 Gas Density Calculator
Calculate gas density using the ideal gas law rearranged for density: ρ = PM / RT. Enter pressure, molar mass, and temperature to find the density, specific volume, and specific gravity relative to air. Includes presets for 16 common gases.
What Is Gas Density?
Gas density (ρ) is the mass per unit volume of a gas, typically expressed in kg/m³ or g/L. Unlike liquids and solids, gas density varies significantly with pressure and temperature, making it essential to specify the conditions when reporting gas density.
The density of an ideal gas can be derived from the Ideal Gas Law (PV = nRT):
ρ = P · M / (R · T)
where ρ = density (kg/m³), P = absolute pressure (Pa), M = molar mass (kg/mol), R = universal gas constant (8.314 J/(mol·K)), T = absolute temperature (K)
Derivation from the Ideal Gas Law
Starting with PV = nRT and the definition of density (ρ = m/V):
- n = m / M (moles = mass / molar mass)
- PV = (m/M) · RT
- P = (m/V) · (RT/M) = ρ · (RT/M)
- Rearranging: ρ = P · M / (R · T)
Key Factors Affecting Gas Density
- Pressure: Density is directly proportional to pressure. Doubling pressure doubles density.
- Temperature: Density is inversely proportional to absolute temperature. Higher temperature means lower density.
- Molar Mass: Heavier molecules create denser gases at the same P and T conditions.
- Humidity: Humid air is less dense than dry air because water vapor (M = 18 g/mol) is lighter than the average air molecule (M ≈ 29 g/mol).
Why Use This Calculator?
- 16 gas presets: Quickly select common gases with auto-filled molar masses.
- Unit flexibility: Enter pressure in Pa, kPa, bar, atm, or psi; temperature in K, °C, or °F.
- Additional outputs: Get specific volume, specific gravity relative to air, and molar volume.
- Step-by-step solution: See exactly how the calculation is performed.
- Free & private: No registration, no data storage — all calculations are done in your browser.
❓ Gas Density Calculator FAQ
What is the formula for gas density?
The formula is ρ = PM / (RT), where ρ is density, P is absolute pressure, M is molar mass, R is the gas constant, and T is absolute temperature in Kelvin.
Why must temperature be in Kelvin?
Gas density calculations use absolute temperature. Celsius and Fahrenheit are relative scales that start at arbitrary points, so they break the proportional relationship. Always convert to Kelvin (K = °C + 273.15).
What is the density of air at STP?
At standard temperature and pressure (0°C, 101,325 Pa), dry air has a density of approximately 1.293 kg/m³ (1.293 g/L).
Why is humid air less dense than dry air?
Humid air is less dense because water vapor molecules (H₂O, M = 18 g/mol) replace heavier nitrogen (N₂, M = 28 g/mol) and oxygen (O₂, M = 32 g/mol) molecules in the air. Since water molecules are lighter, the average molar mass of the mixture decreases, reducing the overall density.
When does the ideal gas approximation break down?
The ideal gas law becomes inaccurate at high pressures (above about 10 atm), low temperatures (near the boiling point of the gas), or when intermolecular forces become significant. In these cases, real-gas equations of state (van der Waals, Peng-Robinson) should be used.
What is specific gravity of a gas?
Specific gravity (SG) of a gas is the ratio of its density to the density of air at the same temperature and pressure. SG = ρ_gas / ρ_air. A gas with SG > 1 is heavier than air; SG < 1 is lighter.
How accurate is this calculator?
This calculator uses the exact ideal gas law formula ρ = PM/RT. Accuracy depends on the precision of the input values and the validity of the ideal gas approximation at your conditions. You can adjust the decimal precision in the output.
Is this calculator free?
Yes, this calculator is completely free to use. No registration or personal data storage is required.
What is the molar volume of an ideal gas at STP?
At STP (0°C, 101,325 Pa), one mole of any ideal gas occupies 22.414 liters.
Can I use this calculator for gas mixtures?
Yes, but you must use the effective molar mass of the mixture, weighted by mole fraction. For example, dry air has an effective molar mass of approximately 28.97 g/mol.