Thermal & Fluids

Ideal Gas Law Calculator

Solve PV = mRT for pressure, volume, mass or temperature for air and common gases.

Tool no.
ECT-F04
Rev
1.0
Updated
Oct 2026
Method
Ideal gas equation of state
How to use this calculator

Choose the quantity to solve for, pick a gas (or type its specific gas constant R), and enter the other three values. Use absolute pressure and any temperature scale; the calculator converts to K or °R.

Formulas

Ideal gas law (mass form)PV = mRT
Specific gas constantR = RuM  Ru = 8.314 J/mol·K
Densityρ = PRT

Worked example

1.2 kg of air in 1 m³ at 20 °C (the default)

  1. T = 20 + 273.15 = 293.15 K.
  2. P = mRT/V = 1.2 × 287.05 × 293.15 / 1 = 101.0 kPa, about atmospheric.
  3. Molar mass M = 8.314/287.05 = 28.97 g/mol, so n = 1,200/28.97 = 41.4 mol.
Assumptions and limits
  • Ideal behavior: low pressure and temperatures well above the gas’s critical temperature.
  • Pressure and temperature are absolute.
  • Steam is only close to ideal at low pressure and high superheat; use steam tables otherwise.

Frequently asked questions

Why must I use absolute pressure?

The law is about molecules hitting the walls, which happens even at zero gauge pressure. A tire at 32 psi gauge is at about 46.7 psi absolute.

What is the difference between R and Ru?

Ru = 8.314 J/mol·K is universal. The specific constant R = Ru/M depends on the gas: 287 J/kg·K for air.

Can I use moles instead of mass?

Yes: PV = nRuT. The calculator shows the amount in moles alongside the mass result.