Ideal Gas Law Calculator (PV = nRT)

The ideal gas law connects the pressure, volume, temperature and amount of a gas. Enter pressure in kPa, volume in litres and temperature in °C to get the number of moles and the mass of gas.

How it is calculated

Enter pressure, volume and temperature.

Optionally enter the molar mass.

Read moles and mass.

Formula

Ideal gas law: PV = nRT

Moles: n = PV ÷ RT

What is the Ideal Gas Law Calculator (PV = nRT)?

The ideal gas law connects four properties of a gas: pressure, volume, temperature and amount. This calculator solves PV = nRT for n, the number of moles, when you enter pressure in kPa, volume in litres and temperature in °C. If you also enter the molar mass, it converts moles into grams, so you can tell how much gas by mass is in a container.

Class 11 chemistry introduces the law in the chapter on states of matter, and it underlies questions in JEE and NEET. It is also practical: it helps estimate how much oxygen is in a hospital cylinder, how much air a tyre holds, or how many moles of gas a reaction released into a flask of known volume.

How to calculate it by hand

1. Write the pressure in kPa. Convert atm by multiplying by 101.325, and bar by multiplying by 100.

2. Write the volume in litres. Convert m³ by multiplying by 1000, and mL by dividing by 1000.

3. Convert the temperature to kelvin: T = °C + 273.15.

4. Calculate n = PV ÷ RT with R = 8.314. With kPa and litres, the units work out to moles directly.

5. If you want the mass, multiply n by the molar mass in g/mol.

6. Sanity-check: at 0 °C and 101.325 kPa, 22.4 L should give about 1 mol.

Why kPa and litres fit R = 8.314

R is 8.314 J/mol·K, and one joule is one pascal times one cubic metre. A kilopascal is 1000 Pa and a litre is 0.001 m³, so kPa × L = 1000 × 0.001 Pa·m³ = 1 J. That means you can use R = 8.314 with kPa and litres without any conversion factor. If you work in atm and litres instead, you must use R = 0.08206 L·atm/mol·K. Mixing a pressure unit from one system with R from another is a very common error.

Where the law comes from

The law combines three older observations: Boyle's law (PV constant at fixed T), Charles's law (V proportional to T at fixed P), and Avogadro's law (V proportional to n at fixed P and T). Kinetic theory explains it. Gas molecules move randomly and hit the walls, creating pressure. Their average kinetic energy is proportional to absolute temperature. More molecules, or faster ones, give more collisions per second, and a larger container spreads those collisions over more wall area.

When real gases are not ideal

The ideal model assumes molecules have no size and do not attract each other. That is close to true for gases like nitrogen, oxygen and helium at ordinary conditions. At high pressure the molecules' own volume matters, and at low temperature their attractions pull them together, so the real volume differs from nRT ÷ P. Gases near condensation, like steam or ammonia under pressure, deviate most. The van der Waals equation adds two correction terms for these effects, studied in Class 11.

Worked example, step by step

A lab assistant in Kolkata checks a 10-litre steel cylinder of oxygen at 500 kPa and 30 °C, and wants to know the amount of gas and its mass using a molar mass of 32 g/mol.

Convert temperature to kelvin: T = 30 + 273.15 = 303.15 K

n = PV ÷ RT: = 500 kPa × 10 L ÷ (8.314 × 303.15) = 1.983821 mol

Mass = n × molar mass: = 1.983821 × 32 = 63.4823 g

Answer: Amount of gas 1.983821 mol; Mass 63.4823 g; Temperature 303.15 K

Common mistakes to avoid

Entering temperature in °C into PV = nRT by hand without adding 273.15.

Using R = 8.314 with pressure in atm, or R = 0.0821 with pressure in kPa.

Reading a gauge pressure as the absolute pressure; add atmospheric pressure to a gauge reading.

Using mL or m³ for volume while keeping R = 8.314 with kPa.

Applying the ideal gas law to a liquid, or to a gas very near condensation.

Where it is used

Class 11 chemistry and physics problems on gases, and JEE and NEET preparation.

Estimating the amount of gas in cylinders for labs, welding or hospitals.

Finding the moles of gas produced in a reaction collected in a known volume.

Calculating air density and mass in rooms, ducts and balloons.

Checking tyre and pressure-vessel behaviour as temperature changes.

Frequently asked questions

Why must temperature be in kelvin?

Gas laws are proportional to absolute temperature, which starts at absolute zero.

When does the ideal gas law fail?

At very high pressure or very low temperature, where real gas molecules attract each other.