Gas Law Calculator

Pick your law first, then fill in what you know and leave exactly one box blank. That blank is what gets solved, and the answer arrives with the unit conversions, the rearranged formula, and your own numbers substituted into it. Temperatures are converted to kelvin for you, and the page shows you what forgetting to do that would have cost.

Leave exactly one box blank. That is the one I will solve for.

Put this calculator on your website for free

Copy one snippet and give your visitors a working Gas Law Calculator.

How this gas law calculator works

Pick your law first, before you type anything, because each of the six asks for a different set of numbers and the form rearranges itself around your choice. Then fill in what you know and leave exactly one box empty. That empty box is the question, and the answer comes back with every step shown: the unit conversions, the rearranged formula, your own numbers substituted into it, and the arithmetic. The steps are generated by the same code that produces the answer, so they cannot quietly disagree with it.

Five of these laws compare a gas at two moments, before and after something changed. The sixth, the ideal gas law, describes a gas at one moment all by itself, which is why it needs the gas constant R while the others do not. Every calculation here runs internally in pascals, cubic meters, kelvin, and moles, then converts back to whatever units you chose, so your unit choice can change how the answer is written but never what it is.

The formula

Boyle's Law: P1V1 = P2V2 (temperature fixed)
Charles's Law: V1 ÷ T1 = V2 ÷ T2 (pressure fixed)
Gay-Lussac's Law: P1 ÷ T1 = P2 ÷ T2 (volume fixed)
Avogadro's Law: V1 ÷ n1 = V2 ÷ n2 (pressure and temperature fixed)
Combined Gas Law: P1V1 ÷ T1 = P2V2 ÷ T2 (amount of gas fixed)
Ideal Gas Law: PV = nRT

P is absolute pressure, V is volume, T is absolute temperature, and n is the amount of gas in moles. R is the gas constant, and since the 2019 redefinition of the SI units it is exact: R = 8.31446261815324 J/(mol K), because it is simply Avogadro's constant multiplied by the Boltzmann constant, and both of those are now defined numbers rather than measured ones. In the units chemistry classes usually use, the same constant is 0.08206 L atm/(mol K), and that familiar figure falls straight out of the exact one once you divide by the exact definition of an atmosphere, 101,325 Pa.

Worked example

A 2.00 L balloon sits in a room at 25 °C. Put it in the fridge at 5 °C and the pressure does not change, so this is Charles's Law. Convert first: 25 °C is 298.15 K and 5 °C is 278.15 K. Then V2 = V1T2 ÷ T1 = 2.00 × 278.15 ÷ 298.15 = 1.866 L. The balloon shrinks by about 7%, which is roughly what you see when you actually try it.

Now do it the way half of all homework does it, in Celsius: 2.00 × 5 ÷ 25 = 0.40 L. That answer is 78.6% too small, and it is not a small slip in a conversion, it is a different question entirely. The calculator shows you both numbers on every temperature problem, because seeing the wrong one priced next to the right one is what makes the rule stick.

And the ideal gas law on the same page: 10.0 L of nitrogen at 2.00 atm and 25 °C works out to n = PV ÷ RT = 0.8175 moles. Enter nitrogen's molar mass of 28.014 g/mol and it also tells you that is 22.9 grams of gas at a density of 2.29 g/L.

Absolute temperature is the whole trick

If you take one thing from this page, take this: every one of these laws needs an absolute temperature, and Celsius and Fahrenheit are not absolute. They both put their zero somewhere convenient for weather rather than somewhere meaningful for physics, so a ratio taken in them is arithmetic performed on an arbitrary offset. Kelvin measures from absolute zero, the point where molecular motion stops, which is why doubling a kelvin temperature really does double how hard the gas pushes.

The consequences of forgetting are not subtle, and they get funnier the colder you go. Charles's Law in Celsius says a gas at 0 °C has zero volume, because the sum divides by zero. Below freezing it says the gas has negative volume, which would be quite a thing to watch. And in the worked example above it is off by 78.6%, which is more than enough to turn a right method into a wrong grade. Convert first, every time: K = °C + 273.15, or K = (°F + 459.67) × 5 ÷ 9. Rankine is the odd one out and the exception that proves the rule: it uses Fahrenheit-sized degrees but starts at absolute zero, so it works in these formulas unconverted.

Gauge pressure is the trap nobody warns you about

The tire gauge at the gas station, the regulator on a scuba tank, and most industrial pressure readouts do not tell you the pressure of the gas. They tell you how much more than the surrounding air it is, because that is what a mechanical gauge physically measures: it is a spring being pushed from both sides. That reading is gauge pressure, and the gas laws want absolute pressure, which is gauge plus one atmosphere.

So a tire inflated to 35 psi on the gauge holds gas at 49.7 psi absolute, and running a gas law problem on 35 where the equation wants 49.7 puts your answer off by nearly 30%. This is why the pressure unit menu above offers psi absolute and psi gauge as separate choices rather than pretending they are the same thing. It also explains the most common real-world version of Gay-Lussac's Law: your tires reading low on the first frosty morning of the year. Nothing leaked. The gas got colder, so it pushed less hard, and roughly 1 psi of gauge pressure disappears for every 10 °F the temperature drops.

Where the ideal gas law stops being true

The word "ideal" is doing real work. The law assumes gas molecules take up no space at all and feel no attraction to one another, and both of those are lies that happen to be very nearly harmless at ordinary conditions. Near room temperature and around one atmosphere, the ideal gas law is accurate to well under a percent for air, nitrogen, oxygen, and most of what you will meet in a chemistry class.

Push it, though, and it starts to drift. Above roughly ten atmospheres the error climbs past a percent or two, because molecules genuinely do occupy volume and the space available to move in is less than the container. Approach the temperature at which a gas would condense and the drift goes the other way, because attraction between molecules pulls them together and the gas pushes less hard than predicted. That is why a 150 atm scuba cylinder does not quite hold the mass this equation says it does, and why real engineering uses a compressibility factor or an equation of state that accounts for molecular size. This calculator flags high pressures and low temperatures in its steps rather than quietly handing you four confident digits, because a model is only useful when you know where it stops.

One mole, and the number your textbook made you memorize

Set the ideal gas law to 1 mole at 1 atm and 0 °C and you get 22.414 L, the molar volume that generations of students have committed to memory. It is a genuinely useful number, and it comes with a footnote almost nobody mentions: IUPAC stopped defining standard temperature and pressure that way in 1982. The current definition uses 100 kPa rather than 1 atm, and at 100 kPa and 0 °C a mole occupies 22.711 L instead. Both figures are correct; they answer slightly different questions, and they differ by about 1.3%.

Two more worth knowing, because they cover most of the conditions you actually work in: at 25 °C and 100 kPa, sometimes labelled SATP, a mole fills 24.79 L, and at 25 °C and 1 atm it fills 24.47 L. Notice what none of these depend on: what the gas is. A mole of hydrogen and a mole of xenon fill the same space under the same conditions even though one weighs 65 times what the other does, and that fact is Avogadro's Law, which is one of the six buttons at the top of this page.

Frequently asked questions

How do I know which gas law to use?

Look at what stays the same. If the temperature is fixed and pressure and volume trade off, that is Boyle's Law. If pressure is fixed and the gas is heated or cooled, Charles's Law. If the container is rigid so the volume cannot change, Gay-Lussac's Law. If gas is being added or removed at steady pressure and temperature, Avogadro's Law. If two things change at once, the combined gas law. And if you are describing a gas at a single moment rather than comparing before and after, you want the ideal gas law.

Do I have to convert temperature to Kelvin for gas law problems?

Yes, always, and it is the single most common way these problems go wrong. Celsius and Fahrenheit put their zero at an arbitrary point, so ratios taken in them are meaningless: Charles's Law in Celsius says a gas at 0 degrees has zero volume, and below freezing it says the volume is negative. Kelvin measures from absolute zero, so doubling it genuinely doubles how hard the gas pushes. This calculator converts for you and then shows you the wrong answer alongside the right one, so you can see the size of the mistake.

What is the value of R in the ideal gas law?

R is exactly 8.31446261815324 J/(mol K). It stopped being a measured quantity in the 2019 redefinition of SI units, because it is Avogadro's constant multiplied by the Boltzmann constant and both of those are now defined numbers. In the units chemistry classes use most, the same constant is 0.08206 L atm/(mol K), which falls straight out of the exact value once you divide by the exact definition of an atmosphere, 101,325 Pa. Which version you need depends only on the units of your other numbers, which is why this page works in SI internally and converts at the edges.

Should I use gauge pressure or absolute pressure?

Absolute, always. A tire gauge, a scuba regulator, and most industrial readouts show gauge pressure, which is how much more than the surrounding air the gas is, because that is what a spring inside a gauge physically measures. Absolute pressure is gauge plus one atmosphere, so a tire at 35 psi on the gauge holds gas at 49.7 psi absolute. The pressure unit menu on this page lists psi absolute and psi gauge separately so you can enter whichever your instrument gave you.

Why is one mole 22.4 liters in my textbook but 22.7 somewhere else?

Because there are two standard temperatures and pressures in circulation. The famous 22.414 L is a mole of ideal gas at 1 atm and 0 degrees Celsius, which was IUPAC's definition until 1982. IUPAC now defines standard pressure as 100 kPa, and at 100 kPa and 0 degrees a mole occupies 22.711 L. Both numbers are right, they just answer slightly different questions, and they differ by about 1.3%. Two more worth having: 24.79 L at 25 degrees and 100 kPa, and 24.47 L at 25 degrees and 1 atm.

When does the ideal gas law stop being accurate?

At high pressure and at low temperature. The law assumes molecules take up no space and ignore each other, which is nearly true around one atmosphere and room temperature and increasingly false as you compress a gas or cool it toward condensing. Above roughly ten atmospheres expect a drift of a percent or two, and much more inside a filled scuba cylinder. Real engineering handles this with a compressibility factor or an equation of state that accounts for molecular size. This page flags high pressures and low temperatures in its steps rather than handing you four confident digits.

Why do my tires read low on a cold morning?

That is Gay-Lussac's Law in your driveway. The volume of a tire barely changes, so pressure follows absolute temperature: cool the air inside and it pushes less hard. The rule of thumb is about 1 psi of gauge pressure for every 10 degrees Fahrenheit the temperature drops, and it means nothing leaked overnight. Enter your warm-day pressure and both temperatures above, choose psi gauge as your unit, and the calculator will tell you exactly what the gauge should read this morning.

Can this calculator solve for any variable, not just the last one?

Yes. Leave any one box blank and that is the one it solves for, including the starting values rather than only the final ones. The rearranged formula shown in the steps is built for whichever variable you left empty, with your own numbers substituted into it, so the working matches the question you actually asked.

Related calculators