Apps Part of Proofline

Gas Law Calculator: Ideal, van der Waals & Combined

Solve the ideal or van der Waals gas law for p, V, n or T with units, plus the combined gas law.

More options

Gives the molar mass, so the amount can be a mass and the result shows the mass and density.

Leave exactly one of pressure, volume, amount and temperature empty: that one is calculated.

mol, or a mass in g with a formula or preset gas.

Combined gas law: leave exactly one of the six values empty.

Try an example: · · · ·

More about this tool

How it works

Type three of pressure, volume, amount and temperature with any units (bar, atm, kPa, mmHg; L, mL, m³; mol or grams; K, °C, °F) and get the fourth from the ideal gas law or the van der Waals equation. The real-gas mode shows the compressibility factor Z, how far the ideal gas is off, the critical point and the isotherm, and lists the liquid and gas solutions below the critical temperature. Ten preset gases take their van der Waals constants from their measured critical point; the combined gas law solves p₁V₁/T₁ = p₂V₂/T₂. Part of the Proofline math notebook.

  • Quantities are read with their units (Proofline’s chemistry engine) and converted to Pa, m³, mol and K. Ideal gas: p·V = n·R·T with the exact R = 8.314462618 J/(mol·K).
  • van der Waals: (p + a·n²/V²)(V − n·b) = n·R·T. Pressure and temperature follow directly; volume and amount are roots of a cubic, found with Proofline’s bracketing root finder (Brent) on a logarithmic grid above V = n·b, so all real solutions are listed.
  • Preset gases: a = 27R²Tc²/(64pc) and b = R·Tc/(8pc) from the critical temperature and pressure of NIST’s reference equations of state. Z = pV/(nRT); Tc = 8a/(27Rb), pc = a/(27b²), Vc = 3b.
  • Verified: 1 mol at 0 °C and 1 atm occupies 22.414 L; CO₂ at 500 K and 100 atm (a = 3.592 L²·atm/mol², b = 0.04267 L/mol) has a molar volume of 0.366 L/mol, as in Atkins’ worked example; the preset constants reproduce the critical temperatures exactly.

The van der Waals equation is a qualitative real-gas model: near the critical point and in the liquid it can be off by tens of percent, and no Maxwell construction is applied. Compressed-gas work needs proper equations of state and safety rules. Nothing here is advice on handling chemicals or radioactive material safely.

Sources

Part of Proofline

Related tools

Solve gas problems with the ideal gas law and van der Waals

Calculate pressure, volume, amount or temperature of a gas with the ideal gas law, the van der Waals equation for real gases, or the combined gas law.

What it is for

The ideal gas law pV = nRT is good enough for air at room conditions. At high pressure or near the boiling point, molecules take up space and attract each other, and the ideal law can be off by tens of percent. The van der Waals equation adds two constants for this: a for the attraction and b for the volume of the molecules.

The tool has three modes. Ideal solves pV = nRT for whichever of the four quantities you leave empty. Van der Waals does the same for a real gas: pick one of ten preset gases or enter your own a and b. Combined relates two states of the same sample, p₁V₁/T₁ = p₂V₂/T₂.

Preset constants are derived from each gas's measured critical point, as reported by NIST. That way the model's critical point is exactly the real one. Any units work: atm, bar, kPa, psi, L, m³, °C, °F and K.

Worked example

One mole of an ideal gas at 1 atm and 0 °C occupies 22.414 L, the familiar molar volume.

Now a real gas: CO₂, 1 mol in 1 L at 300 K in van der Waals mode. The pressure is 2240.34 kPa, while an ideal gas would give 2494.34 kPa, about 10 % more. The compressibility factor is Z = 0.898. Z < 1 means attraction dominates, so the gas is easier to compress than the ideal law suggests. Because 300 K is just below CO₂'s critical temperature of 304.1 K, the tool warns that the real gas could condense here.

A textbook check from Atkins: CO₂ with a = 3.640 L²·bar/mol² and b = 0.04267 L/mol at 100 atm and 500 K gives a molar volume of 0.366 L/mol. The ideal law gives 0.410 L/mol.

For a 50 L nitrogen cylinder at 200 bar and 20 °C, the tool finds 409.093 mol, 11.46 kg of N₂. Z is 1.003, so nitrogen is almost ideal here.

Combined law: 2 L at 1 atm and 20 °C, compressed to 3 atm and heated to 80 °C, ends up at 0.803 L.

How to read the result

  • The missing quantity appears in the summary together with the ideal-gas value for comparison.
  • Compressibility factor Z = pV/nRT is 1 for an ideal gas. Below 1 attraction dominates, above 1 molecular volume dominates.
  • The constants table shows a, b, the critical point and the reduced temperature T/Tc. Below Tc the van der Waals equation can have three volumes for one pressure, and all of them are listed.
  • With a formula, the mass and density of the gas are shown too.

Tips and common mistakes

  • Always use absolute temperature in your head. The tool converts °C and °F for you, but ratios like T₂/T₁ only work in kelvin.
  • Gauge pressure is not absolute pressure. Add about 1 atm to a tyre-gauge reading.
  • Van der Waals is a qualitative model near the critical point and for liquids. Use it for gases and moderate pressures.
  • Below Tc, the smallest volume is liquid-like and the largest gas-like. The middle one is unphysical.

FAQ

Why do the preset constants differ slightly from my textbook?

Textbooks fit a and b in different ways. Here they come from the critical point (a = 27R²Tc²/64pc, b = RTc/8pc), so for CO₂ they agree with the CRC values within 0.5 %.

Can I use my own a and b?

Yes. Choose the custom gas and enter a in L²·bar/mol² and b in L/mol.

What is the gas constant used?

R = 8.314462618 J/(mol·K), the exact SI value.

Does it handle mixtures?

Only in the ideal modes, with the total amount of all components. Van der Waals mixtures need mixing rules, which the tool does not apply.

Guide last updated:

For scripts and AI agents

  • JSON API: POST https://prooflinegaslaw.usefulweb.app/api/v1/calculate (same calculation as this page)
  • Interface description: OpenAPI 3.1 · AI guide: llms.txt
  • MCP server (Streamable HTTP): https://prooflinegaslaw.usefulweb.app/mcp · tool name proofline_gas_law
Example request
curl -s -X POST https://prooflinegaslaw.usefulweb.app/api/v1/calculate \
  -H 'content-type: application/json' \
  -d '{"mode":"ideal","pressure":"1 atm","temperature":"0 °C","amount":"1 mol"}'
Feedback · ideas & bug reports welcome