Calculate gas density from molecular weight (molar mass) at STP or your own pressure and temperature, or work back from density to molar mass.
- All Chemistry Calculators
- Gas Density Calculator
- Molar Volume Calculator
- Density to Molar Mass Calculator
- G-mol to Density Calculator
- Specific Gravity to Density Calculator
Calculator Functions
| Function | What it does | What it requires |
|---|---|---|
| Gas density | Finds the density of a gas from its molecular weight at a set pressure and temperature | Requires the molar mass, the absolute gas pressure, the gas temperature and a result density unit |
| Molar mass | Finds the molecular weight of a gas from its measured density | Requires the gas density, the absolute gas pressure, the gas temperature and a result molar mass unit |
| Absolute gas pressure | Finds the pressure at which a gas has a given density | Requires the gas density, the molar mass, the gas temperature and a result pressure unit |
| Gas temperature | Finds the temperature at which a gas has a given density | Requires the gas density, the molar mass, the absolute gas pressure and a result temperature unit |
Pressure starts at 1 atm and temperature at 0 °C, which is standard temperature and pressure (STP). Molar mass goes in as g/mol or kg/mol, density as kg/m³, g/L, g/m³ or lb/ft³, pressure as atm, Pa, kPa, bar, psi or mmHg, and temperature as °C, K or °F. An optional compressibility factor Z, 1 unless changed, adjusts the result for a real gas. Every function also reports the molar density, the number density, the specific gravity against air and the vapour density against hydrogen.
Molecular Weight to Density Formulas
| ρ | Gas density (kg/m³) |
| P | Absolute pressure (Pa) |
| M | Molar mass, the molecular weight in kg/mol |
| Z | Compressibility factor, 1 for an ideal gas |
| R | Molar gas constant, 8.314462618 J/(mol·K) [2] |
| T | Absolute temperature (K) |
This is the ideal gas law written with density. The gas constant for one particular gas is the universal constant divided by the gas's mass per mole, which turns P × V = n × R × T into P = ρ × (R ÷ M) × T [1]. Molecular weight sets the density of a gas only. The density of a liquid or a solid cannot be found from its molecular weight, because it depends on how tightly the molecules pack.
Gas density
The main formula applies directly. Nitrogen, at 28.01 g/mol, at 1 atm and 0 °C has a density of 101,325 × 0.02801 ÷ (8.314462618 × 273.15) = 1.2497 kg/m³, which is also 1.2497 g/L. At the same pressure and temperature, density rises in direct proportion to molecular weight.
Molar mass
A gas with a density of 1.964 kg/m³ at 1 atm and 0 °C has a molar mass of 1.964 × 8.314462618 × 273.15 ÷ 101,325 = 0.04402 kg/mol, or 44.02 g/mol, close to carbon dioxide.
Absolute gas pressure
The result is absolute pressure, not gauge pressure. Carbon dioxide, at 44.01 g/mol, with a density of 1.977 kg/m³ at 25 °C is at 1.977 × 8.314462618 × 298.15 ÷ 0.04401 = 111,359 Pa, or 1.099 atm.
Gas temperature
The formula gives kelvin, and the calculator converts to °C or °F. Air, taken as 28.97 g/mol, has a density of 1.2 kg/m³ at 1 atm when its temperature is 101,325 × 0.02897 ÷ (1.2 × 8.314462618) = 294.2 K, or 21.05 °C.
Other outputs
This is the molar density in mol/m³. Multiplying it by the Avogadro constant, 6.02214076 × 10²³ per mole [3], gives the number of molecules per cubic metre. Specific gravity is the molar mass divided by 28.9647 g/mol, the value used for air, and vapour density is the molar mass divided by 2.016 g/mol for hydrogen. Both compare gases at the same temperature and pressure.
Limits of This Estimate
- The equation applies to an ideal gas, or a real gas that behaves like one [1]. At high pressure or near the point where the gas condenses, the result with Z = 1 drifts from the measured density.
- The calculator does not predict Z or check that the substance is still a gas at the stated conditions. A Z value has to come from data for the same gas, pressure and temperature.
- The Z correction and the molar masses used for air and hydrogen are general reference values. These estimates are based on the best available data and estimations.
- A gas mixture needs its average molar mass, and gauge pressure has to be converted to absolute pressure first.
Sources
- NASA Glenn Research Center, Equation of State: ideal gas law with density, the gas constant divided by mass per mole, and where the law applies
- NIST, CODATA Value: molar gas constant: value of R
- NIST, CODATA Value: Avogadro constant: value used for number density
