Ideal Gas Law Calculator: PV = nRT
Solve pressure, volume, moles or temperature with PV = nRT. Use atm, kPa, psi, litres, °C, °F or K and see the number of molecules. Free and private in your browser.
Fill in all but one field: the empty field is the one you solve for.
About the Ideal Gas Law Calculator
The Ideal Gas Law Calculator solves PV = nRT. Fill in any three of Pressure, Volume, Amount of substance and Temperature and the fourth is calculated as you type. It also shows how many molecules the amount contains, using Avogadro's number.
The ideal gas law links the four properties that describe a gas sample. It works well for gases at moderate pressure and well above their boiling point, and it is the basis for much of introductory chemistry and physics. The gas constant is fixed at R = 8.314462618 J/(mol·K), the exact value from the SI definitions.
How to use the ideal gas law calculator
Steps
- Leave the field you want to find empty and fill in the other three.
- Choose units. Pressure: Pa, kPa, bar, atm, psi or mmHg. Volume: m³, L, mL or ft³. Amount: mol or mmol. Temperature: K, °C or °F.
- Read the answer, the substitution, and the number of molecules n × NA.
Pressure, volume and amount must be greater than zero. Temperature is converted to kelvin before the calculation, and a temperature at or below 0 K (−273.15 °C or −459.67 °F) is rejected with a message, because no gas can be at or below absolute zero. A common mistake is using °C directly in the formula. This tool does the conversion for you.
Formula
P is pressure in pascals, V is volume in cubic metres, n is the amount in moles, R is the gas constant and T is the absolute temperature in kelvin. The number of molecules is N = n NA, where NA = 6.02214076 × 10²³ per mole.
Worked examples
Example 1: molar volume at standard conditions
One mole at 273.15 K and 101 325 Pa (1 atm). V = 1 × 8.314462618 × 273.15 ÷ 101 325 ≈ 0.022414 m³, which is 22.414 L.
Example 2: room temperature
One mole at 25 °C (298.15 K) and 1 atm. V ≈ 24.465 L.
Example 3: pressure in a closed container
2 mol of gas in 10 L at 300 K. P = 2 × 8.314462618 × 300 ÷ 0.010 ≈ 498 868 Pa, which is about 498.9 kPa or 4.92 atm.
Example 4: amount of gas in a litre
A 1 L sample at 1 atm and 20 °C (293.15 K). n = 101 325 × 0.001 ÷ (8.314462618 × 293.15) ≈ 0.04157 mol, which is about 2.503 × 10²² molecules.
Good to know
- Gay-Lussac's, Boyle's and Charles's laws are special cases: hold two of P, V, n and T fixed and the other two vary in proportion or inverse proportion.
- Real gases depart from the ideal law at high pressure and low temperature, where molecules take up space and attract each other.
- To convert amount to mass, multiply moles by the molar mass from the Molecular Weight Calculator.
Privacy
Nothing is uploaded; every calculation runs in your browser and never leaves your device.
Related tools
Use the Pressure Calculator for force over area, the Temperature Converter to switch between K, °C and °F, and the Volume Converter for other volume units.
Frequently asked questions
What is the ideal gas law?
It is the equation PV = nRT, relating the pressure, volume, amount of substance and absolute temperature of an ideal gas through the gas constant R = 8.314462618 J/(mol·K).
Which temperature unit should I use?
Use whichever you like. The calculator accepts kelvin, °C and °F and converts to kelvin before solving. The law itself needs absolute temperature, so using °C directly in the formula by hand gives wrong answers.
Why is a temperature of 0 K or below rejected?
Absolute zero, 0 K (−273.15 °C or −459.67 °F), is the lowest possible temperature. At or below it the law has no physical meaning, and solving for volume or pressure would give zero or negative values, so the calculator shows an error.
What is the volume of one mole of gas?
At 273.15 K and 1 atm (101 325 Pa) one mole of an ideal gas occupies about 22.414 litres. At 25 °C and 1 atm it occupies about 24.465 litres.
What units can I use for pressure and volume?
Pressure can be entered in Pa, kPa, bar, atm, psi or mmHg, and volume in m³, L, mL or ft³. The amount of substance is in mol or mmol. Answers are shown in the unit you pick, with other units listed beside it.
How is the number of molecules calculated?
It is the amount in moles times Avogadro's number, 6.02214076 × 10²³ per mole. One millimole contains about 6.022 × 10²⁰ molecules.
When does the ideal gas law stop being accurate?
At high pressure or low temperature, near the point where a gas liquefies, molecules take up real space and attract each other. Use a real-gas model such as the van der Waals equation in those cases.
Does it send my numbers anywhere?
No. The pressure, volume, moles and temperature you enter are solved locally in your browser, and nothing is uploaded, stored or shared with any server.