Online Science Tools

Ideal Gas Law Calculator (M = dRT/P)

Solve PV = nRT, or find molar mass from density with M = dRT/P (also written mm = dRT/P). Convert atm, kPa, torr, °C, and g/L.

Ideal gas law calculator

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

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

PV = nRT

Solved for Amount n

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

Ideal gas law calculator: PV = nRT and M = dRT/P

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.

A second homework form comes from combining n = m/M with density d = m/V: M = dRT/P, often written mm = dRT/P or MM = dRT/P. That path needs only density, pressure, and temperature—not a separate volume or mole count. The Ideal Gas Law Calculator has both modes: leave one of P, V, n, T blank for PV = nRT, or switch to M = dRT/P to get molar mass (or invert to density).

  • Always convert temperature to kelvin before substituting
  • PV = nRT uses consistent P, V, and R (this tool converts atm/kPa/mmHg/torr and L/mL)
  • M = dRT/P uses density in g/L (g/mL is converted ×1000) and returns g/mol

Formulas you will actually use

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; also written mm = dRT/P)
d = PM / RT     (inverse)

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.

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

Step-by-step example: Molar mass from density (M = dRT/P)

A gas has density 1.96 g/L at 1.00 atm and 273.15 K. Find the molar mass.

  1. Use M = dRT/P with d in g/L, P in atm, T in kelvin.
  2. M = (1.96)(0.082057)(273.15) / 1.00 ≈ 43.9 g/mol (CO₂ is 44.01 g/mol).

Choose M = dRT/P, Density → molar mass. Load the CO₂ chip or enter d = 1.96 g/L, P = 1 atm, T = 273.15 K.

Frequently asked questions

What does mm = dRT/P mean?

It is the same formula as M = dRT/P. Homework often writes mm or MM for molar mass in g/mol, d for density in g/L, R = 0.082057 L·atm/(mol·K), T in kelvin, and P in atm. Choose the M = dRT/P mode; you do not need V or n.

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. The calculator converts °C for you.

Can I use this as an ideal gas density calculator?

Yes. In M = dRT/P mode choose Molar mass → density to get d = PM/RT. Keep d in g/L unless you switch the density unit to g/mL.

What density units does M = dRT/P use?

The standard classroom substitution is grams per liter. If a problem gives g/mL, multiply by 1000 or set the density unit to g/mL. Mixing g/mL with R in L·atm/(mol·K) without converting gives an answer 1000× too small.

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 and M = dRT/P are expected.

References & further reading

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

See also: Stoichiometry Calculator · Chemistry Formula Sheet · Chemistry calculators

Keep learning with chemistry calculators, the math tools, and study guides on Online Science Tools.

Practice problems & worked examples

Practice alongside the ideal gas law / M = dRT/P 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

Practice problem 4

mm = dRT/P

A worksheet writes mm = dRT/P. Density is 1.25 g/L at 1.00 atm and 273.15 K. What is mm?

Show solution

Worked solution

  1. mm is molar mass M. Same formula as M = dRT/P.
  2. mm = (1.25)(0.082057)(273.15)/1.00 ≈ 28.0 g/mol (N₂).

Answer: mm ≈ 28.0 g/mol

Related tools