Ideal Gas Law Calculator

Solve PV = nRT for pressure, volume, temperature or moles, with gas density and mass from the molar mass.

Built by Sabki SolutionsRules: R = 0.082057 L·atm/(mol·K)Last updated
atm
0.001atm1,000.000atm
K
1.00K5,000.00K
mol
0.0001mol1,00,000.0000mol
g/mol
1.00g/mol500.00g/mol

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

GasM (g/mol)Density at STP (g/L)
Hydrogen H22.0160.090
Helium He4.0030.179
Nitrogen N228.011.250
Air28.971.293
Oxygen O232.001.429
Carbon dioxide CO244.011.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

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

More in Chemical · Engineering calculators · All calculators A–Z