Gas Density Calculator
Find gas density from the ideal gas law.
Results update as you type.
How it works
The density of a gas depends on its pressure, temperature, and molar mass, and this calculator finds it using the ideal gas law. You enter the pressure in atmospheres, the molar mass of the gas, and the absolute temperature in kelvin, and it returns the density in grams per liter. The formula comes from rearranging the ideal gas law: density equals pressure times molar mass divided by the gas constant times temperature. Unlike solids and liquids, gas density is highly variable because gases are compressible — squeezing a gas into less volume or cooling it makes it denser, while heating or reducing pressure makes it less dense. Heavier gases (larger molar mass) are denser than lighter ones at the same conditions, which is why carbon dioxide sinks and helium rises in air. This calculation is useful in chemistry and engineering for determining buoyancy, designing ventilation, working with gas mixtures, and identifying unknown gases from their measured density. It assumes ideal-gas behavior, which is accurate for most gases at ordinary temperatures and pressures but less so at very high pressure or very low temperature. Use the molar mass of your gas and consistent units. Enter the pressure, molar mass, and temperature to find the gas density.
ρ = (P × M) ÷ (R × T)
Rearranging the ideal gas law gives density as pressure times molar mass divided by the gas constant times absolute temperature. Using pressure in atmospheres and the gas constant 0.08206 L·atm/(mol·K) with molar mass in grams per mole yields density in grams per liter. Higher pressure or heavier molecules increase density; higher temperature lowers it.
Source:Ideal gas law
We review all our tools from time to time to ensure accuracy.
Worked example
How to use this calculator
- 1
Enter your values
Enter pressure, molar mass and temperature.
- 2
Adjust the options
Fine-tune any options to match your situation.
- 3
Read your result
Gas density updates instantly as you type — no button to press.
Frequently asked questions
How do you calculate gas density?
Use the rearranged ideal gas law: density equals pressure times molar mass divided by the gas constant times absolute temperature. With pressure in atmospheres, molar mass in grams per mole, and the constant 0.08206, the result is grams per liter. For oxygen at standard temperature and pressure, this gives about 1.43 grams per liter.
Why does gas density change so much?
Gases are compressible, so their density depends strongly on pressure and temperature. Increasing pressure or lowering temperature packs molecules closer, raising density, while heating or reducing pressure spreads them out, lowering it. This is very different from solids and liquids, whose densities barely change, and it is why gas density must always be stated with its conditions.
Why do some gases rise and others sink in air?
At the same temperature and pressure, a gas with a larger molar mass is denser than air and sinks, while a gas with a smaller molar mass is less dense and rises. Helium, much lighter than air, floats, while carbon dioxide, heavier than air, pools in low areas. Molar mass is the deciding factor at equal conditions.
What is standard temperature and pressure?
Standard temperature and pressure (STP) is a common reference condition, often defined as 0 degrees Celsius (273.15 kelvin) and 1 atmosphere. At STP, one mole of an ideal gas occupies about 22.4 liters. Using STP lets chemists compare gas properties consistently, and this calculator reproduces the familiar STP densities when you enter those values.
Is the ideal gas assumption accurate?
The ideal gas law works well for most gases at ordinary temperatures and moderate pressures, giving densities within a small margin of reality. It becomes less accurate at very high pressures or very low temperatures, where molecular interactions and finite molecular size matter, and real-gas equations like van der Waals give better results. For everyday conditions, the ideal approximation is reliable.