Boyle's Law Calculator
Solve P₁V₁ = P₂V₂ for any of the four variables. A live 3D piston shows particle density rising as volume shrinks, with charts of the classic inverse P–V curve.
Reviewed by the ToolNestr Editorial Team — July 2026
Two ideas that trip students up
1. Same gas, packed tighter
Two snapshots of the same amount of gas: compressed into a small volume (dense particles, high pressure) vs. expanded into a large volume (sparse particles, low pressure). Nothing was added or removed — only the space changed.
2. A family of inverse curves
Each curve traces P × V = constant for a different fixed value. Every gas sample sits on exactly one such curve — moving along it is what Boyle's law describes.
Boyle's law graphs
How it works
The core idea in one line: squeeze a gas into a smaller volume at constant temperature and its pressure rises by exactly the same factor — pressure and volume trade places, but their product never changes.
P₁V₁ = P₂V₂
pressure × volume is constant at fixed T and n
P₂ = P₁V₁ / V₂
solve for the new pressure
V₂ = P₁V₁ / P₂
solve for the new volume
Rearranged, P₁V₁ = P₂V₂ solves any of the four variables: P₂ = P₁V₁/V₂ and V₂ = P₁V₁/P₂. It only holds when temperature and the amount of gas (moles) stay fixed — that constraint is what makes it Boyle's law rather than the more general combined gas law.
Worked example 1 — compressing a gas cylinder
Given: A gas occupies 4.00 L at 2.00 atm. It is compressed at constant temperature until its volume is 1.00 L. Find the new pressure.
Volume dropped to a quarter of its original size, so pressure quadrupled — exactly as the inverse relationship predicts.
Worked example 2 — a diver's lungs on ascent
Given: A scuba diver at 10 m depth (ambient pressure ≈ 2.00 atm) takes a breath filling their lungs to 3.00 L, then holds it while ascending to the surface (1.00 atm). Find the lung volume at the surface.
The trapped air would double in volume — this is exactly why divers are trained to exhale continuously while ascending, never to hold their breath.
Boyle's law vs Charles's law vs Gay-Lussac's law
Each law holds one variable fixed and relates the other two — easy to mix up unless you track what stays constant.
| Law | Held constant | Relationship |
|---|---|---|
| Boyle's law | Temperature, moles | P and V — inversely proportional (P₁V₁ = P₂V₂) |
| Charles's law | Pressure, moles | V and T — directly proportional (V₁/T₁ = V₂/T₂) |
| Gay-Lussac's law | Volume, moles | P and T — directly proportional (P₁/T₁ = P₂/T₂) |
All three are special cases of the combined/ideal gas law PV = nRT, each freezing one variable to isolate the other two.
Where Boyle's law actually matters
🤿 Scuba diving
As a diver ascends, ambient pressure drops, so trapped air in the lungs and BCD expands. Divers ascend slowly and exhale continuously to avoid dangerous over-expansion injuries — a direct, high-stakes application of Boyle's law.
💉 Syringes and medical devices
Pulling back a syringe plunger increases the internal volume, which drops the pressure below atmospheric and draws fluid in. Pushing the plunger does the reverse, forcing fluid out under higher pressure.
🎈 Weather balloons
As a weather balloon rises into the low-pressure upper atmosphere, the gas inside expands — the balloon visibly grows larger the higher it climbs, until it eventually bursts.
🧴 Aerosol cans
Aerosol cans hold gas at high pressure in a small volume. Puncturing or overheating the can lets that compressed gas rapidly expand, which is why they carry pressure and heat warnings.
Common misconceptions
"Boyle's law works even if temperature changes too."
False — temperature (and the amount of gas) must be held constant. That constraint is the entire premise of the law. If temperature changes, you need the combined gas law, P₁V₁/T₁ = P₂V₂/T₂, instead.
"Pressure and volume are directly proportional."
False — they are inversely proportional. As one goes up, the other goes down by the same factor, so their product PV stays constant. That inverse relationship is the whole point of Boyle's law.
"Boyle's law applies to any substance, not just gases."
False — it describes ideal (or near-ideal) gas behaviour specifically. Liquids and solids are nearly incompressible, so squeezing them barely changes their volume at all.
"Doubling the pressure always doubles something else."
Doubling the pressure halves the volume, not doubles it — because the relationship is inverse. It is easy to default to "proportional means bigger with bigger," which is backwards here.
Formula sources & further reading
The formulas here are standard, traceable to:
- • OpenStax, Chemistry 2e — gas laws and Boyle's law (free, peer-reviewed). openstax.org
- • Brown, LeMay & Bursten, Chemistry: The Central Science — Chapter 10, Gases.
- • Zumdahl & Zumdahl, Chemistry — the gas laws and kinetic molecular theory.
Boyle's law assumes constant temperature and a fixed amount of gas (n). Results are rounded for display.
How to use this calculator
Enter three values
Fill any three of P₁, V₁, P₂, V₂; the fourth solves live.
Check units
Pressure and volume just need matching units on both sides — atm, kPa, L or mL all work.
See it in the piston
Drag the volume slider and watch particle density and pressure respond instantly.
Related tools
Frequently asked questions
What is Boyle's law?
Boyle's law states that at constant temperature and a fixed amount of gas, pressure and volume are inversely proportional: P₁V₁ = P₂V₂. Compress a gas to half its volume and its pressure doubles.
What has to stay constant for Boyle's law to apply?
Temperature and the amount of gas (moles) must both stay constant. Boyle's law only isolates the pressure–volume relationship when those two are fixed — if temperature changes too, you need the combined gas law instead.
Why does compressing a gas increase its pressure at the particle level?
Pressure comes from gas molecules colliding with the container walls. Squeezing the same number of molecules into a smaller volume packs them closer together, so they hit the walls more often per second — more collisions per second means higher pressure, even though nothing about the molecules themselves changed.
Does Boyle's law apply to liquids or solids?
No. Boyle's law describes ideal (or near-ideal) gas behaviour only. Liquids and solids are essentially incompressible — their volume barely changes under pressure — so the inverse P-V relationship simply doesn't apply to them.
How is Boyle's law different from Charles's law?
Boyle's law holds temperature constant and relates pressure to volume (inverse relationship). Charles's law holds pressure constant and relates volume to temperature (direct relationship). They are two different slices through the same ideal gas law, PV = nRT.