# Gas law calculator > How do pressure, volume and temperature of a gas relate? Solve PV = nRT or the combined gas law for pressure, volume, temperature or amount. Solve the ideal gas law PV = nRT or the combined gas law for pressure, volume, temperature or moles in any units, with a live P–V diagram of the gas. - Page: https://how.box/gas-law/ - Runs entirely in the browser. - License: HowToolbox's own text and data (titles, explanations, FAQs, tool descriptions and schemas, this file) are CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/); AI training and answers are welcome. Attribute "HowToolbox (how.box)" with a link to the page used. Third-party data keeps its own terms; the name and logo are not licensed. Publisher: HowToolbox, contact@how.box. Terms: https://how.box/about/terms/ ## Inputs Answer link: https://how.box/gas-law/?law={law}&s={s}&p1={p1}&v1={v1}&t1={t1}&p={p}&v={v}&n={n}&t={t}&pu={pu}&vu={vu}&tu={tu} - `law` (ideal or combined): ideal (default) or combined. Example: `ideal`. - `s` (pressure, volume, amount or temperature): The unknown: pressure (default), volume, amount or temperature. Example: `pressure`. - `p1` (number 0 to 1e12): Initial pressure (combined law), in pu. Example: `100`. - `v1` (number 0 to 1e12): Initial volume (combined law), in vu. Example: `48`. - `t1` (number -460 to 1e6): Initial temperature (combined law), in tu. Example: `20`. - `p` (number 0 to 1e12): Pressure (final), in pu. Example: `101.325`. - `v` (number 0 to 1e12): Volume (final), in vu. Example: `24`. - `n` (number 0 to 1e12): Amount of gas, mol (ideal law). Example: `1`. - `t` (number -460 to 1e6): Temperature (final), in tu. Example: `20`. - `pu` (kpa, atm, bar, mmhg, psi or pa): kpa, atm, bar, mmhg, psi, pa Example: `kpa`. - `vu` (l, ml, m3 or ft3): l, ml, m3, ft3 Example: `l`. - `tu` (c, k or f): c, k or f. Example: `c`. Example answer: https://how.box/gas-law/?law=ideal&s=pressure&p1=100&v1=48&t1=20&p=101.325&v=24&n=1&t=20&pu=kpa&vu=l&tu=c A complete link carries the primary answer in the page HTML; a missing or invalid value shows the default page. ## Agent tools - `gas_law_calculate`: Ideal gas law PV = nRT (R = 8.314462618 J/(mol·K)) or the combined gas law P1V1/T1 = P2V2/T2. - MCP, one POST to https://how.box/mcp: `{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"gas_law_calculate","arguments":{"law":"ideal","solve":"pressure","p1":100,"v1":48,"t1":20,"pressure":101.325,"volume":24,"amount":1,"temperature":20,"pressure_unit":"kpa","volume_unit":"l","temperature_unit":"c"}}}` - GET: https://how.box/mcp/run/gas_law_calculate?law=ideal&solve=pressure&p1=100&v1=48&t1=20&pressure=101.325&volume=24&amount=1&temperature=20&pressure_unit=kpa&volume_unit=l&temperature_unit=c ## How it works A gas is mostly empty space with molecules flying about, and its pressure comes from them hitting the walls. Squeeze the same gas into half the volume and the hits come twice as often, so the pressure doubles; heat it and the molecules move faster and hit harder. The ideal gas law puts these together: P × V = n × R × T. P is the pressure, V the volume, n the amount of gas in moles, T the absolute temperature in kelvins and R = 8.314 J/(mol·K) the gas constant. One mole at 20 °C (293.15 K) in 24 L has P = 1 × 8.314 × 293.15 ÷ 0.024 m³ ≈ 101.6 kPa, about atmospheric pressure. For a fixed amount the law becomes P₁V₁/T₁ = P₂V₂/T₂: at a constant temperature, halving the volume doubles the pressure (Boyle's law), and at a constant pressure the volume grows with the kelvin temperature (Charles's law). Temperatures must be absolute, which is why °C and °F are converted to kelvins first. Real gases follow the law closely at everyday pressures and temperatures, but deviate when highly compressed or near the point where they liquefy. Sources: OpenStax Chemistry 2e, section 9.2; IUPAC, standard conditions for gases. ## FAQ **Should I enter absolute or gauge pressure?** Use absolute pressure. A gauge measures pressure above the surrounding atmosphere, so add the local atmospheric pressure before entering it. **Why do references give both 22.4 and 22.7 litres per mole?** They use different standard pressures. At 0 °C an ideal gas occupies about 22.4 L per mole at 1 atm, or 22.7 L at 100 kPa. **Can I enter grams instead of moles?** No. Divide the mass in grams by the molar mass in grams per mole first; the moles tool can do this conversion. **Can I use the combined law if gas leaks out?** Not when solving for final pressure, volume or temperature, since those modes assume a fixed amount. If you know both complete states, choose amount change to estimate the ratio of final to initial moles. **Can I use this for a gas mixture?** Yes, as an ideal-gas approximation using the total moles and total pressure. It does not calculate reactions, condensation or separate partial pressures. More: [HowToolbox index](https://how.box/llms.txt) · [Agent Skill](https://how.box/skill.md) · [agent terms](https://how.box/about/agents/)