---
slug: gas-density-calculator
title: "Gas Density Calculator"
category: scientific
updated: 2026-11-18
canonical: https://calcseed.com/c/scientific/gas-density-calculator/
html: /c/scientific/gas-density-calculator/
---

# Gas Density Calculator

Calculate the density of an ideal gas from its pressure, molar mass and temperature.

## Quick answer

**Quick answer:** with the default inputs (1 atm, 28.97 g/mol, 293.15 K), the gas density is **1.2**. Change any input to update the result.

## Default calculation

Values computed by this calculator at exactly the default inputs listed below.

### Inputs (defaults)

| Input | Value | Unit |
| --- | --- | --- |
| Pressure | 1 | atm |
| Molar mass | 28.97 | g/mol |
| Temperature | 293.15 | K |

### Outputs at these defaults

| Output | Value | Unit |
| --- | --- | --- |
| Gas density | 1.20369 |  |

## Formula

```text
&rho; = PM ÷ (RT)
```

## Inputs

| Variable | Type | Unit | Default |
| --- | --- | --- | --- |
| Pressure | number | atm | 1 |
| Molar mass | number | g/mol | 28.97 |
| Temperature | number | K | 293.15 |

## Outputs

| Result | Format |
| --- | --- |
| Gas density | primary |
| Gas density | number |

## How it works

### What this calculator returns

The output is gas density in grams per litre. At the defaults — 1 atm, a molar mass of 28.97 g/mol and 293.15 K — it returns 1.2 g/L, which is dry air at roughly 20 &deg;C. Pressure is in atmospheres, molar mass in g/mol and temperature in kelvin.

### Where the formula comes from

Start with the ideal gas law PV = nRT and replace n with mass ÷ molar mass. Rearranging gives density = PM ÷ RT: mass per volume is pressure times molar mass over the gas constant times temperature. Every term has a physical meaning, so the formula is easy to sanity-check.

R must match the pressure and volume units. With P in atm and density wanted in g/L, use R = 0.0821 L&middot;atm/(mol&middot;K). Using 8.314 J/(mol&middot;K) instead is the single most common way to get an answer that is wrong by a factor of about 101.

Temperature has to be absolute. Entering 20 instead of 293.15 gives a density of 17.6 g/L, more than fourteen times too high, because the formula divides by T and a near-zero denominator dominates everything else.

### Worked example at the defaults

With P = 1 atm, M = 28.97 g/mol and T = 293.15 K: R × T = 0.0821 × 293.15 = 24.068, so &rho; = 28.97 ÷ 24.068 = 1.2037 g/L. The calculator rounds that to 1.2, the familiar figure for air at room temperature.

Cool the same air to 273.15 K and the denominator drops to 22.426, so density rises to 1.29 g/L — a 7% increase from a 20 &deg;C drop. Heat it to 373.15 K and density falls to 0.95 g/L. The relationship is inverse in temperature, so halving T doubles density at constant pressure.

### Density of common gases at 1 atm, 293 K

| Gas | Molar mass (g/mol) | Density (g/L) |
| --- | --- | --- |
| Helium | 4.00 | 0.17 |
| Methane | 16.04 | 0.67 |
| Nitrogen | 28.01 | 1.16 |
| Air | 28.97 | 1.20 |
| Oxygen | 32.00 | 1.33 |
| Carbon dioxide | 44.01 | 1.83 |

#### Reading the table

Density is almost proportional to molar mass at fixed temperature and pressure. Carbon dioxide at 44.01 g/mol is 1.5 times as dense as air at 28.97, which is why it pools in low spaces, while helium at 4.00 is about seven times lighter and rises out of an open balloon in seconds.

#### Molar volume as a cross-check

One mole of any ideal gas fills 22.41 L at 1 atm and 273.15 K, and 24.07 L at 293.15 K. Divide molar mass by that volume and you reproduce the table in one step: 28.97 ÷ 24.07 = 1.20 g/L for air, and 28.97 ÷ 22.41 = 1.29 g/L at the lower temperature.

### What moves the density

- Pressure: linear, so doubling from 1 to 2 atm doubles 1.20 to 2.41 g/L.
- Temperature: inverse, so cooling from 293 K to 273 K raises 1.20 to 1.29 g/L.
- Molar mass: linear, so switching air for carbon dioxide raises 1.20 to 1.83 g/L.
- Humidity: water vapour at 18 g/mol is lighter than air, so moist air is slightly less dense than dry air.
- Gas constant: must be 0.0821 for atm and litres; 8.314 shifts every answer by a factor of 101.

### When the ideal model breaks

The formula assumes molecules occupy no volume and do not attract each other. At 1 atm and room temperature that is good to about 0.1% for air, but at 100 atm the same gas is roughly 3% denser than predicted. Near a boiling point, where attractions dominate, the error grows far faster.

For engineering work at high pressure, apply a compressibility factor Z: &rho; = PM ÷ (ZRT). Air at 200 atm and 300 K has Z ≈ 1.03, so the ideal answer is only 3% off, while carbon dioxide under the same conditions sits near Z = 0.85 and is 18% denser than the formula suggests.

- Air at 1 atm and 293 K: 1.20 g/L; at 2 atm: 2.41 g/L.
- Air at 100 atm: about 3% denser than the ideal prediction.
- Nitrogen near its 77 K boiling point: the ideal formula is no longer reliable.

### Mistakes that produce nonsense

Mixing units is the biggest source of error. Density in g/L needs P in atm, M in g/mol and T in kelvin. Switch M to kg/mol without switching the constant and you get 0.0012 g/L, which looks like a plausible vacuum rather than a mistake.

The second is using the mixture molar mass incorrectly. Air is not a single gas; its 28.97 g/mol is the mole-weighted average of 78% nitrogen, 21% oxygen and 1% argon. Treating air as pure nitrogen gives 1.16 g/L instead of 1.20, a small but real 3% gap.

The third is applying the answer to a liquid. A gas at 1 atm is about a thousand times less dense than the same substance as a liquid, so a 1.2 g/L result tells you nothing about how much mass fits in a tank once the gas liquefies.

### Where the number earns its keep

Balloon lift is just the difference between the surrounding air and the gas inside. A cubic metre of helium at 1.20 − 0.17 = 1.03 g/L of net lift carries about 1 kg, which is why a 1 m balloon lifts a small payload and a 3 m one lifts a person plus the envelope.

## FAQ

### What is the formula for gas density?

For an ideal gas, &rho; = PM ÷ (RT). At 1 atm, 28.97 g/mol and 293.15 K, that is 28.97 ÷ (0.0821 × 293.15) = 1.2 g/L.

### Why does gas density fall with temperature?

Heating at constant pressure makes the gas expand, so the same mass fills a larger volume. Air at 1.20 g/L at 293 K drops to 0.95 g/L at 373 K.

### What is the density of air?

About 1.20 g/L at 1 atm and 20 &deg;C (293 K), and 1.29 g/L at 0 &deg;C. The default molar mass of 28.97 g/mol reproduces both.

### Which R value should I use?

0.0821 L&middot;atm/(mol&middot;K) when pressure is in atm and density in g/L. Using 8.314 J/(mol&middot;K) with atmospheres makes the answer about 101 times too small.

### Is carbon dioxide heavier than air?

Yes. At 44.01 g/mol it is 1.83 g/L against 1.20 g/L for air, about 1.5 times as dense, which is why it settles in basements and low-lying areas.

### How much does pressure change density?

Directly. Doubling pressure from 1 to 2 atm doubles 1.20 g/L to 2.41 g/L at the same temperature.

### Why is my answer 17.6 g/L?

You almost certainly entered 20 instead of 293.15 for temperature. The formula divides by absolute temperature, so Celsius values near zero blow the result up by more than a factor of ten.

### Does humidity raise or lower air density?

It lowers it slightly. Water vapour has a molar mass of 18 g/mol against 28.97 for dry air, so replacing air molecules with water molecules reduces the average mass per litre.

### When is the ideal gas formula not accurate enough?

Above roughly 10 atm or near a boiling point. At 100 atm, air is about 3% denser than the ideal prediction, and a compressibility factor Z is needed to correct it.

## Method and sources

Methodology: Physical constants follow CODATA 2022 recommended values, and formulas follow standard physics definitions.

Last updated: 2026-11-18.
- Ideal gas density ρ = PM/(RT); R = 0.0821 L·atm/(mol·K).
