Skip to content

Ideal Gas Law Calculator

Updated: 10 comments

Use pressure, temperature, volume, and moles of gas to solve the ideal gas law for one unknown. Enter the three known values in kPa, K, L, and mol.

Solve the Ideal Gas Law

Input Fields
T
K
P
kPa
n
mol
If enabled, the result will update automatically when you change any value.

Ideal Gas Law Formula

Formula
\[PV=nRT\]

Where:

  • \(P\) — pressure (kPa)
  • \(V\) — volume (L)
  • \(n\) — amount of gas (mol)
  • \(R\) — ideal gas constant, \(8.314\ \mathrm{kPa\cdot L/(mol\cdot K)}\)
  • \(T\) — absolute temperature (K)

The equation relates the pressure, volume, temperature, and amount of an ideal gas. With these units, the numerical value of \(R\) is 8.314.

Ideal Gas Law – Calculation Example

Example: Using the default inputs, find the volume of 1 mol of gas at 273 K and 100 kPa.

\[V=\frac{nRT}{P}=\frac{(1\ \mathrm{mol})(8.314\ \mathrm{kPa\cdot L/(mol\cdot K)})(273\ \mathrm{K})}{100\ \mathrm{kPa}}=22.69722\ \mathrm{L}\]

Result: The correct volume is approximately 22.697 L. The calculator currently displays 0.0227 L for these inputs because of a unit-conversion error; do not use that displayed value as the volume in liters.

How to use the calculator

  1. Under I want to calculate, select Volume (V), Temperature (T), Pressure (P), or Moles of Gas (n). The selected quantity is the unknown.
  2. Enter the other three values in their labeled fields: Temperature in kelvin (K), Pressure in kilopascals (kPa), Moles of Gas in moles (mol), and Volume in liters (L). You do not need to enter a value for the quantity you selected.
  3. Read the result, but check the unit-conversion warning below before using it. For a reliable value, calculate directly from \(PV=nRT\) using the units listed above.

What the ideal gas law tells you

The ideal gas law describes how four properties of a gas fit together: its pressure, volume, absolute temperature, and amount. If three are known, the equation determines the fourth. It combines the relationships described by Boyle’s, Charles’s, and Avogadro’s laws into one expression for an ideal gas.

For a fixed amount of gas, increasing the temperature increases \(PV\). If the container can expand while pressure stays constant, its volume rises; if its volume is fixed, its pressure rises instead. Adding more moles likewise requires a greater volume at the same pressure and temperature. These comparisons help explain what a calculated result means, not just how to obtain it.

The units must be consistent. A kilopascal multiplied by a liter equals a joule, so \(8.314\ \mathrm{kPa\cdot L/(mol\cdot K)}\) works directly with this page’s kPa and L fields. Temperature must be absolute: convert degrees Celsius to kelvin by adding 273.15. For instance, 25 °C is 298.15 K.

If you are comparing the same gas before and after a change while its amount stays fixed, the Combined Gas Law calculator relates the two states. For constant-pressure temperature and volume changes, see Charles’ Law. For mixtures of gases, Dalton’s Law addresses partial pressures.

Assumptions and important result warning

The calculator’s displayed answers currently have a unit-conversion error. Its calculation multiplies pressure in kPa by 1,000 as though converting it to pascals, but leaves volume’s numerical value in liters. That mismatches the units. For the default inputs, it displays 0.0227 L instead of the correct 22.69722 L.

Before rounding, the displayed volume and pressure are each 1,000 times too small; the displayed temperature and moles are each 1,000 times too large. To avoid magnifying rounding error, recalculate from the original inputs rather than correcting an already rounded display. Use \(V=nRT/P\), \(T=PV/(nR)\), \(P=nRT/V\), or \(n=PV/(RT)\), with \(R=8.314\) and the units specified above.

The ideal gas law is a model, not an exact description of every gas. It works best when gas particles are far apart and intermolecular interactions have little effect—generally at relatively low pressures and temperatures well above the gas’s condensation point. Results may be less accurate near condensation or at high pressure, where a real-gas model may be needed.

Enter positive values for the three known quantities. Use the gas’s absolute pressure, not gauge pressure: gauge pressure measures the difference from the surrounding atmosphere. Check that the amount entered is in moles rather than grams, and convert any milliliters to liters before entering volume.

Frequently Asked Questions

How do I solve an ideal gas law problem by hand?

Isolate the quantity you need, then substitute values in consistent units. For example, to find the pressure of 0.50 mol of gas occupying 10 L at 300 K, use \(P=nRT/V\). The calculation is \(P=(0.50)(8.314)(300)/10=124.71\ \mathrm{kPa}\). Check that the result is plausible: the same gas in a smaller volume would have a higher pressure.

What volume should one mole of an ideal gas occupy at STP?

It depends on which definition of STP you use. At 0 °C and 100 kPa, one mole occupies about 22.71 L. At 0 °C and 1 atm (101.325 kPa), it occupies about 22.41 L. Neither is a universal volume for one mole: changing the temperature or pressure changes the volume.

How do I convert atm, mmHg, or cubic meters for this calculator?

Convert pressure to kilopascals and volume to liters before entering them. Multiply atmospheres by 101.325 or millimeters of mercury by approximately 0.133322 to get kPa. Multiply cubic meters by 1,000 to get L. If calculating by hand with those converted values, use \(R=8.314\ \mathrm{kPa\cdot L/(mol\cdot K)}\); mixing unit systems gives incorrect results.

How do I use a gas's mass instead of its number of moles?

Convert mass to moles using \(n=m/M\), where \(m\) is mass and \(M\) is molar mass in matching mass units per mole. For example, 16 g of oxygen gas, \(\mathrm{O_2}\), is about 0.50 mol because its molar mass is about 32 g/mol. Use the molar mass of the entire gas molecule, not an individual atom.

Can I use the ideal gas law for a mixture of gases?

Yes, for an approximately ideal mixture, use the total moles of all gases with the mixture’s total pressure. To calculate the pressure contributed by one component, use its moles in the ideal gas law at the mixture’s volume and temperature. You can also multiply total pressure by that component’s mole fraction to find its partial pressure.

When is the ideal gas law not accurate enough?

Accuracy can decline at high pressures or near a gas’s condensation temperature, where molecular size and attractions matter more. A real-gas equation may be needed; one common form is \(PV=ZnRT\), where the compressibility factor \(Z\) depends on the gas and its conditions. If precision matters, check measured properties or an appropriate real-gas model rather than assuming \(Z=1\).

Leave a Reply

Your email address will not be published. Required fields are marked *

10 thoughts on “Ideal Gas Law Calculator”