science calculator

Ideal Gas Law Calculator

Compute pressure using PV = nRT with user inputs for moles, temperature, and volume.

Results

Pressure (atm)
1.09

How to use this calculator

  1. Identify how many moles of gas you have. If you are given a mass in grams, convert to moles by dividing by the molar mass of the gas (for example, 4.00 g/mol for helium).
  2. Convert the temperature from °C to Kelvin by adding 273.15 (for example, 25 °C becomes 298.15 K). Enter the Kelvin value into the calculator.
  3. Measure or compute the container volume in liters. If you have milliliters, divide by 1,000 to get liters; if you calculated volume in cm³, remember that 1,000 cm³ = 1 L.
  4. Enter moles, temperature in Kelvin, and volume in liters into the inputs.
  5. Read the resulting pressure in atmospheres and compare it with reference conditions (for example, 1 atm at sea level) or with safety limits on your glassware or apparatus.
  6. If you want to see how changing temperature or volume affects pressure (while keeping moles constant), adjust one input at a time and watch the output update.

Inputs explained

Moles (n)
The amount of gas present, measured in moles. If your problem gives mass instead, convert using n = mass ÷ molar mass. For example, 8.0 g of helium (4.00 g/mol) corresponds to 2.0 mol. Keeping track of moles is essential because the ideal gas law scales directly with n.
Temperature (K)
The absolute temperature of the gas in Kelvin. Always convert from Celsius to Kelvin by adding 273.15 (for example, 25 °C → 298.15 K). The ideal gas law requires Kelvin so that zero corresponds to absolute zero rather than an arbitrary scale point.
Volume (L)
The volume of the container holding the gas, expressed in liters. In lab settings, you might measure this directly (for example, a 2.0 L flask) or calculate it from dimensions. If your measurement is in mL, divide by 1,000 to convert to liters so it aligns with the R constant used here.

How it works

The ideal gas law is written as PV = nRT, where P is pressure, V is volume, n is moles of gas, R is the gas constant, and T is absolute temperature in Kelvin.

To solve for pressure, we rearrange the equation to P = (nRT) ÷ V. This is the form implemented in the calculator.

For the common combination of moles (mol), volume (L), temperature (K), and pressure in atmospheres (atm), we use the gas constant R = 0.082057 L·atm·mol⁻¹·K⁻¹.

You provide the moles, temperature in Kelvin, and container volume in liters. The calculator multiplies n × R × T, then divides by V to return pressure in atm.

Because this is the ideal gas law, the result assumes gas particles do not attract or repel each other and that their own volume is negligible compared with the container—assumptions that hold best at low pressure and moderate temperature.

Formula

Ideal gas law: PV = nRT
Pressure form used here: P = (n × R × T) ÷ V
With R = 0.082057 L·atm·mol⁻¹·K⁻¹ when using moles (mol), volume (L), temperature (K), and pressure in atm.

When to use it

  • Checking answers on chemistry homework where you are asked to calculate the pressure of a gas sample given moles, volume, and temperature.
  • Planning lab experiments by estimating the pressure inside a flask, balloon, or gas syringe to make sure it stays within the safe operating range of your equipment.
  • Exploring how pressure changes when you heat or cool a gas at constant volume (Gay-Lussac’s law) or when you compress or expand it at constant temperature (Boyle’s law) while still using the full ideal gas relationship.
  • Comparing the behavior of different gases under similar conditions by holding temperature and volume constant and varying the number of moles.
  • Teaching or learning gas laws by using sliders or repeated calculations to build intuition about how P, V, n, and T are connected.

Tips & cautions

  • Always convert temperature to Kelvin before using the calculator. Plugging in Celsius directly will give completely wrong answers, because the ideal gas law expects an absolute temperature scale.
  • Check that your units match the chosen gas constant. Here we use R in L·atm·mol⁻¹·K⁻¹, so moles must be in mol, volume in liters, temperature in Kelvin, and the result will be in atmospheres.
  • If a problem gives pressure in kPa or Pa and you want to work backwards, you can still use this calculator by converting the final atm value to the desired units (1 atm ≈ 101.325 kPa ≈ 101,325 Pa).
  • Keep an eye on significant figures. Match your answer’s precision to the least precise input value to avoid giving a false sense of accuracy.
  • If you are dealing with very high pressures, very low temperatures, or gases known to deviate strongly from ideal behavior (for example, near condensation), treat the result as an approximation and look up real‑gas models like van der Waals if needed.
  • Assumes gas particles occupy negligible volume and experience no intermolecular attractions or repulsions, which is a good approximation only at relatively low pressure and moderate temperature.
  • Does not include compressibility factors (Z) or real‑gas corrections like the van der Waals equation, which become important near condensation, at high pressures, or very low temperatures.
  • Requires the number of moles as an input; this calculator will not automatically convert from mass or volume of liquid to moles without you doing that conversion first.
  • Assumes a uniform temperature and pressure throughout the container. Strong gradients or partial mixing are not represented.
  • Intended for educational, classroom, and quick‑estimate use—it is not a replacement for detailed thermodynamic modeling in industrial or research settings.

Worked examples

1.0 mol of gas at 298 K in a 22.4 L container

  • Given: n = 1.0 mol, T = 298 K, V = 22.4 L, R = 0.082057 L·atm·mol⁻¹·K⁻¹.
  • Compute nRT = 1.0 × 0.082057 × 298 ≈ 24.46 L·atm.
  • Compute P = nRT ÷ V = 24.46 ÷ 22.4 ≈ 1.09 atm.
  • Interpretation: at room temperature with this volume, pressure is slightly above 1 atm, which matches the idea that gases expand compared to standard conditions.

2.0 mol of gas in 10.0 L at 320 K

  • Given: n = 2.0 mol, T = 320 K, V = 10.0 L.
  • Compute nRT = 2.0 × 0.082057 × 320 ≈ 52.52 L·atm.
  • Compute P = 52.52 ÷ 10.0 ≈ 5.25 atm.
  • Interpretation: high pressure arises because there is a relatively large amount of gas in a small container at an elevated temperature.

Effect of doubling temperature at constant volume and moles

  • Start with 1.0 mol in 5.0 L at 300 K.
  • Calculate initial pressure: P₁ = (1.0 × 0.082057 × 300) ÷ 5.0 ≈ 4.92 atm.
  • Double temperature to 600 K while keeping n and V the same.
  • Calculate new pressure: P₂ ≈ 9.84 atm, roughly double P₁, illustrating that pressure is directly proportional to temperature in Kelvin at constant n and V.

Deep dive

This ideal gas law calculator uses PV = nRT to compute gas pressure from moles, temperature in Kelvin, and volume in liters. Enter n, T, and V to instantly see the pressure in atmospheres, without manually rearranging the equation each time.

It is perfect for chemistry and physics students working on gas law problems, lab setups, or conceptual questions about how pressure changes when you heat, cool, or compress a gas. Because the calculator enforces Kelvin and liter units, it helps reinforce good habits around unit conversions and highlights the assumptions behind the ideal gas model.

FAQs

Can I use this calculator to solve for volume, temperature, or moles instead of pressure?
This specific setup is configured to solve for pressure only. However, the same ideal gas law can be rearranged to solve for any variable. For example, V = (nRT) ÷ P, n = (PV) ÷ (RT), and T = (PV) ÷ (nR). You can compute those manually using the pressure output or with a scientific calculator.
What should I do if my problem uses kPa instead of atm?
You can either convert your final pressure result from atm to kPa by multiplying by 101.325, or you can use a version of R expressed in kPa·L·mol⁻¹·K⁻¹ (8.314) and keep everything in kPa when doing the algebra by hand. This calculator uses the atmosphere-based constant, so conversion at the end is simplest.
Does the type of gas matter in the ideal gas law?
In the ideal gas model, all gases behave the same as long as they are at the same n, V, and T. The identity of the gas only matters when you convert from mass to moles (through molar mass) or when you consider real‑gas deviations, which this calculator does not include.
How close is the ideal gas law to real behavior?
For many gases at room temperature and near 1 atm, the ideal gas law gives very good approximations. Deviations become significant at high pressure, low temperature, or near condensation, where intermolecular forces and finite molecular volume can no longer be ignored.
Can I use this calculator for mixtures of gases?
If you know the total moles of all gases in the container and they are well mixed, you can treat the mixture as a single ideal gas and use the calculator to estimate total pressure. For partial pressures of individual components, you would also use mole fractions and Dalton’s law of partial pressures, which are beyond the scope of this simple tool.

Related calculators

This ideal gas law calculator is intended for educational use and quick estimates. It assumes ideal behavior and does not include real‑gas corrections, safety factors, or detailed thermodynamic properties. Do not rely on it alone for designing pressurized systems, safety‑critical experiments, or industrial equipment—always consult appropriate engineering references, laboratory guidelines, and qualified professionals.