How to use the ideal gas law calculator
Pick what you want to find — pressure, volume, amount (moles or mass) or temperature — and fill in the other three in whatever units you have. The answer updates as you type, in your chosen unit and in every other common unit, with the formula and the numbers substituted in SI units so you can copy the working into homework. Choose a gas (air, nitrogen, oxygen, CO₂, helium, hydrogen, methane, propane…) to work with grams instead of moles and to get the gas density. The second tab solves the combined gas law and, by leaving a pair blank, Boyle's, Charles's and Gay-Lussac's laws.
The ideal gas law: PV = nRT
P is absolute pressure, V volume, n amount of gas in moles, T absolute temperature in kelvin, and R the molar gas constant, 8.314 462 618 J mol⁻¹ K⁻¹ (exact since the 2019 SI). Rearranged: P = nRT/V, V = nRT/P, n = PV/RT and T = PV/nR. The equation combines the older gas laws and describes most gases well at everyday temperatures and pressures.
R in different units
| Value of R | Units | Use when |
|---|---|---|
| 8.314 | J/(mol·K) = Pa·m³/(mol·K) | SI: Pa and m³ |
| 0.082057 | L·atm/(mol·K) | atm and litres |
| 8.314 | L·kPa/(mol·K) | kPa and litres |
| 0.08314 | L·bar/(mol·K) | bar and litres |
| 62.364 | L·Torr/(mol·K) | mmHg/Torr and litres |
| 10.732 | ft³·psi/(lb-mol·°R) | US engineering units |
You never need to pick R here: the calculator converts every input to SI, solves, and converts back.
Worked examples
- Molar volume at STP. n = 1 mol, P = 1 atm (101 325 Pa), T = 0 °C (273.15 K): V = 1 × 8.314 × 273.15 ÷ 101 325 = 0.022414 m³ = 22.41 L. At IUPAC STP (100 kPa) it is 22.71 L; at 25 °C and 1 atm, 24.47 L.
- Helium balloon. 10 g of He is 10 ÷ 4.0026 = 2.498 mol. At 25 °C and 1 atm, V = 61.1 L.
- Car tyre. 2.2 bar gauge is about 3.2 bar absolute — use absolute pressure (gauge + 1.013 bar) in PV = nRT.
- Gas density. ρ = PM/RT. Dry air (M = 28.965 g/mol) at 15 °C and 1 atm: 1.225 kg/m³, the standard sea-level value.
Combined gas law and the classic laws
For a fixed amount of gas, P₁V₁/T₁ = P₂V₂/T₂. Hold one quantity constant and it reduces to:
- Boyle's law (constant T): P₁V₁ = P₂V₂ — halve the volume, double the pressure.
- Charles's law (constant P): V₁/T₁ = V₂/T₂ — volume is proportional to kelvin temperature.
- Gay-Lussac's law (constant V): P₁/T₁ = P₂/T₂ — why aerosol cans must not be heated.
- Avogadro's law (constant P and T): V ∝ n.
In the combined tab, leave both boxes of the constant quantity empty and the tool applies the right law and names it.
Units and the most common mistakes
- Use kelvin. Celsius or Fahrenheit in PV = nRT gives nonsense (and division by zero at 0 °C). The calculator converts for you: K = °C + 273.15.
- Use absolute pressure. Tyre and cylinder gauges read pressure above atmospheric.
- Match R to the units if you calculate by hand (see the table).
- Litres vs m³: 1 m³ = 1000 L; 1 L = 1 dm³ = 1000 cm³ (mL).
When is a gas "ideal"?
The ideal gas law assumes molecules take up no volume and do not attract each other. Real gases follow it within about 1 % at room temperature and pressures up to a few bar. Deviations grow at high pressure (hundreds of bar) and near the boiling point — water vapour, CO₂ near liquefaction and refrigerants are the usual exceptions; there the van der Waals equation or compressibility factor Z = PV/nRT is used. For the stoichiometry that produces a gas, start with the chemical equation balancer and the molar mass calculator.