Gas Law Calculator
Find any gas property when you know the other three using PV=nRT.
Find any missing gas property when you know the other three. Enter any three values from pressure, volume, temperature, or amount of gas — see the fourth property calculated instantly. Uses the ideal gas law PV=nRT. Assumes the gas behaves ideally under your conditions.
—
Send feedback
💡 Share your idea or report a problem
✓ Thanks! We'll take a look.
Learn more
How It Works
The formula, explained simply
Imagine gas molecules as tiny bouncing balls in a container. When you squeeze the container smaller (less volume), the balls hit the walls more often, creating higher pressure. When you heat the container, the balls move faster and hit harder, again increasing pressure. The ideal gas law captures this relationship mathematically: pressure times volume equals the number of gas molecules times their average energy.
The magic number in the ideal gas law is R, the gas constant (0.08206 L·atm/(mol·K)). This connects the molecular world to measurable quantities. One mole contains exactly 6.022 × 10²³ molecules, so R tells us how much pressure one mole of molecules creates in one litre at one Kelvin. Every gas produces the same pressure under identical conditions when measured in moles, whether helium or carbon dioxide.
The calculator assumes your gas behaves ideally, meaning molecules have no size and don't attract each other. Real gases deviate from this at high pressures (molecules take up space) and low temperatures (molecules attract each other). For most everyday calculations—tire pressure, weather balloons, laboratory experiments—the ideal gas law gives excellent results within experimental error.
When To Use This
Right tool, right situation
Use the ideal gas law when you need to predict how changing one gas property affects another. Common applications include calculating tire pressure changes with temperature (cold tires lose pressure), sizing storage tanks for compressed gases, predicting balloon volumes at different altitudes, and determining gas densities for safety calculations. The law works best for non-polar gases like hydrogen, nitrogen, oxygen, and noble gases at moderate conditions.
Laboratory work frequently uses the ideal gas law to convert between different ways of measuring gas amounts. Given a gas's molecular weight, you can convert from grams to moles, then use PV = nRT to find volume or pressure. Environmental engineers use it to calculate air density changes with altitude and temperature, affecting pollution dispersion models. Chemical engineers size pressure vessels and calculate gas flow rates through pipes.
Avoid the ideal gas law for steam calculations (water vapour behaves non-ideally), very high-pressure processes (above 50 atm), or low-temperature applications where gases might condense. Also avoid it for gas mixtures where you need to account for different molecular interactions—use partial pressure calculations instead. For weather prediction, atmospheric models use more complex equations because real air contains water vapour and varies in composition with altitude.
Common Mistakes
Why results sometimes look wrong
The most common mistake is forgetting to convert Celsius to Kelvin. Using 25°C instead of 298 K gives a pressure that's 8% too low. Always add 273.15 to Celsius temperatures. Another frequent error is mixing units—using pressure in psi with volume in litres, or using grams instead of moles. The gas constant R only works with specific units: atmospheres, litres, moles, and Kelvin.
Students often input unrealistic values without checking if the result makes sense. If your calculation shows a balloon at room temperature needs 50 atmospheres pressure, something's wrong with your inputs. Standard atmospheric pressure is 1.013 atm, so most everyday gas calculations should give pressures between 0.1 and 10 atm. Similarly, if you calculate that one mole of gas occupies 2240 litres instead of 22.4 litres at standard conditions, check your decimal places.
Don't assume the ideal gas law applies in extreme conditions. At pressures above 20 atm or temperatures below 200 K, real gas effects become significant. Water vapour deviates noticeably even at atmospheric pressure because water molecules are polar and attract each other strongly. For high-precision work or extreme conditions, use equations of state designed for real gases.
The Math
Worked examples and deeper derivation
The ideal gas law equation is PV = nRT, where P is pressure in atmospheres, V is volume in litres, n is amount in moles, R is the gas constant (0.08206 L·atm/(mol·K)), and T is absolute temperature in Kelvin. To solve for any unknown variable, rearrange the equation algebraically: P = nRT/V, V = nRT/P, T = PV/(nR), or n = PV/(RT).
Worked example: Find the pressure of 2 moles of gas in a 10-litre container at 300 K. Using P = nRT/V: P = (2 mol)(0.08206 L·atm/(mol·K))(300 K)/(10 L) = 4.92 atm. The units cancel correctly: mol × L·atm/(mol·K) × K ÷ L = atm. Always check unit cancellation to verify your setup.
The equation breaks down when gases liquefy (very high pressure or low temperature) or when molecular interactions become significant. Real gas corrections like the van der Waals equation add terms for molecular volume (subtract nb from V) and intermolecular attraction (add n²a/V² to P), where a and b are gas-specific constants. For hydrogen at 1000 atm and 300 K, the ideal law predicts 24.6 L/mol while the real volume is about 26.8 L/mol—a 9% error.
Expert Unlock
The thing most explanations skip
The ideal gas law assumes gases are point particles with no volume and no intermolecular forces, but real molecules have finite size and attract each other. The van der Waals equation corrects these assumptions: (P + an²/V²)(V - nb) = nRT, where 'a' accounts for intermolecular attraction and 'b' accounts for molecular volume. For water vapour at 100°C and 1 atm, the ideal law predicts 30.6 L/mol but the actual molar volume is 30.2 L/mol due to hydrogen bonding between molecules.
When does the ideal gas law break down in real conditions?
Need something this doesn't cover?
Suggest a tool — we'll build it →