How to use the gas law calculator for pressure, volume and temperature
This article walks through the ideal gas law and its three simpler cousins, explains why temperature must be in kelvin before anything works, and shows how to set up each kind of problem in the calculator so the answer comes out right the first time.

One equation for four quantities
PV = nRT ties four things together: pressure, volume, the amount of gas in moles, and temperature. If you know three of them, the fourth drops straight out of the algebra. That is the ideal gas law, and it covers most of the questions a chemistry or physics class will throw at you.
The calculator puts this into practice in a direct way. Pick the ideal gas law from the Which law selector, fill in three of the four boxes, and leave the fourth empty. The empty one is the unknown, and the page solves for it as soon as you stop typing. If you happen to fill in all four, the tool checks whether your numbers actually agree with the equation and tells you by how much they drift.
Why everything has to be kelvin
This is the single biggest source of wrong answers in gas calculations, and it trips people up over and over. A gas at twenty degrees Celsius that warms to forty degrees Celsius has not doubled in temperature. In kelvin those numbers are 293 and 313, which is a rise of about seven per cent. The equation cares about how much energy the molecules carry, and that count starts at absolute zero, not at the freezing point of water.
The calculator handles this for you. Choose your preferred unit from the Temperature in selector, which offers degrees Celsius, kelvin and degrees Fahrenheit. Whatever you pick, the page converts to kelvin behind the scenes before it does any arithmetic, and then converts the answer back into whichever unit you chose. You never need to do the conversion by hand, but knowing it happens explains why the same pair of Celsius readings gives a different ratio than you might expect.
Setting the units for pressure and volume
Pressure and volume each have their own unit selector. Pressure offers kilopascals, pascals, bar, atmospheres, millimetres of mercury and psi. Volume offers litres, millilitres, cubic metres, cubic feet and US gallons. The answer always comes back in the same units you picked, so if you enter pressure in atmospheres you get pressure in atmospheres.
Internally the page converts everything to pascals and cubic metres before multiplying, then converts back. That means you can mix everyday units freely and never worry about matching them yourself. Just make sure the selector matches what is printed on your problem sheet, and the rest takes care of itself.
Before and after: the combined and named laws
Not every question is about a single snapshot of a gas. Many are about a change: a syringe is squeezed, a balloon goes outside into the cold, a tyre sits in the sun. For those, switch the Which law selector away from the ideal gas law.
The combined law covers the general case where pressure, volume and temperature can all change between the two states. Enter the before and after values, leave one box empty, and the missing quantity appears. Below the combined law sit the three named laws: Boyle's law holds temperature still, Charles's law holds pressure still, and Gay-Lussac's law holds volume still. When you pick one of these, the boxes for the held quantity vanish because they are not needed.
Think of the three named laws as shortcuts. They are all special cases of the combined law with one variable locked in place. Boyle's says that if you squeeze a gas without changing its temperature, the pressure rises in proportion. Charles's says that warming a gas at constant pressure makes it expand. Gay-Lussac's says that warming a gas in a rigid container makes the pressure climb. The combined law is just all three happening at once.
Molar mass and what it unlocks
Below the unit selectors is an optional field labelled Molar mass, measured in grams per mole. Most of the time you can ignore it, but if you fill it in the calculator reports two extra figures: the mass of the gas in grams and its density.
This is useful when a question gives you a mass instead of moles. Divide the mass by the molar mass yourself, type the answer into the Amount of gas box, and the law works as usual. There is no box for a mass: the molar mass field runs the other way, taking the moles the tool already has and reporting the mass and density that go with them. The molar mass field exists so that people working with real gases, say oxygen at 32 or nitrogen at 28, can see a mass and a density alongside the basic four-way result.
Sample problems you can try right away
The tool comes with four ready-made scenarios under the Try one heading. Each one loads a set of values and picks the right law, so you can see a solved problem before you start entering your own.
The first example, labelled One mole at room temperature, sets up the ideal gas law with one mole at standard pressure filling 24.4 litres, and leaves the temperature box empty so you can see which room temperature that volume implies. The second, Squeeze a syringe, demonstrates Boyle's law by doubling the pressure on a small volume and asking for the new volume. The third, Balloon into the cold, uses Charles's law to show what happens when a two-litre balloon goes from a warm room to freezing air. The fourth, Tyre on a hot day, applies Gay-Lussac's law to a sealed tyre whose temperature rises. Clicking any of these fills in the fields and runs the calculation instantly.
Gauge pressure and why it fools people
Tyre gauges and many industrial pressure readings start from zero at atmospheric pressure, not from zero at a vacuum. A tyre gauge that reads 220 kilopascals actually means the gas inside is at about 321 kilopascals absolute, because the atmosphere is pushing on the outside of the tyre as well.
Gas laws require the absolute figure. If you plug a gauge reading straight into the calculator, the answer will be noticeably wrong. Before entering a number from a garage forecourt or a pressure gauge on a tank, add roughly 101 kilopascals, 14.7 psi, or one atmosphere to it. This is the most common real-world mistake people make with these equations, and it only shows up when you try to match the answer against what actually happens.
Where the ideal gas law starts to drift
The word ideal in the name is doing real work. The equation assumes that gas molecules take up no space themselves and never pull on each other. At everyday pressures and warm temperatures, that is close enough for almost any classroom or workshop question.
The model starts to slip in two places. First, near the boiling point of the gas, where the molecules are close to turning into a liquid and attractions between them matter. Second, at pressures above roughly ten atmospheres, where the molecules are packed tightly enough that their own volume is no longer trivial. For those situations you need equations like van der Waals, which add correction terms. But for air in a room, gas in a lab, or a tyre on a car, the ideal law is well within practical accuracy.
The gas constant and the precision of your answer
R, the gas constant, is 8.31446261815324 joules per mole per kelvin. Since 2019 that number is defined exactly rather than measured, which means it introduces no error at all. The precision of the answer you get out depends entirely on the precision of the numbers you put in.
If your pressure is accurate to three figures and your volume to two, the answer is meaningful to two figures at best. The calculator does not round for you, so the display may show many digits. Read as many as your least accurate input justifies, and treat the rest as decoration.
Nothing leaves your browser
Every conversion, every solve, every sample scenario runs right on your own device. The page does not send your numbers to a server, and there is no login or account involved. That makes it fast even on a slow connection, and it means there is nothing for anyone else to store or see. Close the tab and the data is gone.
