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.
Gas Laws Calculator
Apply Boyle's law, Charles's law and the ideal gas equation
How to use the ideal gas law calculator
- Under Calculate, choose Ideal, then what to find: P, V, n or T.
- 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.
- 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.
- Read the answer, then the working: the formula, the rearranged form and your numbers.
- 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
| To find | Rearranged |
|---|---|
| Pressure | P = nRT ÷ V |
| Volume | V = nRT ÷ P |
| Amount of gas | n = PV ÷ RT |
| Temperature | T = 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 value | Units 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?
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:
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?
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?
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:
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?
What is the value of R?
How do you find moles with PV = nRT?
What units do you use in the ideal gas law?
What volume does one mole of gas occupy?
When does the ideal gas law not work?
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