Skip to content

    Under active development. New calculators and features ship every week. Everything currently runs free while the site matures — pricing pages are a preview, checkout is not open yet.

    Calculates locally in your browser · absolute units enforced
    Thermodynamics / gas state

    Ideal gas law

    Solve PV = nRT for the amount, mass and density of a gas at any pressure and temperature. Absolute units are enforced internally, which is where most hand calculations go wrong.

    Temperature293.15 KPressure101.325 kPaMolar mass28.970 g/mol
    Amount of substance
    41.5712 mol
    2.503e+25 molecules
    Mass
    1.2043 kg
    1204.32 g of Air
    Density
    1.2043 kg/m³
    ρ = PM/RT
    Specific volume
    0.8303 m³/kg
    Volume occupied per kilogram
    Gas properties at these conditions
    Density and specific volume for each gas at the entered pressure and temperature.
    Air
    Gas properties at these conditions
    GasMolar massDensity (kg/m³)Specific volume (m³/kg)
    Air28.970 g/mol1.20430.8303
    Nitrogen28.013 g/mol1.16450.8587
    Oxygen31.999 g/mol1.33020.7517
    Carbon dioxide44.010 g/mol1.82950.5466
    Helium4.003 g/mol0.16646.0093
    Hydrogen2.016 g/mol0.083811.9321
    Methane16.043 g/mol0.66691.4994
    Argon39.948 g/mol1.66070.6022

    Density is proportional to molar mass at fixed pressure and temperature — helium is about seven times lighter than air.

    Inspect the model
    Choose a quick result view, a scaled comparison, or the complete diagnostic set.
    Density by gas
    At the entered pressure and temperature, density tracks molar mass.
    Density by gas0.0000.4320.8641.301.732.161.20AirAir1.16NitrogNitrog1.33OxygenOxygen1.83CarbonCarbon0.166HeliumHelium0.084HydrogHydrog0.667MethanMethan1.66ArgonArgonkg/m³
    Pressure vs temperature at fixed volume
    Isochoric heating: pressure rises linearly with absolute temperature.
    Pressure vs temperature at fixed volume0.00034.8469.68104.52139.36174.20250 K250 K275 K275 K300 K300 K325 K325 K350 K350 K400 K400 K450 K450 KP (kPa)Current condition
    Canonical equations
    The exact relationships implemented by this engine.

    PV = nRT · absolute pressure and temperature only

    n = PV/(RT) · P in Pa, V in m³, T in K

    ρ = PM/(RT) · the form used for gas sizing

    m = nM · M in g/mol gives grams

    engineering methodology

    A clear path from inputs to results.

    PV = nRT relates pressure, volume, temperature and amount for an ideal gas. It is exact enough for air and combustion products at ordinary conditions, and it is the fastest way to get from a vessel size to a mass of gas. The only rule that matters is that pressure and temperature must be absolute.

    Step-by-step methodWorked exampleAssumptions explained

    How to use

    1. Enter the absolute pressure in kilopascals.
    2. Enter the volume in cubic metres.
    3. Enter the temperature in degrees Celsius; the engine converts to kelvin.
    4. Select the gas to set its molar mass.
    5. Read the moles, mass, density and specific volume.
    6. Compare densities across gases in the table — the ratio is just the molar mass ratio.

    The formula

    PV=nRT,n=PVRT,ρ=PMRT,R=8.314462618 J/(mol⋅K)PV = nRT, \qquad n = \frac{PV}{RT}, \qquad \rho = \frac{PM}{RT}, \qquad R = 8.314462618\ \text{J/(mol·K)}

    Reference: ISO 80000-5; CODATA 2018 value of the molar gas constant.

    Worked example

    1 m³ of air at 101.325 kPa and 20 °C (default inputs)

    Inputs
    • Pressure 101.325 kPa absolute.
    • Volume 1 m³.
    • Temperature 20 °C.
    • Gas: air, M = 28.97 g/mol.
    Calculation path
    1. 1

      Convert to absolute units: 101,325 Pa and 293.15 K.

    2. 2

      Moles: (101,325 × 1) / (8.3145 × 293.15) = 41.57 mol.

    3. 3

      Mass: 41.57 × 28.97 = 1,204.3 g = 1.204 kg.

    4. 4

      Density: 1.204 kg/m³; specific volume 0.830 m³/kg.

    Result

    41.57 mol · 1.204 kg · 1.204 kg/m³ · 0.830 m³/kg.

    Interpreting the result

    At standard conditions (0 °C, 101.325 kPa) a mole occupies 22.414 L. At 20 °C it occupies 24.05 L — a 7% difference that matters in ventilation and combustion air calculations. Density is proportional to molar mass at fixed conditions, which is why helium lifts and carbon dioxide settles.

    Assumptions & limitations

    • The gas is ideal: no intermolecular forces and negligible molecular volume.
    • Absolute pressure and absolute temperature are used throughout; gauge pressure must have atmospheric added.
    • The gas is pure and its molar mass is known. Mixtures need a mole-weighted molar mass.
    • No phase change occurs. Near saturation, the ideal law fails badly.
    • Compressibility factor Z = 1. Real gases deviate above about 10 bar or near the critical point.

    Frequently asked questions

    Why must I use absolute pressure?

    Because the law is derived from kinetic theory with a zero at vacuum. Using gauge pressure omits the 101.325 kPa of atmosphere already acting on the gas, which understates the amount by about 15% at low gauge pressures.

    When does the ideal gas law break down?

    At high pressure, low temperature, or near the critical point — anywhere the molecules are close enough to interact. Use a compressibility factor Z or a cubic equation of state such as Peng-Robinson there.

    Does this work for steam?

    Only far from saturation. Steam near its dew point behaves very non-ideally, and steam tables or the IAPWS formulation are the right tool.

    What is the difference between STP and NTP?

    STP is 0 °C and 101.325 kPa (22.414 L/mol); NTP is 20 °C and 101.325 kPa (24.05 L/mol). Some standards use 15 °C. Always confirm which one a specification means.

    How do I handle a gas mixture?

    Compute a mole-weighted molar mass and use it in the same equations. Dalton’s law lets you sum partial pressures if you prefer to work per component.

    How do I get mass flow from volumetric flow?

    Multiply volumetric flow by density at the operating conditions. This is why the density readout matters more than the moles for HVAC and process work.

    Methodology last reviewed 2026-10-18. Results are informational and not financial or engineering advice — see our disclaimer.