1. Home
  2. Calculators
  3. Ideal Gas Law Calculator

Ideal Gas Law Calculator

For chemistry and physics: enter three of the four quantities in any units and get the fourth, plus the gas mass and density if you give a formula.

Free, no sign-up. Runs in your browser: nothing is uploaded.

Free workspace included. Docs, spreadsheets, notes and tasks that save on your device. No sign-up.Take a look

How to use Ideal Gas Law Calculator

  1. Enter your numbers, or press a sample to see an example.
  2. Read the results and the table under them.
  3. Copy the results or download the table as a CSV file.

Features

  • Solve for P, V, n or T
  • Six pressure units, four volume units and three temperature scales
  • Molar volume and number of molecules
  • Mass and density from a formula such as N2
  • Converted internally to SI, so units cannot be mixed up

Supported formats

Input

  • Typed numbers

You get

  • On-screen results
  • Copyable text
  • CSV table

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Ideal Gas Law Calculator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • It assumes an ideal gas; real gases deviate at high pressure and low temperature.
  • Mixtures need the total moles.

Guide

The ideal gas law PV = nRT: solving for pressure, volume, moles or temperature

The ideal gas law joins four properties of a gas, its pressure, volume, amount and temperature, in one equation: PV = nRT. It describes air in a tire, gas in a cylinder, the products of a reaction collected over water and the lungs of a diver, as long as the gas is not too dense or cold. This calculator solves it for any one of the four, in the units you have to hand, and also reports the molar volume, the number of molecules and, given a formula, the mass and the density of the gas.

The equation and its constant

P is the pressure, V the volume, n the amount of gas in moles, T the absolute temperature and R the gas constant, 8.314462618 J/(mol·K), exact by definition since the 2019 revision of the SI. In other units R is 0.082057 L·atm/(mol·K). Because all units are converted internally to pascals, cubic meters, moles and kelvin, you never have to choose the right value of R, and a mistake such as mixing kPa with litres in atmosphere units cannot happen.

Units

Pressure can be entered in atm, kPa, Pa, bar, mmHg or psi, volume in litres, millilitres, cubic meters or cubic centimetres, and temperature in °C, K or °F. The result is shown in your chosen units and in the common alternatives: a pressure line lists the value in each unit, for example 1 atm = 101.325 kPa = 101,325 Pa = 1.01325 bar = 759.99989 mmHg = 14.695949 psi. A temperature at or below absolute zero is rejected with a message.

Solving for one unknown

Choose Solve for: pressure, volume, amount or temperature, and fill in the other three. The page opens on a volume problem: 1 atm, 1 mol and 0 °C give a volume of 22.41397 L, 22,413.97 mL, with a molar volume of 22.41397 L/mol and 6.02214 × 10²³ molecules. At room temperature, 25 °C and 101.325 kPa, one mole fills 24.465404 L. A fixed amount of gas obeys P₁V₁/T₁ = P₂V₂/T₂, which is the same law applied twice.

Worked examples

Pressure: 2 mol in 10 L at 300 K gives 498.86776 kPa, which is 4.923442 atm, 4.9886776 bar or 3,741.8154 mmHg. Amount: a 5 L cylinder at 2 atm and 20 °C holds 0.41571197 mol, a molar volume of 12.027558 L/mol and 2.50348 × 10²³ molecules. Temperature: 0.5 mol at 1 atm in 15 L is at 365.59789 K, which is 92.447891 °C or 198.4062 °F. Each is a sample chip.

Mass and density

Enter a molar mass in g/mol or a formula. For nitrogen, N2, 28.014 g/mol, one mole at 0 °C and 1 atm weighs 28.014 g and the gas has a density of 1.2498455 g/L. The 5 L cylinder of the example holds 11.645755 g of nitrogen at 2.329151 g/L. Density rises with pressure and falls with temperature, which is why hot-air balloons float: the heated air is less dense than the cool air around it.

Standard conditions

Several reference conditions are in use. At 0 °C and 1 atm the molar volume of an ideal gas is 22.414 L, the older standard temperature and pressure. The IUPAC standard of 0 °C and 100 kPa gives 22.711 L, and the commonly quoted room-temperature figure at 25 °C and 1 bar is 24.79 L. Because they differ by a few percent, always state the conditions with a molar volume. The molar volume row for your inputs shows the exact value.

Limits

Real gases follow the ideal law well at low pressure and high temperature and deviate at high pressure, near their condensation point and for gases with strong attractions. The tool has no correction such as the van der Waals equation, and it treats mixtures through the total moles. It gives no advice on handling pressurised containers, which depends on their rating and regulations. Pressure here is absolute pressure, not the gauge reading on a tank.

Checked against the current version of the Ideal Gas Law Calculator on .

Frequently asked questions

Why must the temperature be in kelvin in the equation?

Because the gas law is proportional to absolute temperature: doubling the kelvin temperature doubles the volume at constant pressure, but doubling the Celsius value does not. You can type °C or °F and the tool converts to kelvin for you, rejecting values at or below absolute zero, 0 K or −273.15 °C, where the law gives nonsense.

How does the tool get the density of a gas?

From ρ = PM / RT, where M is the molar mass. Enter a formula such as N2 or CO2, or a molar mass in g/mol, and the page gives the mass of the gas and its density. For nitrogen at 0 °C and 1 atm it is 1.2498455 g/L; at 25 °C and 101.325 kPa it is 1.1450455 g/L, because the same mass occupies a larger volume when warmer.

Which value of R is used?

R = 8.314462618 J/(mol·K), which is exact in the 2019 SI. It equals 0.082057 L·atm/(mol·K).

When does the ideal gas law fail?

At high pressure or low temperature near the boiling point, where molecules attract each other and take up space.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.