NOTACAL logo

Ideal Gas Law Calculator

Ideal Gas Law Calculator

Give us your feedback! Was this useful?

Introduction

The ideal gas law is one of the most fundamental relationships in chemistry and physics, describing how pressure, volume, temperature, and the amount of gas relate to one another. Expressed as PV = nRT, it combines several simpler gas laws discovered over two centuries of scientific investigation. The model assumes gas molecules occupy negligible volume, exert no intermolecular forces, and undergo perfectly elastic collisions — assumptions that work well for real gases at moderate temperatures and low pressures.

The ideal gas law emerged from the work of multiple scientists. Robert Boyle (1662) established the inverse relationship between pressure and volume at constant temperature. Jacques Charles (1787) and Joseph Louis Gay-Lussac (1802) showed the direct proportionality between volume and absolute temperature. Amedeo Avogadro (1811) proposed that equal volumes of gases at the same temperature and pressure contain equal numbers of molecules. The universal gas constant R unifies these relationships into a single equation, with its precise value determined by the choice of units.

This Ideal Gas Law Calculator provides four modes: the full PV = nRT equation for solving any one variable, Boyle's Law for constant-temperature processes, Charles's Law for constant-pressure processes, and the Combined Gas Law. You can choose between different values of the gas constant R depending on your preferred units.

[chemlibre-gas]

How to Use

The calculator offers four modes accessible from the dropdown selector.

Mode 1: PV = nRT. Enter any three of the four variables (pressure in atm, volume in L, moles in mol, temperature in K) and leave the fourth blank. The calculator solves for the missing value. You can also select the gas constant R from a dropdown — the default value is 0.082057 L·atm/(mol·K), which is most convenient for pressure in atmospheres and volume in liters. This mode auto-calculates as you type.

Mode 2: Boyle's Law (P₁V₁ = P₂V₂). For processes at constant temperature, enter three of the four variables (initial pressure, initial volume, final pressure, final volume). The calculator solves for the missing value. Boyle's Law describes the inverse relationship: doubling the pressure halves the volume, and vice versa.

Mode 3: Charles's Law (V₁/T₁ = V₂/T₂). For processes at constant pressure, enter three of the four variables (initial volume, initial temperature, final volume, final temperature). Temperatures must be in Kelvin. Charles's Law describes the direct relationship: doubling the absolute temperature doubles the volume.

Mode 4: Combined Gas Law (P₁V₁/T₁ = P₂V₂/T₂). For processes where both pressure and temperature change, enter five of the six variables. Leave the unknown value blank.

[nist-ideal-gas]

Example Calculation

Calculate the volume of 1 mole of an ideal gas at standard temperature and pressure (STP: 0°C = 273.15 K, 1 atm).

V=nRTP=(1 mol)(0.082057 L0˘0B7atm/mol0˘0B7K)(273.15 K)1 atm=22.414 LV = \frac{nRT}{P} = \frac{(1 \text{ mol})(0.082057 \text{ L\u00B7atm/mol\u00B7K})(273.15 \text{ K})}{1 \text{ atm}} = 22.414 \text{ L}

This result — 22.414 L at STP — is the molar volume of an ideal gas. For comparison, this is slightly larger than a standard 5-gallon bucket (18.93 L) and about the size of a medium beach ball.

Example 2: Finding Molar Mass. A 0.500 g sample of an unknown gas occupies 0.250 L at 1.00 atm and 25.0°C (298.15 K). What is the molar mass of the gas?

First, find the number of moles using PV = nRT:

n=PVRT=(1.00)(0.250)(0.082057)(298.15)=0.01022 moln = \frac{PV}{RT} = \frac{(1.00)(0.250)}{(0.082057)(298.15)} = 0.01022 \text{ mol}

Then divide the mass by the moles to find the molar mass:

M=0.500 g0.01022 mol=48.9 g/molM = \frac{0.500 \text{ g}}{0.01022 \text{ mol}} = 48.9 \text{ g/mol}

This molar mass is consistent with ozone (O₃, 48.00 g/mol) or a mixture of nitrogen oxides. This technique, known as the Dumas method, was historically important for determining the molecular weights of volatile compounds and remains useful in teaching laboratories.

Example 3: Boyle's Law Application. A gas occupies 5.00 L at 2.00 atm. If the temperature remains constant, what volume will it occupy at 4.00 atm?

P1V1=P2V2P_1 V_1 = P_2 V_2
V2=P1V1P2=(2.00)(5.00)4.00=2.50 LV_2 = \frac{P_1 V_1}{P_2} = \frac{(2.00)(5.00)}{4.00} = 2.50 \text{ L}

This inverse relationship is why a balloon shrinks when external pressure increases, such as during a deep-sea dive, and expands when pressure decreases, as during an ascent in an unpressurized aircraft.

[engtoolbox-ideal]

The Formula

The ideal gas law combines Boyle's, Charles's, and Avogadro's laws into a single equation:

PV=nRTPV = nRT
[chemlibre-gas]

Where:

  • P is the absolute pressure of the gas (atm, kPa, or other pressure unit)
  • V is the volume the gas occupies (L, m³, or other volume unit)
  • n is the amount of gas (moles)
  • R is the universal gas constant
  • T is the absolute temperature (Kelvin)

The value of R depends on the units used:

R=0.082057 L0˘0B7atm/(mol0˘0B7K)R = 0.082057 \text{ L\u00B7atm/(mol\u00B7K)}
R=8.314462 J/(mol0˘0B7K)R = 8.314462 \text{ J/(mol\u00B7K)}
R=1.987204 cal/(mol0˘0B7K)R = 1.987204 \text{ cal/(mol\u00B7K)}
[nist-codata]

The Individual Gas Laws

Boyle's Law (constant temperature):

P1V1=P2V2P_1 V_1 = P_2 V_2

Charles's Law (constant pressure):

V1T1=V2T2\frac{V_1}{T_1} = \frac{V_2}{T_2}

Gay-Lussac's Law (constant volume):

P1T1=P2T2\frac{P_1}{T_1} = \frac{P_2}{T_2}

Avogadro's Law (constant pressure and temperature):

V1n1=V2n2\frac{V_1}{n_1} = \frac{V_2}{n_2}

Combined Gas Law:

P1V1T1=P2V2T2\frac{P_1 V_1}{T_1} = \frac{P_2 V_2}{T_2}
[rsc-gas]

Common Gas Properties Reference Table

The following table lists physical properties of common gases under standard conditions (1 atm, 273.15 K).

GasFormulaMolar Mass (g/mol)Density at STP (g/L)Boiling Point (°C)
HydrogenH₂2.0160.0899-252.9
HeliumHe4.0030.1785-268.9
NitrogenN₂28.0131.251-195.8
OxygenO₂31.9991.429-183.0
Carbon DioxideCO₂44.0101.977-78.5 (sublimes)
MethaneCH₄16.0430.717-161.5
AmmoniaNH₃17.0310.769-33.3
ChlorineCl₂70.9063.214-34.0
Density of common gases at STP (g/L)
[khan-gas]

Practical Tips

Always use absolute temperature in Kelvin. The gas laws require temperature measured from absolute zero. To convert from Celsius to Kelvin, add 273.15: K = °C + 273.15. For example, room temperature (25°C) is 298.15 K, and the freezing point of water (0°C) is 273.15 K. Never use Celsius or Fahrenheit directly in gas law calculations — the proportionality relationships break down because these scales have arbitrary zero points.

Choose the right value of R for your units. The calculator provides three common values of the gas constant. The default (0.082057 L·atm/(mol·K)) is most convenient when working with atmospheres and liters. The SI value (8.314462 J/(mol·K) = 8.314462 L·kPa/(mol·K)) is needed for energy calculations and when using SI pressure units (pascals). Always ensure your pressure and volume units are consistent with the R value you select.

The ideal gas law is an approximation. Real gases deviate from ideal behavior at high pressures and low temperatures, where intermolecular forces become significant and molecular volume is no longer negligible. The van der Waals equation adds correction terms for these effects. A useful rule of thumb: the ideal gas law is accurate to within about 5% for gases at pressures below 10 atm and temperatures above 0°C. For industrial applications involving high pressures, use real gas equations of state such as the Peng-Robinson or Soave-Redlich-Kwong models.

Standard conditions vary by field. In chemistry, standard temperature and pressure (STP) is traditionally 0°C (273.15 K) and 1 atm, giving a molar volume of 22.414 L. However, the International Union of Pure and Applied Chemistry (IUPAC) has defined STP as 0°C and 100 kPa (0.987 atm) since 1982, producing a molar volume of 22.711 L. In engineering, standard conditions often refer to 60°F (15.56°C) and 14.696 psi (1 atm). Always check what standard your data uses.

Dalton's Law of Partial Pressures. In a mixture of gases, each gas exerts the same pressure as if it alone occupied the container. The total pressure is the sum of all partial pressures. This principle is essential for scuba diving, where air tanks contain 21% O₂ and 79% N₂: the partial pressure of oxygen at 1 atm is 0.21 atm, but at 30 meters depth (4 atm absolute), the partial pressure of oxygen reaches 0.84 atm, approaching the threshold for oxygen toxicity. Dalton's Law also governs the composition of Earth's atmosphere, where water vapor partial pressure determines humidity.

Real gas applications and limitations. The van der Waals equation introduces correction terms for molecular volume (b) and intermolecular attraction (a) to improve accuracy for real gases: (P + a(n/V)²)(V - nb) = nRT. For carbon dioxide, the van der Waals constants are a = 3.59 L²·atm/mol² and b = 0.0427 L/mol. At 1 atm and 25°C, the van der Waals correction to the molar volume of CO₂ shifts it from 24.47 L (ideal) to 24.39 L (real), a negligible 0.3% difference. However, at 100 atm and 25°C, CO₂ deviates by more than 60% from ideal behavior because it is close to its condensation point. This is why industrial gas calculations require equations of state such as Peng-Robinson or Soave-Redlich-Kwong for accurate process design.

[engtoolbox-ideal]

Limitations

This calculator implements the classical ideal gas law, which assumes gas molecules occupy zero volume and exert no intermolecular forces. At high pressures (above 100 atm) or low temperatures (near the boiling point), real gases deviate substantially from ideal behavior. The calculator does not account for gas compressibility (Z-factor), which can be less than 0.3 for some gases under high pressure. It also does not model phase changes, gas mixtures with non-ideal mixing behavior, or chemical reactions that consume or produce gas. For these scenarios, use real gas equations of state or specialized chemical process simulation software.

Frequently Asked Questions

What is the ideal gas law?
The ideal gas law (PV = nRT) relates the pressure, volume, amount (moles), and temperature of an ideal gas. It combines Boyle’s law, Charles’s law, and Avogadro’s law into a single equation. It is the most widely used equation in gas calculations and forms the foundation for thermodynamics and physical chemistry.
What is the gas constant R?
The gas constant R is a physical constant that appears in the ideal gas law. Its value depends on the units used: 0.082057 L·atm/(mol·K) for pressure in atm, 8.314462 J/(mol·K) for SI units, and 1.987204 cal/(mol·K) for energy calculations. The NIST CODATA value for R is 8.314462618 J/(mol·K) with a relative uncertainty of 1.9 × 10⁻⁷.
What is standard temperature and pressure (STP)?
In chemistry, traditional STP is 0°C (273.15 K) and 1 atm pressure, where one mole of ideal gas occupies 22.414 L. IUPAC redefined STP in 1982 to 0°C and 100 kPa (0.987 atm), giving a molar volume of 22.711 L. In engineering, standard conditions are often 60°F (15.56°C) and 14.696 psi. Always verify which standard your data uses.
Can the ideal gas law be used for liquids?
No. The ideal gas law only applies to gases. Liquids have negligible compressibility and their volume does not change significantly with pressure or temperature in the same way. For liquids, use the density equation (ρ = m/V) or specific volume relationships.
What is the difference between absolute pressure and gauge pressure?
Absolute pressure is measured relative to a perfect vacuum, while gauge pressure is measured relative to atmospheric pressure. The ideal gas law requires absolute pressure. To convert: P_absolute = P_gauge + P_atmospheric. At sea level, atmospheric pressure is approximately 1 atm, 101.325 kPa, or 14.696 psi. A tire gauge reading of 32 psi corresponds to 46.696 psi absolute.
What happens when a real gas deviates from ideality?
Real gases deviate at high pressures (where molecular volume matters) and low temperatures (where intermolecular attraction is significant). The compressibility factor Z = PV/nRT quantifies deviation: Z = 1 for ideal gases, Z < 1 when attractive forces dominate, and Z > 1 when repulsive forces dominate. For most common gases at room temperature and atmospheric pressure, Z is very close to 1.
How do gas mixtures work?
For gas mixtures, the ideal gas law applies to the total mixture using the total number of moles. Dalton’s law states that the total pressure equals the sum of partial pressures of each component. The partial pressure of each gas depends on its mole fraction: P_i = x_i × P_total. This principle is essential for breathing gas calculations, atmospheric science, and chemical reactor design.
What are the four assumptions of the kinetic molecular theory?
The kinetic molecular theory makes four key assumptions: (1) gas particles are in constant random motion, (2) the volume of gas particles is negligible compared to the container volume, (3) collisions between gas particles and container walls are perfectly elastic (no energy loss), and (4) gas particles do not exert attractive or repulsive forces on each other. These assumptions are most accurate at high temperatures and low pressures.
What is the Dumas method for molar mass determination?
The Dumas method, developed by French chemist Jean-Baptiste Dumas in the 19th century, determines the molar mass of a volatile liquid by vaporizing a known mass in a heated flask at atmospheric pressure and measuring the displaced volume of air. Using PV = nRT, the number of moles is calculated from the measured volume, temperature, and pressure, then divided into the sample mass to yield the molar mass. This method was historically crucial for establishing molecular formulas of organic compounds.
What units must temperature be in for gas law calculations?
Gas laws require absolute temperature measured in Kelvin (K). To convert from Celsius: K = °C + 273.15. From Fahrenheit: K = (°F + 459.67) × 5/9. Using Celsius or Fahrenheit directly will produce incorrect results because these scales have arbitrary zero points. The Kelvin scale starts at absolute zero (−273.15°C), where molecular motion theoretically ceases. Room temperature (25°C) equals 298.15 K, and the freezing point of water (0°C) equals 273.15 K.

References

  1. [1]NIST. Ideal Gas Law and Thermodynamic Properties of Fluids.
  2. [2]LibreTexts Chemistry. The Ideal Gas Law.
  3. [3]Engineering Toolbox. Ideal Gas Law and Gas Constant Values.
  4. [4]NIST CODATA. Value of the Molar Gas Constant R.
  5. [5]Royal Society of Chemistry. The Ideal Gas Equation.
  6. [6]Khan Academy. Ideal Gas Law.

Last updated: July 27, 2026

1b

UnByte — Independent Software Engineering

Every calculator references authoritative sources — Editorial policy