Ideal Gas Law Calculator

An ideal gas law calculator finds any missing property of a gas sample when you know the other three. It uses the equation PV = nRT to solve for pressure, volume, substance amount in moles, or absolute temperature. This tool gives you instant answers for chemistry labs, physics coursework, and engineering estimates without requiring manual unit conversions.

Choose which variable to calculate

8.3144626182 J/(molĀ·K)

Universal constant (8.314 Pa·m³/(mol·K))

Enter values to calculate ideal gas properties

Results will appear here with comprehensive analysis

Portrait of James Caldwell

Created by James Caldwell

Last updated: September 23, 2026

How the Ideal Gas Law Works

The ideal gas equation ties together four fundamental physical properties of a gas sample. In simple terms, it describes how a gas expands when heated, compresses when squeezed, and exerts more force as you pack more gas particles into a fixed space.

Diagram breaking down the variables of the ideal gas law formula PV equals nRT with measurement icons.

The standard equation is written as:

PV=nRTPV = nRT

Here is what each letter represents:

  • PP is Pressure: The physical force that gas particles exert against the walls of their container per unit area. It can be measured in atmospheres (atm), kilopascals (kPa), pascals (Pa), bar, pounds per square inch (psi), or millimeters of mercury (mmHg).
  • VV is Volume: The three-dimensional space occupied by the gas. Common units include liters (L), cubic meters (m³), milliliters (mL), and cubic feet (ft³).
  • nn is Amount of Substance: The quantity of gas measured in moles (mol). One mole equals approximately 6.022 Ɨ 10²³ particles (Avogadro's number). You can also find moles by dividing a gas sample's total mass by its molar mass.
  • RR is the Universal Gas Constant: A fixed physical constant that aligns the units across pressure, volume, amount, and temperature. Its exact numeric value depends entirely on the units you pick for pressure and volume.
  • TT is Absolute Temperature: The average kinetic energy of the gas particles. Temperature in this equation must always be measured on an absolute scale, specifically Kelvin (K) or Rankine (°R). Never use Celsius or Fahrenheit directly in the calculation.

When you change one variable, at least one other variable must shift to maintain balance. For instance, if you cut the container volume in half while keeping the temperature and mole count identical, the pressure must double.

Choosing the Right Gas Constant (R)

The value of R must match the specific units used for pressure and volume. If your units do not match your constant, your answer will be completely wrong.

Our calculator automatically handles these unit conversions behind the scenes. However, if you are doing scratch work on paper, refer to these common values for R:

  • 0.082057 LĀ·atm / (molĀ·K): Use this when pressure is in atmospheres and volume is in liters. This is the most common pair taught in introductory chemistry courses.
  • 8.314462 J / (molĀ·K) or m³·Pa / (molĀ·K): Use this when pressure is in pascals and volume is in cubic meters. This is the standard metric (SI) unit pairing used in physics and thermodynamics.
  • 8.314462 LĀ·kPa / (molĀ·K): Useful when pressure is given in kilopascals and volume is in liters.
  • 62.3637 LĀ·mmHg / (molĀ·K) or LĀ·Torr / (molĀ·K): Convenient when laboratory manometers read pressure directly in millimeters of mercury or Torr.
  • 10.7316 ft³·psi / (lbmol·°R): Used in US customary engineering work where volume is in cubic feet, pressure is in psi, and temperature is in Rankine.

How to Rearrange the Equation

Depending on which property you want to find, you can rearrange the primary formula algebraically:

  • Solving for Pressure (P): P=nRT/VP = nRT / V
  • Solving for Volume (V): V=nRT/PV = nRT / P
  • Solving for Amount of Substance (n): n=PV/RTn = PV / RT
  • Solving for Temperature (T): T=PV/nRT = PV / nR

If you need to find the physical mass (m) or density of a gas rather than pure moles, you can expand the equation. Because moles equal mass divided by molar mass (n = m / M), you can rewrite the formula as:

PV=(m/M)RTPV = (m / M)RT

Rearranging this variation allows you to calculate the density (ρ=m/V\rho = m / V) of an ideal gas:

ρ=PM/RT\rho = PM / RT

This variation proves useful when identifying unknown gases in a laboratory setting based on their measured vapor density.

Step-by-Step Worked Examples

Working through practical scenarios helps make the unit conversions and algebraic rearrangements clear.

Example 1: Finding Gas Pressure in a Cylinder

Imagine you have a rigid 5.0-liter steel cylinder filled with 0.75 moles of nitrogen gas stored at a room temperature of 25°C. What is the internal pressure in atmospheres?

  1. Identify the given values. V = 5.0 L, n = 0.75 mol, T = 25°C, R = 0.082057 L·atm / (mol·K)
  2. Convert temperature to absolute Kelvin. T = 25 + 273.15 = 298.15 K
  3. Choose the formula solved for pressure. P = nRT / V
  4. Substitute the numbers and calculate. P = (0.75 mol Ɨ 0.082057 LĀ·atm/(molĀ·K) Ɨ 298.15 K) / 5.0 L = 18.349 / 5.0 = 3.67 atm

The gas exerts an internal pressure of approximately 3.67 atmospheres against the cylinder walls.

Example 2: Finding Gas Volume at High Temperature

Suppose a chemical reaction produces 2.40 moles of carbon dioxide gas. The gas is captured at a pressure of 101.325 kPa and an elevated temperature of 120°C. What volume does the gas occupy in liters?

  1. Identify the given values. n = 2.40 mol, P = 101.325 kPa, T = 120°C, R = 8.314462 L·kPa / (mol·K)
  2. Convert temperature to Kelvin. T = 120 + 273.15 = 393.15 K
  3. Choose the formula solved for volume. V = nRT / P
  4. Substitute the numbers and calculate. V = (2.40 mol Ɨ 8.314462 LĀ·kPa/(molĀ·K) Ɨ 393.15 K) / 101.325 kPa = 7845.24 / 101.325 = 77.43 L

The carbon dioxide gas occupies 77.43 liters of volume under these conditions.

How the Ideal Gas Law Connects to the Classic Gas Laws

The ideal gas law did not appear out of thin air. It combines several empirical gas relationships discovered by scientists over two centuries:

  • Boyle's Law (P₁V₁ = Pā‚‚Vā‚‚): Shows that pressure and volume are inversely proportional when temperature and mole count stay constant. Squeezing a gas increases its pressure.
  • Charles's Law (V₁/T₁ = Vā‚‚/Tā‚‚): States that volume is directly proportional to absolute temperature when pressure stays constant. Heating a balloon makes it expand.
  • Gay-Lussac's Law (P₁/T₁ = Pā‚‚/Tā‚‚): States that pressure is directly proportional to absolute temperature when volume remains locked. Heating a closed metal tank spikes its internal pressure.
  • Avogadro's Law (V₁/n₁ = Vā‚‚/nā‚‚): Shows that equal volumes of any gas at the same temperature and pressure contain identical numbers of particles.

When you merge these four separate observations into a single mathematical statement, you get PV = nRT.

Understanding Standard Temperature and Pressure (STP)

Scientists often evaluate gases under standardized reference conditions to make comparisons straightforward. The two most common standards are:

  • IUPAC Standard Temperature and Pressure (STP): Defined as 0°C (273.15 K) and an absolute pressure of exactly 100 kPa (1 bar). Under this standard, one mole of an ideal gas occupies approximately 22.71 liters.
  • NIST Standard: Defined as 20°C (293.15 K) and 101.325 kPa (1 atm). Under these conditions, one mole of an ideal gas occupies roughly 24.06 liters.
  • Older Textbook STP: Older educational materials frequently define STP as 0°C (273.15 K) and 1 atm (101.325 kPa). Under this definition, one mole occupies roughly 22.414 liters.

Knowing which standard your assignment or project uses prevents subtle discrepancies in your final volume answers.

Common Mistakes to Avoid

A small oversight during input setup can lead to major calculation errors. Watch out for these four common pitfalls:

1. Forgetting to Convert Temperature to Kelvin

This is the single most frequent error. If you plug 20°C into the equation instead of 293.15 K, your result will be off by a massive factor. If your temperature happens to be negative in Celsius, your calculation would produce physically impossible negative volumes or pressures. Always convert to an absolute scale like Kelvin or Rankine first.

2. Mismatching Pressure and Gas Constant Units

Plugging a pressure value measured in kilopascals into an equation using the 0.082057 gas constant creates an answer that is off by roughly a factor of one hundred. Check that the pressure units inside your constant match your input units perfectly.

3. Confusing Gauge Pressure with Absolute Pressure

Pressure gauges on tire pumps and gas canisters show gauge pressure (psig or bar gauge), which measures pressure relative to the surrounding ambient atmosphere. The ideal gas law demands absolute pressure. You must add ambient atmospheric pressure (roughly 14.696 psi or 1.01325 bar at sea level) to your gauge reading before running the calculation.

4. Confusing Moles with Mass

The variable n represents moles, not grams or ounces. If your laboratory scale tells you that you have 44 grams of carbon dioxide, do not enter 44 into the n field. Divide that mass by the molar mass of carbon dioxide (approximately 44.01 g/mol) to get roughly 1.0 mole first.

Assumptions and Real-World Limitations

The ideal gas model is a theoretical simplification. It assumes two fundamental points:

  • The gas particles themselves have zero physical volume.
  • The gas particles experience zero attractive or repulsive forces between one another.

In reality, gas molecules are physical objects that take up space, and they attract one another weakly through intermolecular forces.

When the Ideal Gas Model Works Well

The ideal gas law is accurate for most common gases (such as air, nitrogen, oxygen, and helium) at:

  • Standard room temperatures or higher
  • Normal atmospheric pressures or low pressures

Under these conditions, gas particles stay far apart from one another and zip around with high kinetic energy. Their molecular volume and intermolecular attractions are tiny enough to ignore.

When the Model Breaks Down

The ideal gas assumption begins to fail under two specific conditions:

  • Very High Pressures: High pressure crowds gas molecules tightly together. At that point, the physical volume of the molecules themselves takes up a noticeable percentage of the container space.
  • Very Low Temperatures: Low temperature slows the molecules down. When moving slowly, the attractive forces between passing molecules pull them off course, reducing the force of their impacts against the container walls.

Near a gas's condensation point, these real-world effects become dominant. In those scenarios, engineers turn to more complex real-gas models, such as the Van der Waals equation or the Redlich-Kwong equation, which incorporate specific adjustment factors for molecular volume and intermolecular pull.

Frequently Asked Questions

Can temperature be negative in the ideal gas calculation?

No. Temperature must always be entered on an absolute temperature scale like Kelvin or Rankine, where absolute zero (0 K) is the lowest possible physical limit. Negative values on absolute scales do not exist in real physical systems.

What is the difference between R and the specific gas constant?

The universal gas constant (R) applies to any gas as long as amount is measured in moles. Mechanical engineers often use a specific gas constant (RspecificR_{specific}), which divides R by the gas's molar mass so the equation works directly with mass in kilograms instead of moles.

What gas behaves most like an ideal gas?

Helium behaves most like an ideal gas under normal conditions, closely followed by hydrogen. Both consist of tiny, lightweight particles with weak intermolecular forces, which allows them to closely match ideal behavior over a wide temperature range.

Does the ideal gas law work for gas mixtures like air?

Yes. As long as the gases do not chemically react with each other, you can treat a mixture like ambient air as a single ideal gas. The total number of moles equals the sum of all individual gas moles in the mixture.

Why does gas pressure increase when heated inside a closed container?

Heating a gas raises the average speed and kinetic energy of its particles. Because the particles move faster, they hit the interior container walls more frequently and with greater physical force, which registers as higher pressure.

How do I convert gauge pressure to absolute pressure?

Add local atmospheric pressure to your gauge reading. At sea level, standard atmospheric pressure is roughly 1.01325 bar, 101.325 kPa, or 14.696 psi. For example, a tire gauge reading 32.0 psi represents an absolute pressure of about 46.7 psi.

How do I find the molar mass of an unknown gas?

Rearrange the formula to solve for molar mass: M=mRT/PVM = mRT / PV. Measure the physical mass (m) of your gas sample, its temperature (T), its pressure (P), and the volume of the container (V). Solving this expression gives you the molar mass in grams per mole.

Is water vapor considered an ideal gas?

Water vapor behaves reasonably well as an ideal gas at high temperatures and low pressures, such as in humid room air. However, steam inside high-pressure industrial boilers deviates significantly from ideal behavior, requiring specialized steam property tables.

Related Calculators