Chemistry

Ideal Gas Law Calculator

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

Ideal gas law

PV = nRT · R = 0.082057 L·atm/(mol·K)

Enter any three of P, V, n, T and leave one blank. Units are converted internally to atm, L, and K.

Solved for Amount n

P
1 atm
V
22.4 L
n
0.999381 mol
T
273.15 K

Optional: molar mass from density

Uses M = dRT/P with the P and T above (d in g/L).

What is the Ideal Gas Law Calculator?

The ideal gas law PV = nRT relates pressure, volume, amount, and absolute temperature for gases at moderate conditions. Classroom calculations usually use R = 0.082057 L·atm/(mol·K) with P in atm, V in liters, and T in kelvin. Real gases deviate at high pressure or low temperature, but the ideal model is the standard starting point in general chemistry.

The Ideal Gas Law Calculator solves for whichever variable you leave blank and can estimate molar mass from gas density via M = dRT/P.

  • Always convert temperature to kelvin for PV = nRT
  • Keep P, V, R unit-consistent (tool converts atm/kPa/mmHg and L/mL)
  • Molar mass from density: M = dRT/P with d in g/L

Mathematical / chemical formulas

Ideal gas relations used here:

PV = nRT
R = 0.082057 L·atm/(mol·K)

T(K) = t(°C) + 273.15
M = dRT / P   (d in g/L)

Step-by-step example: Moles of gas at STP-like conditions

A sample occupies 22.4 L at 1.00 atm and 273.15 K. How many moles are present?

  1. n = PV/(RT) = (1.00 × 22.4) / (0.082057 × 273.15) ≈ 1.00 mol.

Enter P = 1.00 atm, V = 22.4 L, leave n blank, T = 273.15 K.

Frequently asked questions

Why must temperature be in kelvin?

Gas laws are proportional to absolute temperature. Zero on the Celsius scale is not zero thermal energy; 0 °C is 273.15 K.

When does the ideal gas law fail?

At high pressures and low temperatures, attractions and molecular volume matter. Use van der Waals or tabulated compressibility for precise work; for homework STP/room-condition problems, PV = nRT is expected.

References & further reading

Standards bodies, university open courseware, and peer-reviewed references that align with the methods used on this page.

Keep learning with more calculators and study guides on Online Science Tools.

Practice problems & worked examples

Practice alongside the ideal gas law above. Each problem includes a full worked solution so you can check your reasoning step by step.

Practice problem 1

Find n

P = 1.00 atm, V = 22.4 L, T = 273 K. Find n (R = 0.0821).

Show solution

Worked solution

  1. n = PV/RT ≈ (1×22.4)/(0.0821×273) ≈ 1.00 mol.

Answer: n ≈ 1.00 mol

Practice problem 2

Celsius to kelvin

A gas is at 25 °C. What T must you use in PV = nRT?

Show solution

Worked solution

  1. T = 25 + 273.15 = 298.15 K.

Answer: 298.15 K

Practice problem 3

Molar mass from density

A gas has density 1.96 g/L at 1.00 atm and 273 K. Estimate M (R = 0.0821).

Show solution

Worked solution

  1. M = dRT/P ≈ 1.96×0.0821×273/1 ≈ 44 g/mol.

Answer: M ≈ 44 g/mol

Related tools