Ideal Gas Law Calculator
Solve PV = nRT for pressure, volume, temperature or moles, with gas density and mass from the molar mass.
Pressure
1 atm (101.325 kPa)
Volume
22.4139 L
Temperature
273.15 K (0 °C)
Moles
1 mol
Gas Density
1.293 g/L
Mass of Gas
28.97 g
Ideal Gas Law: PV = nRT
Choose the unknown and enter the other three quantities. The calculator also gives the gas density and mass from its molar mass (air by default).
Formulas
- P = nRT ÷ V; V = nRT ÷ P; T = PV ÷ nR; n = PV ÷ RT
- Density ρ = PM ÷ RT; mass = n × M
- R = 0.082057 L·atm/(mol·K) = 8.314 J/(mol·K)
Molar masses of common gases
| Gas | M (g/mol) | Density at STP (g/L) |
|---|---|---|
| Hydrogen H2 | 2.016 | 0.090 |
| Helium He | 4.003 | 0.179 |
| Nitrogen N2 | 28.01 | 1.250 |
| Air | 28.97 | 1.293 |
| Oxygen O2 | 32.00 | 1.429 |
| Carbon dioxide CO2 | 44.01 | 1.964 |
Worked examples
1. Volume of 1 mol at STP (the defaults). V = 1 × 0.082057 × 273.15 ÷ 1 = 22.41 L; air density 1.293 g/L.
2. Same at 25 °C.24.47 L.
3. Pressure of 2 mol in a 10 L cylinder at 25 °C. P = 4.89 atm (496 kPa).
4. Moles of CO2 in 5 L at 2 atm and 300 K. n = 0.406 mol = 17.9 g.
5. Temperature of 1 mol in 20 L at 1.5 atm. T = 365.6 K (92.5 °C).
Use absolute pressure, not gauge pressure, and kelvin for temperature.
Related tools
- Boyle's, Charles's and combined gas laws: Gas Law Calculator.
- Molar mass of a gas: Molar Mass Calculator.
Frequently Asked Questions
What is the ideal gas law?
PV = nRT: pressure × volume = moles × gas constant × absolute temperature. With P in atm, V in litres and T in kelvin, R = 0.082057 L·atm/(mol·K).
What is the molar volume of a gas at STP?
22.41 L at 0 °C and 1 atm. At 25 °C and 1 atm it is 24.47 L.
Why must temperature be in kelvin?
The law uses absolute temperature. K = °C + 273.15; 25 °C = 298.15 K.
What values of R are used?
0.082057 L·atm/(mol·K), 8.314 J/(mol·K) (= L·kPa/(mol·K)) and 62.36 L·mmHg/(mol·K). Use the one matching your units.
How do I find the density of a gas?
ρ = PM ÷ RT. Air (M = 28.97 g/mol) at STP: 1.293 g/L; CO₂ at 2 atm and 300 K: 3.58 g/L.
How do I find moles of gas in a container?
n = PV ÷ RT. 5 L at 2 atm and 300 K holds 0.406 mol.
When does the ideal gas law fail?
At high pressure and low temperature, when molecules are close together and attract each other. Real-gas equations such as van der Waals are used then.
How do I convert atm to kPa?
1 atm = 101.325 kPa = 1.01325 bar = 760 mmHg.
What is the combined gas law?
P₁V₁/T₁ = P₂V₂/T₂ for a fixed amount of gas. See the Gas Law Calculator for Boyle's and Charles's law problems.
Does the gas type matter?
Not for P, V, T and n of an ideal gas. It matters for mass and density, which depend on molar mass.
Related Calculators
Gas Law Calculator
Calculate and verify the Ideal Gas Law PV = nRT. Enter pressure, volume, temperature, and moles to check gas behavior and compute molar density.
Molar Mass Calculator
Calculate the molar mass of a substance from its mass and number of moles. Also find the number of molecules using Avogadro's number.
Molarity Calculator
Calculate the molarity (molar concentration) of a solution using M = n/V. Enter moles of solute and volume of solution in liters.
Chemical Equilibrium Calculator
Calculate the equilibrium constant (K), Gibbs free energy (ΔG), and reaction direction using K = [Products]^p / [Reactants]^r.
Enthalpy Calculator
Calculate enthalpy (H = U + PV) from internal energy, pressure, and volume. Get results in kJ, kcal, and BTU with flow work computation.
Specific Heat Calculator
Calculate specific heat capacity (c = Q/mΔT) from heat energy, mass, and temperature change. Results in J/(kg·K), kJ/(kg·K), cal/(g·°C), and BTU/(lb·°F).
More in Chemical · Engineering calculators · All calculators A–Z