Skip to content
Physics

Ideal Gas Density Calculator

Enter the pressure, temperature, and molar mass of a gas to calculate its density using the ideal gas law. Select from 15 built-in gas presets or enter any custom molar mass. Switch pressure units between Pa, kPa, bar, atm, and psi. Switch temperature between Kelvin, Celsius, and Fahrenheit. The density output can be shown in kg/m3, g/L, g/cm3, or lb/ft3. The step panel shows every stage of the math with your actual numbers.

Your details

Choose a preset gas to auto-fill the molar mass, or select "Custom gas" to enter any value.
The molar mass of the gas in grams per mole. Auto-filled when a preset is selected.
g/mol
Select the unit for the pressure input.
The absolute (total) pressure of the gas. Use gauge pressure + atmospheric pressure for gauge readings.
atm
Select the unit for the temperature input.
The absolute temperature of the gas. Temperatures at or below absolute zero are invalid.
C
Choose the unit for the calculated density.
Gas densityNear air density
1.225

Mass per unit volume of the gas at the given conditions

Density unitkg/m3
Specific gas constant (Rs)287.04J/(kg*K)
Pressure (Pa)101,325Pa
Temperature (K)288.15K
1.225 kg/m3
Very light<0.5Lighter than air0.5-1Near air density1-1.5Heavier than air1.5-3Dense gas3+
00.791.58-50175400
Temperature (C)

Density: 1.2250 kg/m3

  • At these conditions, Air (dry) has a density of 1.2250 kg/m3.
  • This gas has almost exactly the same density as dry air at the same conditions.
  • The specific gas constant for this gas is 287.0 J/(kg*K), which scales pressure and temperature directly to density via rho = P / (Rs * T).
  • Density rises linearly with pressure and falls with increasing temperature at constant pressure, following the ideal gas law.

Next stepThe ideal gas law is accurate above about -50 C and below roughly 10 MPa for most common gases. Near the critical point or at very high pressures, use a real-gas equation of state such as van der Waals or Peng-Robinson instead.

Formula

ρ=PMRˉT=PRsT,Rs=RˉM,Rˉ=8.31446  J/(mol K)\rho = \dfrac{PM}{\bar{R}T} = \dfrac{P}{R_s T}, \quad R_s = \dfrac{\bar{R}}{M}, \quad \bar{R} = 8.31446 \; \text{J/(mol K)}

Worked example

Dry air at 1 atm (101325 Pa) and 15 C (288.15 K): M = 28.966 g/mol = 0.028966 kg/mol. rho = 101325 * 0.028966 / (8.31446 * 288.15) = 2935.5 / 2395.5 = 1.225 kg/m3. The specific gas constant is Rs = 8.31446 / 0.028966 = 287.1 J/(kg*K).

What is ideal gas density and how is it calculated?

The density of an ideal gas is the mass of the gas per unit volume at a given pressure and temperature. It is derived directly from the ideal gas law PV = nRT. Rearranging: n/V = P/(R_bar * T), and because mass = n * M (molar mass), density equals rho = P * M / (R_bar * T). Here P is absolute pressure in Pascals, M is molar mass in kg/mol, R_bar is the universal gas constant (8.31446 J/(mol*K)), and T is absolute temperature in Kelvin. Density increases when pressure rises and decreases when temperature rises, which explains why hot air rises and compressed gas is heavier than the same gas at ambient pressure.

Specific gas constant and the alternative density formula

Every gas has a specific gas constant Rs defined as Rs = R_bar / M. For dry air, Rs = 8.31446 / 0.028966 = 287.1 J/(kg*K). The density formula then simplifies to rho = P / (Rs * T), which is particularly convenient in engineering because Rs is tabulated for common gases and eliminates the need to work with molar masses. This calculator outputs Rs alongside the density so you can verify the alternative form. Both formulas give identical results; the choice depends on which constants are most readily available for your gas.

Unit conversions and when to use each pressure unit

This calculator accepts pressure in Pa, kPa, MPa, bar, atm, psi, and mmHg, and temperature in Kelvin, Celsius, and Fahrenheit. Standard atmospheric pressure is 101325 Pa, 101.325 kPa, 1.01325 bar, 1 atm, 14.696 psi, or 760 mmHg. Engineering applications in the oil and gas industry typically use bar or psi; academic work in chemistry uses atm or Pa; meteorology uses Pa or hPa (= mbar). Always use absolute pressure in the formula, not gauge pressure. Gauge pressure (what a tire gauge reads) is pressure above atmospheric, so add 101325 Pa to convert to absolute before entering it here.

When does the ideal gas law break down?

The ideal gas law assumes gas molecules have no volume of their own and exert no intermolecular forces. These assumptions hold well at low pressures (below about 1-2 MPa for most gases) and high temperatures (well above the boiling point). Near the critical point, at very high pressures, or at temperatures close to the dew point, real-gas behavior diverges noticeably from ideal. Steam near saturation, CO2 near its critical point (31 C, 7.4 MPa), and heavy hydrocarbons at pipeline pressures are common cases where a real-gas equation of state (van der Waals, Peng-Robinson, or NIST REFPROP data) should be used instead.

Gas densities at standard conditions (0 C, 1 atm)

GasFormulaMolar mass (g/mol)Density at STP (kg/m3)
HydrogenH22.0160.0899
HeliumHe4.0030.1786
MethaneCH416.0430.7158
SteamH2O18.0150.8040
NeonNe20.1800.9002
NitrogenN228.0141.2496
Air (dry)N2/O228.9661.2923
Carbon monoxideCO28.0101.2494
EthyleneC2H428.0541.2514
OxygenO231.9981.4277
ArgonAr39.9481.7824
Carbon dioxideCO244.0101.9635
PropaneC3H844.0971.9674
ButaneC4H1058.1222.5934

Ideal-gas densities for common gases at standard temperature and pressure (STP: 0 C, 101325 Pa). Values calculated using rho = PM / (R_bar * T).

Frequently asked questions

What is the density of air at room temperature and pressure?

Dry air at 20 C (293.15 K) and 1 atm (101325 Pa) has a density of about 1.204 kg/m3 (or g/L). At 15 C it is about 1.225 kg/m3, and at 0 C it is about 1.293 kg/m3. Humidity reduces density slightly because water vapor (M = 18 g/mol) is lighter than dry air (M = 28.97 g/mol).

Why does density decrease as temperature increases?

At constant pressure, adding heat causes gas molecules to move faster and collide with the container walls more forcefully, so the volume expands. If the volume is allowed to expand (like in the atmosphere), the same number of molecules now occupies more space, making density lower. The relationship is inversely proportional: doubling absolute temperature at constant pressure halves the density.

How do I convert from gauge pressure to absolute pressure?

Gauge pressure is measured relative to atmospheric pressure. Absolute pressure = gauge pressure + atmospheric pressure. At sea level, atmospheric pressure is approximately 101.325 kPa, 14.696 psi, or 1 atm. For example, a tire inflated to 32 psi gauge has an absolute pressure of 32 + 14.696 = 46.7 psi. Always enter absolute pressure in the ideal gas density formula.

What is the difference between density and specific gravity for gases?

Density is mass per unit volume (kg/m3 or g/L). Specific gravity for gases is the ratio of the gas density to the density of dry air at the same temperature and pressure, making it dimensionless. A specific gravity below 1 means the gas is lighter than air and will rise; above 1 it sinks. For example, methane has a specific gravity of about 0.554 (it rises) while propane is about 1.52 (it sinks and can pool in low areas).

Can I use this calculator for mixtures of gases?

Yes, for ideal gas mixtures use the mixture molar mass, which is the mole-fraction-weighted average of the component molar masses. For example, dry air is approximately 78.09% nitrogen (28.014 g/mol), 20.95% oxygen (31.998 g/mol), and 0.93% argon (39.948 g/mol), giving a mixture molar mass of about 28.966 g/mol. Enter that mixture molar mass in the custom gas field to calculate the mixture density.

Why is 8.31446 J/(mol*K) used as the gas constant?

The universal gas constant R_bar = 8.31446261815324 J/(mol*K) was fixed exactly in the 2019 revision of the SI. It relates the macroscopic properties of an ideal gas (pressure, volume, temperature, amount in moles) in the equation PV = nRT. In different unit systems it appears as 0.0831446 L*bar/(mol*K) or 1.98722 cal/(mol*K), but this calculator always converts inputs to SI units first to avoid unit errors.

Sources

Written by Dr. Tomás Okafor, PhD Physicist · Lagos, Nigeria

Physicist specializing in classical mechanics, bringing 17 years of research and applied dynamics expertise to every calculator he reviews.

Search 3,500+ calculators

Loading search…