webby.tools

Ideal Gas Law Calculator

Enter three of the four variables in the ideal gas law (PV = nRT) to solve for the fourth. Choose units that match your problem — the calculator converts everything automatically.

mol

The Ideal Gas Law: PV = nRT

The ideal gas law relates four properties of a gas sample:

  • P — Pressure of the gas
  • V — Volume occupied by the gas
  • n — Number of moles of gas
  • T — Absolute temperature in Kelvin
  • R — The universal gas constant (8.314 J·mol⁻¹·K⁻¹, or 0.08206 L·atm·mol⁻¹·K⁻¹)

When three of these values are known, the fourth can be solved algebraically:

  • P = nRT ÷ V
  • V = nRT ÷ P
  • n = PV ÷ (RT)
  • T = PV ÷ (nR)

This calculator uses R = 8.314 Pa·m³·mol⁻¹·K⁻¹ as the base constant and converts all inputs to SI units (Pa, m³, mol, K) before calculating, then converts the result back to your chosen output unit.

Temperature and the Kelvin Requirement

The ideal gas law requires temperature in Kelvin (absolute temperature scale), not Celsius or Fahrenheit. If you enter a temperature in °C or °F, the calculator converts it automatically. Never use Celsius values directly in the PV = nRT equation — using T = 25 instead of T = 298.15 produces a wildly wrong answer. To convert temperatures for other purposes, try the temperature converter.

Worked Example

A 2.0 mol sample of oxygen gas occupies 44.8 L at 273.15 K. What is the pressure?

P = nRT / V = (2.0 mol)(8.314)(273.15 K) / (0.04480 m³) = 101,325 Pa ≈ 1.00 atm

This is the expected result — exactly 1 atm, matching STP (standard temperature and pressure) conditions, where 1 mole of ideal gas occupies 22.4 L.

Frequently Asked Questions

What is an ideal gas?

An ideal gas is a theoretical gas composed of many randomly moving point particles whose only interactions are perfectly elastic collisions — no attractive or repulsive forces between molecules. Real gases approximate ideal behavior at low pressure and high temperature, where molecules are far apart and fast-moving enough that intermolecular forces are negligible.

When does the ideal gas law fail?

At high pressures (above ~10 atm) or low temperatures (near the boiling point of the gas), real gas behavior deviates significantly from ideal. In these conditions, the van der Waals equation or other equations of state give more accurate results because they account for the finite size of molecules and intermolecular attractions.

What are STP and standard conditions?

STP (Standard Temperature and Pressure) as defined by IUPAC since 1982 is 0°C (273.15 K) and 100 kPa (≈ 0.987 atm). Under STP, one mole of an ideal gas occupies 22.711 L. Older definitions used 1 atm instead of 100 kPa, giving 22.4 L/mol — both values appear in textbooks. Standard conditions for thermodynamics (25°C, 100 kPa) are different; always check which definition your course or textbook uses.

How do I find moles if I only have grams?

Divide the mass by the molar mass of the compound: n = mass (g) ÷ molar mass (g/mol). Use the molar mass calculator to find the molar mass from the chemical formula, then plug the result into this calculator.

What units should I use for homework or exams?

Match the units given in the problem. Pressure problems in general chemistry almost always use atm; volume uses liters. With those choices, R = 0.08206 L·atm·mol⁻¹·K⁻¹. This calculator handles all unit combinations, so enter whatever the problem gives you and select the matching unit.

This website may contain affiliate links. If you click on an affiliate link and make a purchase, we may receive a small commission at no additional cost to you.