Ideal Gas Law Calculator

Solve PV = nRT for pressure, volume, amount or temperature.

Ideal Gas Law Calculator tool

Amount given as
—
Answer
—
Formula

About the Ideal Gas Law Calculator

The ideal gas law links pressure, volume, amount and temperature of a gas and appears throughout chemistry and engineering. This ideal gas law calculator solves for any one of the four quantities in the units you have, converting temperatures to kelvins automatically: one mole of gas at 0 °C and 1 atmosphere occupies about 22.4 liters. Real gases deviate at high pressures and low temperatures, so treat results as ideal-case estimates. Students can use the step-by-step working to check homework, and the unit conversions remove the most common source of mistakes, mixing Celsius with kelvins.

In SI units, R = 8.314462618 J/(mol·K), and the calculator converts every input into pascals, cubic meters and kelvin before solving, then converts the answer back. Temperatures must be absolute, so 0 °C becomes 273.15 K; the law gives nonsense with Celsius or Fahrenheit directly. Real gases follow the law closely at ordinary temperatures and pressures, and deviate at high pressures and low temperatures, where molecules attract each other and take up space.

Example: one mole of gas at 0 °C and 1 atm occupies 22.414 L, the classic molar volume at standard temperature and pressure; at 25 °C it takes up about 24.465 L. A 50 L tank at 200 bar and 20 °C holds about 410 moles of gas, roughly 11.5 kg of nitrogen. Heating a sealed container from 20 °C to 80 °C raises its pressure by about 20%.

For the mass of a mole of gas, use the molar mass calculator; for temperature conversions, the temperature converter; and for pressure units, the pressure converter.

How to use the Ideal Gas Law Calculator

  1. Choose what to solve forPressure, volume, moles or temperature.
  2. Enter the other threeType each value and choose its unit.
  3. Use grams if easierGive the mass and molar mass instead of moles.
  4. Read the answerSee the result in your unit and other common units.

Ideal Gas Law Calculator features

  • Solve PV = nRT for any variable
  • Pressure in Pa, kPa, atm, bar, mmHg and psi
  • Volume in L, mL, m³ and ft³
  • Temperature in K, °C and °F
  • Moles from mass and molar mass
  • Gas constant R = 8.314462618 J/(mol·K)
  • Results in several units

Common uses

  • Chemistry and physics homework
  • Gas cylinder contents
  • Balloon and tire pressure with temperature
  • Lab gas preparations
  • Engineering estimates for tanks

The ideal gas law in practice: tyre pressure, CNG cylinders, snack packets at altitude and pressure cookers

By the FreeToolsWorld editorial team · Updated November 2026 · How we write and check our guides

The ideal gas law ties together pressure, volume, temperature and the amount of gas, and it explains everyday observations from tyres that read high after a drive to crisp packets that puff up in the mountains. This guide works through tyre pressure on a hot day, looks at compressed natural gas in cars, explains altitude effects in Pakistan's northern areas and covers pressure cookers and gas cylinders.

A worked example: tyre pressure on a hot day

A tyre is set to 32 psi on the gauge at 20 °C. Gauges show pressure above atmospheric, so the absolute pressure is about 46.7 psi. After a long drive on a hot motorway, the air inside reaches 50 °C. Keeping the volume roughly constant, the absolute pressure rises in proportion to absolute temperature, by 323.15 ÷ 293.15, to about 51.5 psi, so the gauge reads about 36.8 psi.

This is why tyre pressures should be checked when the tyres are cold, before driving. Letting air out of hot tyres to reach the recommended figure leaves them underinflated once they cool.

Temperatures in kelvin

The gas law works only with absolute temperature, measured in kelvin, where 0 °C is 273.15 K. Using Celsius directly gives nonsensical results, such as zero volume at 0 °C. Converting every temperature to kelvin before calculating avoids the most common error in gas problems.

CNG cylinders

Many cars and rickshaws in Pakistan run on compressed natural gas, stored in cylinders at pressures of around 200 bar. Packing that much gas into a cylinder requires strong, regularly inspected tanks, because the stored energy is large. Cylinders exposed to heat, damaged or past their inspection dates can be dangerous, which is why regular testing is required.

Gas cylinders for cooking

LPG cylinders used for cooking store gas as a liquid under moderate pressure, and the pressure depends mainly on temperature rather than on how full the cylinder is. Keeping cylinders upright, away from heat and in ventilated places, and checking connections with soapy water rather than a flame, are basic safety rules.

Altitude and air pressure

Air pressure falls with height. At the Khunjerab Pass, at about 4,700 metres, it is roughly 57% of sea-level pressure. Sealed snack packets bought in the plains puff up on the way north, because the gas inside expands as the outside pressure falls. Visitors also feel breathless, because each breath contains less oxygen, which is why gradual ascent is recommended on mountain trips.

Pressure cookers

A pressure cooker traps steam, raising the pressure inside to around one atmosphere above normal and raising the boiling point of water to about 120 °C. Food cooks much faster at this higher temperature, which is especially useful at high altitude, where water boils below 100 °C. The safety valve and gasket must be kept clean, since a blocked valve can be dangerous.

Weather

Weather systems are partly described by air pressure. High-pressure systems usually bring settled, dry weather, while low-pressure systems bring clouds, wind and rain. Barometers measure these changes, and falling pressure is a traditional sign that the weather is about to turn.

Common mistakes

  • Using Celsius instead of kelvin.
  • Confusing gauge pressure with absolute pressure.
  • Adjusting tyre pressure when the tyres are hot.
  • Assuming the law holds at very high pressures or very low temperatures.

Related tools

To convert pressure units, use Pressure Converter. For temperature conversions, try Temperature Converter, and to convert grams of gas into moles, Molar Mass Calculator.

Breathing and syringes

Breathing in works by expanding the chest, which increases the volume of the lungs and lowers the pressure inside slightly below atmospheric, so air flows in. Breathing out reverses the process. The same relationship between pressure and volume explains how syringes draw in liquid and how bicycle pumps push air into tyres.

Scuba diving

Divers feel pressure rise by about one atmosphere for every 10 metres of seawater. Air in the lungs and in equipment compresses with depth and expands on the way up, which is why divers must never hold their breath while ascending. Training teaches them to manage these changes safely.

Aerosol cans in heat

Aerosol cans and gas lighters contain pressurised gas, and heating them raises the pressure. Leaving them in a closed car in summer sun, where interior temperatures can exceed 60 °C, risks bursting. Storing them somewhere cool, as the label advises, avoids the danger.

Warm air rises

Warm air expands and becomes less dense, which is why it rises and why rooms are warmer near the ceiling. Air conditioners in Pakistani homes are usually mounted high on the wall so that cooled, denser air sinks and spreads through the room, while heaters work best placed low.

Limits

The ideal gas law is an approximation that works well at ordinary temperatures and pressures. Real gases deviate at high pressures and low temperatures.

Frequently asked questions

What is the ideal gas law?

PV = nRT: pressure times volume equals the number of moles times the gas constant times the absolute temperature. It combines Boyle's, Charles's and Avogadro's laws into one equation.

What is the value of R?

8.314462618 J/(mol·K) in SI units. In other units it is 0.082057 L·atm/(mol·K) or 62.364 L·mmHg/(mol·K). The calculator converts units, so you never need to pick one.

Why must temperature be in kelvin?

The law depends on absolute temperature, measured from absolute zero. Using Celsius would make volumes zero or negative at 0 °C. Add 273.15 to a Celsius temperature to get kelvin.

What is the molar volume of a gas?

At 0 °C and 1 atm, one mole of an ideal gas occupies 22.414 L. At 25 °C and 1 atm it is about 24.47 L, and at 0 °C and 1 bar about 22.71 L.

How do I find moles of gas?

Rearrange to n = PV ÷ RT. 10 L at 2 atm and 300 K contains 2 × 101,325 × 0.01 ÷ (8.314 × 300) ≈ 0.81 mol.

When does the ideal gas law fail?

At high pressures and low temperatures, especially near condensation. Then molecular volume and attractions matter, and equations such as van der Waals give better results.

What is STP?

Standard temperature and pressure. Many textbooks use 0 °C and 1 atm, while IUPAC now uses 0 °C and 100 kPa (1 bar). Always check which standard a problem means.

How do I convert grams of gas to moles?

Divide the mass by the molar mass. 32 g of oxygen, O2 at about 32.00 g/mol, is about 1 mole. Enter the grams and molar mass and the calculator does this for you.