molecalculator

Moles & Molar Mass

Gas Density Calculator: Calculate Density from Pressure

Calculator No. 01-1724 · Updated · Formula and assumptions shown below

Gas density 1.1450 kg/m^3
Gas density
1.1450 g/L
= Gas density
Molar mass
28.0134 g/mol
Set in the form below
Absolute pressure
101.325 kPa
Set in the form below
You enter
Molar mass (g/mol), Absolute pressure (kPa), Temperature (°C)
You get
Gas density (kg/m^3), Gas density (g/L)
Rounding
4 dp

For study and lab planning. The result follows from the numbers you enter and the formula shown. Check it against your method before you weigh, mix or dilute anything, follow the safety data sheet and your supervisor, and do not use it for clinical, dosing or medication work.

Gas density is mass per unit volume, usually reported in kilograms per cubic metre (kg/m³) or grams per litre (g/L). This calculator estimates the density of an ideal gas from its molar mass, pressure, and temperature; enter those values to get density and a converted result in g/L.

Formula

For an ideal gas, density is calculated as ρ = PM/(RT). Here, ρ is gas density in kg/m³, P is absolute pressure in pascals (Pa), M is molar mass in kg/mol, R is the ideal gas constant, 8.31446261815324 J/(mol·K), and T is absolute temperature in kelvins (K).

The calculator accepts pressure in kPa, molar mass in g/mol, and temperature in °C. It converts pressure using 1 kPa = 1,000 Pa, molar mass using 1 g/mol = 0.001 kg/mol, and temperature using T in K = temperature in °C + 273.15. Its second result has the same numerical value in g/L as the first result in kg/m³, because 1 kg/m³ = 1 g/L.

Worked Example

Using the defaults—nitrogen molar mass 28.0134 g/mol, pressure 101.325 kPa, and temperature 25 °C:

  1. Convert pressure: 101.325 kPa × 1,000 Pa/kPa = 101,325 Pa.
  2. Convert molar mass: 28.0134 g/mol × 0.001 kg/g = 0.0280134 kg/mol.
  3. Convert temperature: 25 °C + 273.15 = 298.15 K.
  4. Substitute: ρ = (101,325 Pa × 0.0280134 kg/mol) / (8.31446261815324 J/(mol·K) × 298.15 K) ≈ 1.1451 kg/m³.

The result is 1.1451 kg/m³, or 1.1451 g/L, at the stated conditions. The displayed figures are rounded; extra digits do not imply that real gas behavior or input measurements are exact.

Assumptions

  • The calculation treats the gas as ideal and uses the ideal gas equation.
  • Pressure is absolute pressure, not gauge pressure.
  • Temperature is converted to kelvins; values below absolute zero are rejected.
  • The entered molar mass represents the gas whose density is sought. For a mixture, use its average molar mass.
  • The pressure and temperature describe the same gas state and are uniform enough for a single density estimate.

What Gas Density Means

Density tells you how much mass occupies a given volume. It is not a fixed property of a gas independent of conditions: unlike the density of many solids and liquids under ordinary conditions, gas density changes noticeably when pressure or temperature changes. Compressing a gas into the same volume increases its density; heating it at constant pressure generally lowers its density as it expands.

Molar mass is also important. At identical pressure and temperature, a gas with a larger average molar mass is denser than one with a smaller molar mass. For example, nitrogen has a molar mass of about 28.0134 g/mol, while helium is about 4.0026 g/mol. The ideal-gas equation predicts nitrogen to be about seven times as dense as helium under the same conditions, because their molar masses have roughly that ratio.

Density units can look unfamiliar because both mass and volume units vary. A value of 1 kg/m³ is exactly 1 g/L, while 1 g/m³ equals 0.001 g/L. Always check both the units and the temperature and pressure attached to a reported density.

How to Choose Inputs

  • Molar mass: Use the molecular or formula mass in g/mol. For a pure gas, obtain it from the chemical formula and standard atomic weights. For a mixture, use the mole-fraction-weighted average molar mass, if the composition is known.
  • Pressure: Enter absolute pressure. Atmospheric pressure near sea level is commonly around 101.325 kPa, but local weather and altitude change it. A gauge reading is relative to surrounding pressure; add local atmospheric pressure before using it.
  • Temperature: Enter the gas temperature in °C, not the temperature of a nearby surface or room unless the gas has reached that temperature. The equation uses kelvins internally.
  • State conditions: Use pressure and temperature from the same conditions as the density you want. A density measured at one pressure cannot be compared fairly with another without accounting for the different conditions.

For a mixture of gases, average molar mass is calculated as Σ(xᵢMᵢ), where xᵢ is each component’s mole fraction and Mᵢ its molar mass. Mole fractions add to 1. If composition is given by mass fractions instead, it cannot be substituted directly into that average; convert the composition appropriately first.

Ideal Gas Limits and Common Errors

The ideal-gas model is a useful approximation when gas molecules are sufficiently far apart and intermolecular effects are small. At ordinary pressures and temperatures well above condensation conditions, it often gives a practical estimate. At high pressure, low temperature, or near a phase change, real-gas behavior can make the estimate inaccurate. A real-gas compressibility factor, Z, can account for departures when reliable substance-specific data are available: ρ = PM/(ZRT). This calculator assumes Z = 1 and does not determine it.

Common mistakes include entering gauge pressure as if it were absolute, using Celsius directly in the formula, and mixing g/mol with a calculation that expects kg/mol. The displayed formula handles the unit conversions, but the input units still matter. Another error is using the molar mass of one component for a gas mixture or treating density as an unchanging reference value without its conditions.

Density is not the same as specific gravity. Specific gravity is a ratio of a substance’s density to a reference density, so it has no units and must state its reference conditions. Nor is gas density the same as concentration in every context: concentration may refer to amount of substance per volume (such as mol/m³), whereas density here means mass per volume.

Frequently Asked Questions

What is the density of a gas at standard conditions?
There is no single value for all gases. It depends on the gas’s molar mass and on the exact temperature and pressure meant by “standard conditions,” which vary by convention. State those conditions when giving a density.

How do you calculate gas density from pressure and temperature?
For an ideal gas, use ρ = PM/(RT), with absolute pressure in Pa, molar mass in kg/mol, and temperature in K. The calculator converts its inputs to those units before evaluating the equation.

Is gas density in kg/m³ the same as g/L?
Yes. The units are exactly equivalent: 1 kg/m³ = 1 g/L. Other mass or volume units require their own conversion factors.

Should I use gauge pressure or absolute pressure?
Use absolute pressure. Gauge pressure is measured relative to the surrounding atmosphere, so convert it by adding the local atmospheric pressure. A gauge value of zero, for example, does not mean a vacuum.

Does heating a gas always lower its density?
At constant pressure, heating an ideal gas lowers its density. If the gas is held in a fixed volume instead, its density stays constant while its pressure rises. The effect depends on which conditions are kept fixed.

Related

Formula used
in mm | Molar mass | g/mol | 28.0134 | 0
in p | Absolute pressure | kPa | 101.325 | 0
in t | Temperature | °C | 25 | -273.15
out d | Gas density | kg/m^3 | (p * 1000) * (mm / 1000) / (8.31446261815324 * (t + 273.15)) | 4
out dg | Gas density | g/L | d | 4

Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work

Method: the standard formula for this calculation with the constants and conversion factors written on the page, rounded as each result states. See method and constants, the disclaimer or report an error.

More in this section

The whole Moles & Molar Mass section →