Uni-Sine
Physics
+25XP
PhysicsThermal physics and matter

Ideal gas law calculator

An ideal gas law calculator solves PV = nRT, which links the pressure P, volume V, amount n in moles and kelvin temperature T of a gas, with the gas constant R = 8.314 J/(mol K). Give it any three and it finds the fourth: 1 mol of gas at 0 °C and 1 atm fills 22.4 L. Our Gas Laws Calculator has an Ideal mode that finds P, V, n or T, in whatever units you have, and shows the working.

The calculator opens on Boyle's law. To switch it to the ideal gas law, choose Ideal in the top row under Calculate.

Try it

Gas Laws Calculator

Apply Boyle's law, Charles's law and the ideal gas equation

Go to its page

How to use the ideal gas law calculator

  1. Under Calculate, choose Ideal, then what to find: P, V, n or T.
  2. Type the three values you know. Each mode starts on an example, such as 1 mol at 273.15 K and 101,325 Pa, so clear it first.
  3. Pick each unit from its box: pressure in Pa, kPa, bar, atm, mmHg or psi; volume in cm³, mL, L or m³; temperature in K, °C or °F. The calculator converts to SI units before it uses R = 8.314.
  4. Read the answer, then the working: the formula, the rearranged form and your numbers.
  5. Check the extra readings: the number of molecules, and the mean kinetic energy of one molecule.

The same calculator has Boyle's law, Charles's law, the pressure law and the combined gas law, each in the top row. Practice and help sets ideal gas questions with worked solutions.

The ideal gas law formula

PV = nRTP in Pa, V in m³, n in mol, T in K, R = 8.314 J/(mol K)
To findRearranged
PressureP = nRT ÷ V
VolumeV = nRT ÷ P
Amount of gasn = PV ÷ RT
TemperatureT = PV ÷ nR

NIST gives R as 8.314462618 J/(mol K); the calculator uses 8.314. In litres and atmospheres, R = 0.08206 L atm/(mol K), which is why some textbooks write it that way. Whatever units you use, the temperature must be in kelvin: T(K) = T(°C) + 273.15. A gas behaves most like an ideal gas at low pressure and high temperature, where its molecules are far apart.

R valueUnits it goes with
8.314 J/(mol K)P in Pa, V in m³
8.314 L kPa/(mol K)P in kPa, V in L
0.08206 L atm/(mol K)P in atm, V in L
62.36 L mmHg/(mol K)P in mmHg, V in L

Worked examples you can check in the calculator

Example 1: molar volume

What volume does 1 mol of an ideal gas fill at 0 °C and 1 atm?

V = \frac{1 \times 8.314 \times 273.15}{101325} = 0.02241\ \text{m}^3 = 22.4\ \text{L}

Choose Ideal, then V. These are the values the mode opens on, and the calculator gives 0.022413 m³. Set the volume unit to L to read 22.41 L. At 20 °C the same mole fills 24.1 L.

Example 2: moles in a cylinder

A 5.0 L cylinder holds gas at 200 kPa and 20 °C. How many moles are in it? In SI units, V = 0.0050 m³, P = 200,000 Pa and T = 293.15 K:

n = \frac{200000 \times 0.0050}{8.314 \times 293.15} = 0.410\ \text{mol}

Choose n, set the units to kPa, L and °C, and type 200, 5 and 20. The calculator gives 0.4103 mol, which is 2.47 × 10²³ molecules. If the gas is oxygen, with a molar mass of 32.00 g/mol, that is 0.410 × 32.00 = 13.1 g.

Example 3: pressure

0.50 mol of gas is sealed in a 2.0 L container at 37 °C. What is the pressure?

P = \frac{0.50 \times 8.314 \times 310.15}{0.0020} = 644600\ \text{Pa} = 645\ \text{kPa}

The calculator gives 644,647 Pa. Switch the pressure unit to atm and it reads 6.36 atm.

Example 4: temperature

0.60 mol of gas in 10 L at 150 kPa. What is its temperature?

T = \frac{150000 \times 0.010}{0.60 \times 8.314} = 300.7\ \text{K} = 27.5\ °\text{C}

Choose T and type the three values. The calculator gives 300.70 K; set the unit to °C to see 27.5 °C.

Check the one step that catches most people:

practice
Pick an answer, then check it.
A gas is at 25 °C. What temperature do you put into PV = nRT?

Molar mass from the ideal gas law

The calculator has no box for mass, but n = m/M lets you go between them. Say 1.00 g of an unknown gas fills 0.500 L at 100 kPa and 25 °C. The calculator's n mode gives n = 0.02017 mol, so M = 1.00 ÷ 0.02017 = 49.6 g/mol. The same trick gives the mass of a gas once you know n, as in Example 2.

What the calculator does not do

  • Ideal gases only. At high pressures or low temperatures, real gases stray from PV = nRT. The van der Waals equation corrects for this, and is not in the calculator.
  • No mass or density inputs. Convert with n = m/M yourself, as above.
  • No gas mixtures. For partial pressures, apply PV = nRT to each gas, or use the mole fraction: each gas's pressure is its share of the moles times the total.

Common mistakes

  • Using °C. Always convert to kelvin. 0 °C is 273.15 K, not 0.
  • Mixing units with R = 8.314. That value needs Pa and m³. 5 L is 0.005 m³ and 200 kPa is 200,000 Pa. The calculator converts for you if you set the unit boxes.
  • Using R = 0.08206 with kPa. That value goes with atm and litres only.
  • Forgetting cm³ to m³. 1 m³ is 1,000,000 cm³, so divide by 10⁶, not 1,000.
  • Using mass instead of moles. n is in moles. Divide the mass by the molar mass first.

Practise gases in a short timed paper

The ideal gas equation comes up in AP Physics 2 and Honors Chemistry practice, and in A-level Physics: Year 2 and A-level Chemistry: Year 1 in the UK. Each daily paper is a short timed paper of 8 questions worth 25 to 35 marks, and the papers mix topics. For a gas going from one state to another, see our combined gas law calculator guide.

Common questions

What is the ideal gas law?
PV = nRT. It links the pressure, volume, amount in moles and kelvin temperature of a gas, with R = 8.314 J/(mol K).
What is the value of R?
8.314 J/(mol K) in SI units. NIST gives 8.314462618. In litres and atmospheres it is 0.08206 L atm/(mol K).
How do you find moles with PV = nRT?
Rearrange to n = PV ÷ RT. With P in Pa, V in m³ and T in K, the answer is in moles.
What units do you use in the ideal gas law?
With R = 8.314: pascals, cubic metres, moles and kelvin. With R = 0.08206: atmospheres, litres, moles and kelvin.
What volume does one mole of gas occupy?
About 22.4 L at 0 °C and 1 atm, and about 24 L at room temperature, 20 °C, and 1 atm.
When does the ideal gas law not work?
At high pressure or low temperature, when the gas molecules are close together and attract each other. Real gases then differ from PV = nRT.

Revision cards

Say the answer first, then flip the card to check it.

Where to go next

  • Solve it

    Gas Laws Calculator

    Apply Boyle's law, Charles's law and the ideal gas equation

    Open the tool
  • Test it

    AP Physics 2

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
  • Test it

    Honors Chemistry

    A new exam-style paper every day, with instant marking and a mark scheme

    Start today's paper
Read next
Physics · Thermal physics and matterCombined gas law calculator: P1V1/T1 = P2V2/T2Solve the combined gas law P1V1/T1 = P2V2/T2 for pressure, volume or temperature, with Celsius converted to kelvin for you and worked examples.