What is gas density?
Gas density is the mass of a gas in a given volume — usually grams per litre — and it follows directly from the ideal gas law. A heavy gas at the same pressure and temperature is denser than a light one, in exact proportion to its molar mass: carbon dioxide, at 44 grams per mole, is about 1.8 grams per litre at room temperature, while hydrogen, at 2 grams per mole, is about 0.08. That density difference is why carbon dioxide sinks and hydrogen rises.
This calculator works out a gas's density from its pressure, molar mass, and temperature. Type the three numbers and it shows the density in grams per litre and kilograms per cubic metre, and the molar volume alongside. It is the calculation behind balloons, gas separation, and every problem that asks whether a gas rises or sinks.
Everything on this page runs in your browser. Nothing you type is uploaded, stored, or sent to a server, and there is no account to create and no sign-up step. You can use the tool as many times as you like, close the tab, and come back later — your inputs are never saved anywhere.
This site has a full set of related tools, and the links in this article point to the ones people reach for next. They all work the same way — type your numbers, read the answer, nothing uploaded — so once you know one of them, you know all of them. The "More free tools" section at the bottom of the page lists three close neighbours.
How gas density is calculated
The method is the ideal gas law rearranged: density equals pressure times molar mass, divided by the gas constant times the temperature. The gas constant is 0.082057 litre-atmospheres per mole-kelvin, the pressure is in atmospheres, the molar mass in grams per mole, and the temperature in kelvin. One atmosphere times 44.01, divided by 0.082057 times 300.15, is 1.79 grams per litre.
The density in grams per litre and in kilograms per cubic metre are the same number: 1 gram per litre is exactly 1 kilogram per cubic metre, because both units are a thousand grams in a thousand litres. The molar volume is the reciprocal idea — the volume one mole occupies, 24.63 litres at these conditions — and the density is the molar mass divided by that volume.
This tool uses the standard textbook treatment: ideal behaviour, standard constants, and the conditions stated on the page. Real systems drift from that — gases are not perfectly ideal, activity differs from concentration in salty solutions, and measured values carry error. For school and college work the standard treatment is what is asked for; for research work, treat the result as a starting point and check it against measured data.
Before you rely on a result, run a quick sanity check on it. Convert a value you already know — one large egg should come out near 57 grams, one mole of water near 18 grams — and see that the tool agrees. If it does, your inputs are right and the rest of the answers will be too. If it does not, the input is usually the problem, not the tool.
Molar mass: the input that matters
The input people get wrong is the molar mass, because it must be the molar mass of the gas molecule: oxygen gas is O2 at 32, not O at 16, and carbon dioxide is CO2 at 44.01, not CO at 28. Using the atomic mass instead of the molecular mass halves or nearly halves the answer, and the gas comes out far too light.
The second trap is the temperature, as with every gas law: it must be in kelvin, Celsius plus 273.15. The third is the pressure unit — atmospheres here, because the gas constant is quoted in litre-atmospheres. A pressure in kilopascals must be divided by 101.325 first, or the density comes out a hundred times too large.
The one habit that prevents nearly every wrong answer here is checking the units before you trust the result. Grams are not ounces, millilitres are not cups, and a value typed in the wrong unit gives a confident-looking wrong answer. Read the label next to each box, match it to the unit on your recipe or your lab sheet, and only then read the result.
A worked example: carbon dioxide
Take the default example: carbon dioxide at 1 atmosphere, molar mass 44.01, and 27 degrees Celsius, which is 300.15 kelvin. The density is 1 times 44.01 divided by 0.082057 times 300.15, which is 1.79 grams per litre — the same number in kilograms per cubic metre, 1.787. The molar volume is 24.63 litres per mole.
Check the other test: hydrogen at the same conditions is 2.016 divided by the same denominator, which is 0.08 grams per litre — about twenty-two times lighter than carbon dioxide, which is why hydrogen lifts and carbon dioxide sinks. And nitrogen at 2 atmospheres and 0 degrees is 2.50 grams per litre, because the doubled pressure doubles the density.
The answers on this page are rounded for display, usually to two decimal places, while the maths underneath keeps full precision. That means a result shown as 2.28 may really be 2.2814, and the reverse check may differ in the last digit for the same reason. That is rounding, not an error, and it never changes the answer by more than a fraction of a percent.
The most common mistake with any calculator is typing a number and trusting it without a glance at the label beside it. The second is copying a result with more digits than the inputs justify — if your inputs are good to two digits, the answer is good to two digits, however many the screen shows. Round the answer to match the precision of what you measured.
Why gas density matters
Students use gas density to predict whether a gas rises or sinks in air — air itself is about 1.2 grams per litre, so anything lighter rises and anything heavier sinks — and to work out the mass of gas in a container of known volume. It is also the check on a gas's identity: measure the density, and the molar mass follows.
Engineers use it for balloons and airships, where the lift is the difference between the air's density and the lifting gas's density times the volume; for gas pipelines, where the mass flow depends on the density; and for safety, where a heavy gas like carbon dioxide can pool in low places and displace breathable air.
Students use tools like this one for homework and exam practice, teachers use them to check answers quickly in class, and working cooks and lab staff use them because a fast, correct conversion beats doing the same arithmetic by hand for the twentieth time. The tool does not replace understanding the method — it removes the arithmetic so the understanding is what you spend your time on.
The share and print buttons sit with every tool on this site. Share sends the page link, not your numbers, so whoever opens it starts from the same defaults you saw. Print gives you a clean copy for a lab notebook, a recipe folder, or a classroom handout, with the formula and the worked example included.
Two related tools worth knowing are the mole calculator and temperature converter.
Gas density vs liquid density
A density calculator works out the density of a liquid or solid from its mass and volume, which are measured directly. A gas's density cannot be measured that way in practice — the mass is small and the volume is large — so this calculator derives it from the gas law instead. Use the density tool for condensed matter; use this one for gases.
The ideal gas law calculator gives the same information in a different form: pressure, volume, temperature, and moles. This calculator is that law solved for density, with the molar mass doing the conversion from moles to grams. If you know the moles and need the volume, use the ideal gas law; if you know the molar mass and need the density, use this page.
Students use tools like this one for homework and exam practice, teachers use them to check answers quickly in class, and working cooks and lab staff use them because a fast, correct conversion beats doing the same arithmetic by hand for the twentieth time. The tool does not replace understanding the method — it removes the arithmetic so the understanding is what you spend your time on.
Common mistakes with gas density
The most common mistake is using the atomic mass instead of the molecular mass — O at 16 instead of O2 at 32. The second is using Celsius instead of kelvin for the temperature. The third is the pressure unit: kilopascals instead of atmospheres, without converting, makes the answer a hundred times too large.
A fourth mistake is confusing grams per litre with kilograms per cubic metre and converting when no conversion is needed — the two are numerically equal. A fifth is forgetting that the density depends on the conditions: a gas's density at STP is not its density at room temperature, and the difference is the temperature ratio.
The one habit that prevents nearly every wrong answer here is checking the units before you trust the result. Grams are not ounces, millilitres are not cups, and a value typed in the wrong unit gives a confident-looking wrong answer. Read the label next to each box, match it to the unit on your recipe or your lab sheet, and only then read the result.
How to use this gas density calculator
Type the pressure in atmospheres, the molar mass in grams per mole, and the temperature in Celsius. The density appears instantly in grams per litre and kilograms per cubic metre, with the molar volume alongside. Change any number and the answers update at once.
Use the molar mass of the gas molecule, not the atom, and convert any pressure in kilopascals to atmospheres first by dividing by 101.325. If the density comes out below about 1.2 grams per litre, the gas rises in air; above it, the gas sinks.
Everything on this page runs in your browser. Nothing you type is uploaded, stored, or sent to a server, and there is no account to create and no sign-up step. You can use the tool as many times as you like, close the tab, and come back later — your inputs are never saved anywhere.