Leave a car parked in the sun on a hot afternoon and the dashboard tire-pressure light may flick on after a long drive. Nothing leaked. No air was added. The tires simply warmed up, and warmer gas in a roughly fixed volume pushes harder on its container. The same physics inflates a hot-air balloon, sizes a scuba tank, and sets the pressure inside an engine cylinder a fraction of a second before ignition.
All of those situations are governed by one compact relationship between four quantities. This article explains what the ideal gas law says, how to apply it cleanly, works a full numerical example, and points out where the "ideal" assumption quietly breaks down.
Why this calculation matters
Gases are everywhere in engineering, and unlike solids and liquids they change volume dramatically when you squeeze or heat them. That makes a predictive equation essential. If you cannot relate pressure, volume, and temperature, you cannot size a pressure vessel, estimate the lift of a balloon, predict how much a sealed package will bulge at altitude, or analyze a single stroke of a piston.
The ideal gas law is the first tool reached for in all of these cases because it captures the dominant behavior with no fitted constants. It also serves as the baseline against which real-gas corrections are measured. Even when a gas is not quite ideal, the ideal result tells you the order of magnitude and the direction of every effect, which is often enough to make an early design decision. Get comfortable with it and a large slice of thermodynamics becomes approachable.
The core formula
The ideal gas law links pressure, volume, temperature, and the amount of gas:
P * V = n * R * T
Here P is the absolute pressure in pascals, V is the volume in cubic meters, n is the amount of substance in moles, T is the absolute temperature in kelvin, and R is the universal gas constant:
R = 8.314 J/(mol*K)
The equation is easier to trust once you see it as three simpler laws folded together. Hold temperature fixed and it becomes Boyle's law, P*V = constant — squeeze the gas and pressure rises. Hold pressure fixed and it becomes Charles's law, V/T = constant — heat the gas and it expands. Hold volume fixed and pressure rises in proportion to temperature, which is the tire-in-the-sun case. Each familiar gas law is just the full equation with one variable pinned down.
To solve for any single unknown, rearrange:
P = n*R*T / V
V = n*R*T / P
T = P*V / (n*R)
n = P*V / (R*T)
Two assumptions sit underneath all of this. The gas molecules are treated as point particles with negligible volume of their own, and they are assumed to exert no forces on one another except during brief collisions. Those assumptions hold well when the gas is dilute — that is, away from high pressure and away from low temperature.
A worked example
Suppose 2 moles of gas are sealed in a rigid vessel with volume V = 0.05 cubic meters, held at a temperature of T = 300 K. What is the pressure inside?
Step 1 — choose the right form. Pressure is the unknown, so use:
P = n*R*T / V
Step 2 — confirm units. Temperature is already in kelvin, volume in cubic meters, and R is in joules per mole-kelvin. The result will come out in pascals with no conversion needed.
Step 3 — substitute.
P = (2 * 8.314 * 300) / 0.05
P = 4988.4 / 0.05
P = 99,768 Pa
So the gas sits at about 99,768 Pa, just under one standard atmosphere of roughly 101,325 Pa. That is a comfortable, ordinary pressure — the kind you would expect from a modest amount of gas filling a 50-liter container at room temperature.
The result also rewards a quick sanity check. Doubling the temperature to 600 K would double the pressure. Halving the volume to 0.025 cubic meters would double it as well. Each of those responses matches Charles's law and Boyle's law respectively, which is a good sign the setup is correct.
Common mistakes
Using Celsius instead of kelvin. This is the error that bites most often. The equation needs absolute temperature. Plugging in 27 instead of 300 does not give a small error — it gives a result that is wrong by a factor of more than ten. Always convert: T[K] = T[degC] + 273.15.
Mismatched pressure or volume units. If you keep R as 8.314 J/(mol*K), pressure must be in pascals and volume in cubic meters. Mixing in liters, bars, or atmospheres without a matching constant scrambles the answer. Pick a consistent unit system and check it before substituting.
Forgetting that n can change. The law assumes a fixed quantity of gas. If the container leaks, vents, or is being filled, n is not constant and a single application of P*V = n*R*T no longer connects the start and end states.
Trusting it at extreme conditions. Near high pressure or low temperature, molecules are packed close enough that their finite size and mutual attraction matter. There the ideal law drifts from reality, and a real-gas equation of state is the better choice. Treat the ideal result as accurate when the gas is dilute and increasingly approximate as it is compressed or cooled toward condensation.
Try the interactive NovaSolver calculator
Working one case by hand is useful once, but building intuition is faster when you can watch the variables trade off live. The Ideal Gas Laws Simulator on NovaSolver lets you set temperature, volume, and the amount of substance with sliders and reads back the resulting pressure in real time, alongside P-V, P-T, and V-T state diagrams so you can see Boyle's and Charles's laws emerge as special cases of the same equation.
Related calculators
- Ideal Gas 3D Simulator — visualize gas molecules bouncing in a box and see how kinetic motion produces macroscopic pressure.
- Arrhenius Reaction Rate Calculator — extend temperature dependence to chemistry, where reaction rate climbs sharply with temperature.
- Reaction Kinetics Calculator — track how reactant concentrations evolve over time once a reaction is under way.
You can browse the rest in the chemistry tools hub.
Closing note
The ideal gas law is one of the highest-value equations a working engineer can carry around. It needs no fitted parameters, it folds three classic gas laws into one line, and it predicts the right behavior whenever a gas is dilute. Keep temperature in kelvin, keep your units consistent, remember that the amount of gas must stay fixed, and stay alert near high pressure and low temperature. Within those bounds, P*V = n*R*T will carry you a remarkably long way.
Top comments (0)