Home / Science / Chemistry / Physical chemistry / Gas law calculatorTool #83

Gas law calculator: PV = nRT, combined gas law and van der Waals real gases

Work out pressure, volume, amount or temperature of a gas in any units, with the mass and density of a named gas, the van der Waals real-gas answer and how far the ideal gas law is off.

Keep it one tap away for everyday use.

Bookmark Gas law calculator?

Press Ctrl + D now. Your browser opens its own bookmark box, where you choose the name and folder.

  1. 3 values
  2. PV = nRT
  3. Real gas
Nothing is uploadedWorks offline once open

Ideal gas law, PV = nRT

Fill in three and leave one empty: the empty one is worked out.

Choosing a gas lets you give the amount in grams, and adds its density and the van der Waals real-gas answer.

Change of state (combined gas law)

P₁V₁/T₁ = P₂V₂/T₂ for a fixed amount of gas. Fill in all of the start and two of the end; units as chosen above.

Download

What it does

The ideal gas law, PV = nRT, links the pressure, volume, amount and temperature of a gas. It holds well for most gases at everyday conditions and is the basis of gas stoichiometry. This calculator solves it in whatever units you have, and checks how far a real gas departs from it.

  • Solve for any one quantity. Give three of pressure, volume, amount and temperature, and leave the fourth empty. Pressure works in Pa, kPa, bar, atm, mmHg, torr or psi; volume in L, mL, m³, cm³, cubic feet or US gallons; temperature in °C, K or °F.
  • Grams instead of moles. Choose the gas, or type any formula, to give or get the amount as a mass. You also get the gas’s density.
  • Real gases. For 13 common gases the tool also solves the van der Waals equation, (P + an²/V²)(V − nb) = nRT, with constants from the CRC Handbook. It shows the compressibility factor Z = PV/nRT and how far off the ideal answer is.
  • Critical point. When the gas is below its critical temperature, the tool says that enough pressure would liquefy it.
  • Change of state. The combined gas law, P₁V₁/T₁ = P₂V₂/T₂, finds the new pressure, volume or temperature when a fixed amount of gas is compressed, heated or cooled.

How to use it

  1. Type three of the four values and choose their units. Leave the one you want empty.
  2. Choose the gas if you know it. “Any gas (ideal)” works for everything except grams.
  3. Read the answer, its value in other units, the density and the real-gas check.
  4. For a change of state, fill in the start and two of the end values below.

Worked examples

Molar volume. 1 mol of nitrogen at 0 °C and 101.325 kPa (1 atm) takes up 1 × 8.314 × 273.15 ÷ 101,325 = 22.414 L. At the newer IUPAC standard of 1 bar it is 22.711 L, and at 25 °C and 1 bar it is 24.790 L.

Real gas. Squeeze 1 mol of carbon dioxide into 1.00 L at 27 °C (300 K). The ideal gas law says 24.9 bar. The van der Waals equation, with a = 3.640 L²·bar/mol² and b = 0.04267 L/mol, gives 22.4 bar: the molecules attract one another, so they hit the walls less hard. The ideal answer is 11 % too high. CO₂’s van der Waals critical temperature is 304 K (31 °C), close to the measured 304.1 K, so at 27 °C it would liquefy under enough pressure.

Change of state. 2.0 L of gas at 1 atm and 25 °C is heated to 100 °C and its pressure doubled. V₂ = 2.0 × (1/2) × (373.15/298.15) = 1.25 L. Always convert temperatures to kelvin first, which the tool does for you.

Questions

When is the ideal gas law good enough? At pressures near 1 atm and temperatures well above the boiling point, the error is usually under 1 %. It grows at high pressure, at low temperature and for gases with strong attractions, such as ammonia, water vapour and CO₂.

Where do the van der Waals constants come from? The CRC Handbook of Chemistry and Physics. The equation is a simple model, good to a few percent at moderate pressures. Near condensation even it is only approximate; check measured data for precise work.

Is anything sent anywhere? No, it all runs in your browser.

Where the numbers come from

  • Atomic weights: IUPAC/CIAAW standard atomic weights (abridged values).
  • van der Waals constants: common values for 13 gases from the CRC Handbook, which you can type over.
  • Physical constants: CODATA recommended values (NIST).

Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.

Last updated 2026-11-08.

Change log for Gas law calculator

  1. Show where each science tool's numbers come from, with a removal-request link Details on GitHub
  2. Add the gas law calculator and Beer-Lambert calculator (#83, #84) Details on GitHub

Every change to fibub

Related tools

Electroplating and electrolysis calculator #97 Plating thickness from current, time and area, or the time or current needed for a thickness, for copper, nickel, zinc, chrome, silver, gold, tin and more (or your own metal), with current efficiency, current density in A/dm² and ASF, plating rate, mass and charge. Also gas volumes from electrolysis of water or brine. Colligative properties calculator #88 Freezing point, boiling point, vapour pressure and osmotic pressure of a solution in water or 10 other solvents, with the van 't Hoff factor, and the molar mass of an unknown from a measured freezing point drop, boiling point rise or osmotic pressure. Molar mass calculator #78 Type any formula, including brackets, hydrates, isotope labels and charges, for its molar mass, exact mass, percentage of each element, and a grams, moles and particles converter. Reaction kinetics fitter #81 Paste concentration against time to find the reaction order, the rate constant with its uncertainty and the half-life; paste k at several temperatures for the activation energy, A, ΔH‡ and ΔS‡. Equation balancer #79 Balance any chemical equation, including ionic and redox ones, check the atoms on both sides, then find the limiting reagent, the theoretical yield, what is left over and your percent yield. Equilibrium solver #89 Type any reaction and K: the exact ICE table, Q and which way it goes, conversion, Kp ↔ Kc and pH for acids and bases; then add or remove a species, squeeze the volume or change the temperature and watch the equilibrium shift. Thermochemistry calculator #95 Type a balanced reaction and get its standard enthalpy, entropy and Gibbs energy change, the equilibrium constant, ΔG and K at other temperatures, and the temperature where the reaction turns spontaneous. Values for 38 common substances fill in by themselves; type your own for anything else. Psychrometric and heat stress calculator #34 From the air temperature and humidity (or dew point, or wet bulb), get every moist air property with the ASHRAE equations, a psychrometric chart, the heat index and the humidex. Solutions and dilutions calculator #30 Work out how much to weigh for a solution in M, mM, mg/mL, % w/v or ppm, how much stock to dilute, and a full serial dilution plan with volumes for every tube.