{
  "slug": "ideal-gas-law",
  "title": "Ideal Gas Law Calculator",
  "heading": "Ideal Gas Law (PV = nRT) Calculator",
  "category": "math",
  "url": "https://www.revenuelab.fyi/toolbox/ideal-gas-law",
  "summary": "Pressure, volume, moles, and temperature in one shot.",
  "description": "PV = nRT with R = 0.08206 L·atm/(mol·K). Enter three variables and get the fourth, plus density if you supply a molar mass.",
  "formula": "PV = nRT",
  "dateModified": "2026-09-30",
  "run_url": "https://www.revenuelab.fyi/api/public/calc?tool=ideal-gas-law",
  "inputs": [
    {
      "id": "p",
      "label": "Pressure",
      "kind": "number",
      "hint": null,
      "default": 1,
      "unit": "atm",
      "min": 0.0001,
      "max": null
    },
    {
      "id": "vol",
      "label": "Volume",
      "kind": "number",
      "hint": null,
      "default": 22.4,
      "unit": "L",
      "min": 0.0001,
      "max": null
    },
    {
      "id": "t",
      "label": "Temperature",
      "kind": "number",
      "hint": null,
      "default": 273.15,
      "unit": "K",
      "min": 0.01,
      "max": null
    },
    {
      "id": "mm",
      "label": "Molar mass (optional)",
      "kind": "number",
      "hint": null,
      "default": 28.96,
      "unit": "g/mol",
      "min": 0,
      "max": null
    }
  ],
  "outputs": [
    {
      "id": "moles",
      "label": "Moles (n)",
      "format": "decimal",
      "hint": null,
      "primary": true
    },
    {
      "id": "grams",
      "label": "Mass (g)",
      "format": "decimal",
      "hint": null,
      "primary": false
    },
    {
      "id": "density",
      "label": "Density (g/L)",
      "format": "decimal",
      "hint": null,
      "primary": false
    },
    {
      "id": "celsius",
      "label": "Temperature (°C)",
      "format": "decimal",
      "hint": null,
      "primary": false
    }
  ],
  "worked_example": {
    "inputs": [
      "Pressure: 1 atm",
      "Volume: 22.4 L",
      "Temperature: 273.15 K",
      "Molar mass (optional): 28.96 g/mol"
    ],
    "outputs": [
      "Moles (n): 0.9993",
      "Mass (g): 28.941",
      "Density (g/L): 1.292",
      "Temperature (°C): 0"
    ]
  },
  "how_to": {
    "title": "How to use this",
    "steps": [
      "Enter pressure (atm).",
      "Enter volume (L).",
      "Enter temperature (K).",
      "Enter molar mass (optional) (g/mol).",
      "Read your moles (n) on the right — it updates as you type.",
      "Hit Share to keep the scenario or send it to someone."
    ]
  },
  "scenarios": [
    {
      "name": "Conservative",
      "description": "Lower-end numbers — what if things land soft?",
      "values": {
        "p": 0.6,
        "vol": 13.44,
        "t": 164,
        "mm": 17.376
      }
    },
    {
      "name": "Typical",
      "description": "Defaults — the most common real-world setup.",
      "values": {
        "p": 1,
        "vol": 22.4,
        "t": 273,
        "mm": 28.96
      }
    },
    {
      "name": "Ambitious",
      "description": "Higher-end numbers — what if things really pop?",
      "values": {
        "p": 1.6,
        "vol": 35.839999999999996,
        "t": 437,
        "mm": 46.336000000000006
      }
    }
  ],
  "limitations": [
    "Results are rounded for display; the underlying calculation keeps full precision.",
    "Very large or very small inputs may hit floating-point limits in the browser.",
    "Inputs outside the accepted range are clamped rather than rejected."
  ],
  "faq": [
    {
      "q": "How does the ideal gas law (pv = nrt) calculator work?",
      "a": "PV = nRT with R = 0.08206 L·atm/(mol·K). Enter three variables and get the fourth, plus density if you supply a molar mass. The underlying maths is: PV = nRT"
    },
    {
      "q": "What do I need to enter?",
      "a": "4 values: pressure, volume, temperature, and molar mass (optional). Each field starts with a sensible default, so you can change one number at a time and watch the result move."
    },
    {
      "q": "What does the moles (n) result mean?",
      "a": "It is returned as a decimal number and updates live as you edit the inputs, so you can compare two or three versions of a scenario in a few seconds."
    },
    {
      "q": "Is this calculator free, and do I need an account?",
      "a": "Yes, it's free, and no account is required. Nothing you type is stored on our servers — the maths runs entirely in your browser."
    },
    {
      "q": "How accurate is the result?",
      "a": "It applies the standard formula exactly, so the arithmetic is precise. Results are rounded for display; the underlying calculation keeps full precision."
    },
    {
      "q": "Who is this tool for?",
      "a": "It's built for students, developers, and anyone who needs the answer right now without setting up a spreadsheet."
    }
  ],
  "related": [],
  "license": "CC-BY-4.0",
  "citation": "RevenueLab — Ideal Gas Law Calculator (https://www.revenuelab.fyi/toolbox/ideal-gas-law)"
}