Skip to main content

DigitalCalculators.net

Ideal Gas Law Calculator

Last updated By the DigitalCalculators.net team Free, no sign-up

Solve the ideal gas law, PV = nRT, for pressure, volume, moles or temperature in the units you use. Add the gas formula to get its mass and density too, with the unit conversions and every step shown.

Results

ItemValue

Answer in other units

UnitValue

Steps

StepWorking
Uses R = 8.314462618 J/(mol·K), the exact NIST value, which is 0.0820574 L·atm/(mol·K). Temperatures are changed to kelvin first. Real gases follow PV = nRT closely at low pressure and high temperature; at high pressure or near condensing, they don’t. A torr is 1/760 atm; a millimeter of mercury differs from it by less than one part in a million.

Quick Answer

PV = nRT. To find the volume of 40.8 mol of gas at 298 K and 0.980 atm, use V = nRT ÷ P = 40.8 × 0.08206 × 298 ÷ 0.980 = 1018 L, about 1.02 × 10³ L. At STP (273.15 K and 1 atm), one mole of an ideal gas takes up 22.414 L.

Last updated: 4 December 2026 ·How we calculate this: PV = nRT

How This Ideal Gas Law Calculator Works

Choose what to solve for, then enter the other three values with their units. The calculator changes everything to SI units (pascals, cubic meters, moles and kelvin), solves PV = nRT, and gives the answer in your unit and in the other common units. It also shows the molar volume. If you type the gas formula, it adds the gas’s mass and density, and lets you enter the amount in grams instead of moles.

Quick explanation:

  • P: pressure.
  • V: volume.
  • n: moles of gas.
  • T: temperature in kelvin, never °C or °F.
  • R: the gas constant, 8.314462618 J/(mol·K) or 0.08206 L·atm/(mol·K).

How to Use the Ideal Gas Law Calculator

  1. Choose what to solve for.
  2. Enter the other three values and pick their units.
  3. Optionally type the gas formula to get mass and density, or to enter grams.
  4. Press Calculate or Enter.
  5. Read the answer in your unit and others, and check the steps.

Core Formulas

  • Ideal gas law: PV = nRT
  • Volume: V = nRT ÷ P
  • Pressure: P = nRT ÷ V
  • Moles: n = PV ÷ RT
  • Temperature: T = PV ÷ nR
  • Kelvin: K = °C + 273.15, and °C = (°F − 32) × 5/9
  • Density: ρ = PM ÷ RT, where M is the molar mass
  • Combined gas law (same n): P₁V₁ ÷ T₁ = P₂V₂ ÷ T₂

Key Terms

  • Ideal gas: a model gas that follows PV = nRT exactly.
  • Gas constant (R): 8.314462618 J/(mol·K), an exact value.
  • STP: standard temperature and pressure: 273.15 K and 1 atm in many textbooks.
  • Molar volume: the volume of one mole of gas, about 22.4 L at 273.15 K and 1 atm.
  • Absolute pressure: pressure measured from a perfect vacuum.

Worked Example

Methane is stored at 298 K and 0.980 atm. What volume do 40.8 mol take up? (This is from OpenStax Chemistry 2e, section 9.2.)

  • Rearrange PV = nRT to V = nRT ÷ P.
  • With R = 0.08206 L·atm/(mol·K), keep P in atm, T in K and n in mol.
  • V = 40.8 × 0.08206 × 298 ÷ 0.980 = 1018 L.
  • To three significant figures, that’s 1.02 × 10³ L, the book’s answer.

Add CH4 as the formula and the calculator also gives the mass, 655 g, and the density, 0.643 g/L.

Real-Life Examples

  • Homework: check gas law problems with unit conversions shown.
  • Lab work: find the moles of gas collected in a flask.
  • Gas density: compare how heavy different gases are.
  • Tanks and balloons: estimate how pressure or volume changes with temperature.
  • Comparing conditions: keep one result as A and compare another.

Ideal Gas vs Real Gas

  • Ideal gas: molecules take up no space and don’t attract each other.
  • Real gas: molecules do both, so at high pressure or low temperature PV = nRT is less accurate.
  • Good news: at everyday conditions most gases behave very close to ideal.

The Gas Constant R in Different Units

All are the same constant. The calculator uses the exact SI value and converts the units for you.

Value of RUnits
8.314462618J/(mol·K) = Pa·m³/(mol·K)
0.0820574L·atm/(mol·K)
8.314463L·kPa/(mol·K)
62.3636L·torr/(mol·K)
0.0831446L·bar/(mol·K)

STP and Molar Volume

Chemists often compare gases at standard temperature and pressure (STP). OpenStax uses 273.15 K and 1 atm, where one mole of an ideal gas takes up about 22.4 L; with the exact gas constant it’s 22.414 L. Since 1982, IUPAC has defined standard pressure as 1 bar (100 kPa) instead, which gives 22.711 L per mole. Check which one your course uses.

  • At room conditions (20 °C, 1 atm), 1 L of gas is about 0.0416 mol.
  • Gas density: carbon dioxide at 25 °C and 1 atm is about 1.799 g/L.
  • Same moles, same volume: at the same T and P, equal volumes of ideal gases hold the same number of molecules.

Common Mistakes to Avoid

  • Using °C. Always change to kelvin: 25 °C is 298.15 K.
  • Mixing units with R. With 0.08206, use atm, L and K.
  • Using grams as moles. Divide by the molar mass first.
  • Forgetting gauge pressure. Tire gauges read above atmospheric. Add about 14.7 psi for absolute pressure.
  • Using mL with liters. 500 mL is 0.500 L.

Frequently Asked Questions

PV = nRT: pressure times volume equals moles times the gas constant times the kelvin temperature.

8.314462618 J/(mol·K) with pascals and cubic meters, or 0.08206 L·atm/(mol·K) with atm and liters.

The law needs a scale that starts at absolute zero. With °C, a gas at 0 °C would have zero volume, which is wrong.

About 22.4 L at 273.15 K and 1 atm (22.414 L exactly).

Yes. Type the gas formula and choose grams as the amount unit.

Type the formula. Density = PM ÷ RT, shown in g/L.

At high pressure and low temperature, especially near the point where a gas would turn into a liquid.

For a fixed amount of gas, P₁V₁ ÷ T₁ = P₂V₂ ÷ T₂. Solve each state with this calculator, or rearrange by hand.

Almost. A torr is exactly 1/760 atm; a millimeter of mercury differs by less than one part in a million.

Yes. Save each set by name in this browser.

Yes. Use Compare: keep as A.

Yes. Use Share link or Print.

References & Sources

SourceUsed ForLink
OpenStax Chemistry 2e, 9.2 The Ideal Gas Law PV = nRT, R = 0.08206 L atm/(mol K), the combined gas law and STP (273.15 K, 1 atm). https://openstax.org/books/chemistry-2e/pages/9-2-relating-pressure-volume-amount-and-temperature-the-ideal-gas-law
OpenStax Chemistry 2e, 1.6 Mathematical Treatment of Measurement Results Temperature conversions: °F = 9/5 × °C + 32 and K = °C + 273.15. https://openstax.org/books/chemistry-2e/pages/1-6-mathematical-treatment-of-measurement-results
NIST CODATA 2022, Molar gas constant R = 8.314 462 618 J/(mol K), exact. https://physics.nist.gov/cgi-bin/cuu/Value?r

Cite or share this calculator

DigitalCalculators.net. (2026, December 4). Ideal Gas Law Calculator. https://digitalcalculators.net/ideal-gas-law-calculator/