# 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. 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. Part of usefulweb.app (https://usefulweb.app/). Part of [Proofline](https://proofline.usefulweb.app/) (ownerApp: proofline). Results are deterministic calculations from the inputs and the listed assumptions; the API returns exactly what the web page shows. ## Use it - Human interface: https://prooflinegaslaw.usefulweb.app/ (interactive tool at https://prooflinegaslaw.usefulweb.app/tool) - JSON API: POST https://prooflinegaslaw.usefulweb.app/api/v1/calculate with a JSON object of inputs (schema: https://prooflinegaslaw.usefulweb.app/api/v1/tool) - OpenAPI: https://prooflinegaslaw.usefulweb.app/openapi.json - MCP (Streamable HTTP): https://prooflinegaslaw.usefulweb.app/mcp - tool `proofline_gas_law` ## Inputs - mode (select): Gas law - gas (select): Gas (van der Waals) - a (number): a (L²·bar/mol², own gas) - b (number): b (L/mol, own gas) - formula (text): Formula (optional) - Gives the molar mass, so the amount can be a mass and the result shows the mass and density. - pressure (text): Pressure - Leave exactly one of pressure, volume, amount and temperature empty: that one is calculated. - volume (text): Volume - amount (text): Amount of gas - mol, or a mass in g with a formula or preset gas. - temperature (text): Temperature - p1 (text): p₁ - Combined gas law: leave exactly one of the six values empty. - v1 (text): V₁ - t1 (text): T₁ - p2 (text): p₂ - v2 (text): V₂ - t2 (text): T₂ ## Method - 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. ## Limits - 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.