What Is the Gas Density Calculator?
This tool computes the density of an ideal gas from three measurable quantities: absolute pressure, molar mass, and absolute temperature. It rearranges the ideal gas law, \(PV = nRT\), to express density (mass per unit volume) directly. It is widely used in chemistry, physics, HVAC, combustion, and aerospace engineering for any gas that behaves approximately ideally at the given conditions.
How to Use It
Enter the pressure in pascals (Pa), the molar mass of the gas in grams per mole (g/mol), and the temperature in kelvin (K). The calculator returns density in kilograms per cubic metre (kg/m³), which is numerically identical to grams per litre (g/L). For reference, dry air has a molar mass of about 28.97 g/mol; standard atmospheric pressure is 101325 Pa; and 0 °C equals 273.15 K.
The Formula Explained
Starting from \(PV = nRT\) and noting that the number of moles \(n = m/M\) (mass divided by molar mass), we substitute and divide both sides by volume to get density \(\rho = m/V = PM/(RT)\). The calculator internally converts molar mass from g/mol to kg/mol (dividing by 1000) so that the result comes out in SI units of kg/m³ with the gas constant \(R = 8.314462618\ \text{J/(mol}\cdot\text{K)}\).
$$\rho = \frac{\text{Pressure (Pa)} \cdot \dfrac{\text{Molar Mass (g/mol)}}{1000}}{8.314462618 \cdot \text{Temperature (K)}}$$
Worked Example
For dry air at standard conditions: \(P = 101325\ \text{Pa}\), \(M = 28.97\ \text{g/mol} = 0.02897\ \text{kg/mol}\), \(T = 273.15\ \text{K}\). Then
$$\rho = \frac{101325 \times 0.02897}{8.314462618 \times 273.15} \approx \frac{2935.39}{2271.10} \approx 1.2925\ \text{kg/m}^3$$— close to the textbook value of about 1.29 kg/m³.
FAQ
Does this work for real gases? It assumes ideal behaviour, which is accurate for most gases near room temperature and moderate pressure. Near condensation or very high pressure, use a real-gas equation with a compressibility factor.
Why is kg/m³ the same number as g/L? Because \(1\ \text{kg/m}^3 = 1000\ \text{g} / 1000\ \text{L} = 1\ \text{g/L}\), the two units share the same numeric value.
What if I have temperature in Celsius? Convert to kelvin first by adding 273.15 before entering it.