{
    "name": "Ideal Gas Law Calculator",
    "url": "https://calculators.geekmidst.com/calculators/ideal-gas-law-calculator",
    "markdown": "https://calculators.geekmidst.com/calculators/ideal-gas-law-calculator.md",
    "category": "Science & engineering",
    "description": "Solve the ideal gas law for pressure, volume, amount of gas or temperature, with kPa, bar, atm or psi, litres or m³, and kelvin, °C or °F.",
    "summary": "For an ideal gas, pressure × volume = amount × R × absolute temperature. Enter any three of P, V, n and T to get the fourth.",
    "also_called": [
        "PV = nRT calculator",
        "Gas law calculator"
    ],
    "applies_to": "Worldwide",
    "last_updated": "2026-10-29",
    "computation": "Results are computed in the visitor’s browser on the HTML page. This API describes the calculator; it does not compute results.",
    "inputs": [
        {
            "name": "solve",
            "label": "Solve for",
            "type": "select",
            "default": "volume",
            "options": {
                "pressure": "Pressure (P)",
                "volume": "Volume (V)",
                "moles": "Amount of gas (n)",
                "temperature": "Temperature (T)"
            }
        },
        {
            "name": "pressure",
            "label": "Pressure (absolute)",
            "type": "number",
            "default": "101.325",
            "shown_when": {
                "solve": [
                    "volume",
                    "moles",
                    "temperature"
                ]
            }
        },
        {
            "name": "pressure_unit",
            "label": "Pressure unit",
            "type": "select",
            "default": "kpa",
            "options": {
                "pa": "pascals (Pa)",
                "kpa": "kilopascals (kPa)",
                "mpa": "megapascals (MPa)",
                "bar": "bar",
                "atm": "atmospheres (atm)",
                "psi": "psi",
                "mmhg": "mmHg"
            }
        },
        {
            "name": "volume",
            "label": "Volume",
            "type": "number",
            "default": "22.4",
            "shown_when": {
                "solve": [
                    "pressure",
                    "moles",
                    "temperature"
                ]
            }
        },
        {
            "name": "volume_unit",
            "label": "Volume unit",
            "type": "select",
            "default": "l",
            "options": {
                "m3": "cubic metres (m³)",
                "l": "litres (L)",
                "ml": "millilitres (mL)",
                "ft3": "cubic feet (ft³)",
                "in3": "cubic inches (in³)",
                "gal": "US gallons"
            }
        },
        {
            "name": "moles",
            "label": "Amount of gas",
            "type": "number",
            "default": "1",
            "unit": "mol",
            "shown_when": {
                "solve": [
                    "pressure",
                    "volume",
                    "temperature"
                ]
            }
        },
        {
            "name": "temperature",
            "label": "Temperature",
            "type": "number",
            "default": "0",
            "shown_when": {
                "solve": [
                    "pressure",
                    "volume",
                    "moles"
                ]
            }
        },
        {
            "name": "temperature_unit",
            "label": "Temperature unit",
            "type": "segmented",
            "default": "c",
            "options": {
                "k": "K",
                "c": "°C",
                "f": "°F"
            }
        }
    ],
    "outputs": [
        {
            "key": "answer",
            "label": "Result",
            "format": "text"
        },
        {
            "key": "pressure_kpa",
            "label": "Pressure",
            "format": "number"
        },
        {
            "key": "volume_l",
            "label": "Volume",
            "format": "number"
        },
        {
            "key": "moles",
            "label": "Amount of gas",
            "format": "number"
        },
        {
            "key": "temperature_k",
            "label": "Temperature",
            "format": "number"
        },
        {
            "key": "temperature_c",
            "label": "Temperature",
            "format": "number"
        },
        {
            "key": "molar_volume_l",
            "label": "Molar volume",
            "format": "number"
        },
        {
            "key": "molecules",
            "label": "Number of molecules",
            "format": "number"
        }
    ],
    "formula": {
        "text": "P V = n R T;  R = 8.314462618 J/(mol·K);  T(K) = T(°C) + 273.15",
        "variables": {
            "P": "absolute pressure in Pa",
            "V": "volume in m³",
            "n": "amount of substance in mol",
            "R": "molar gas constant, 8.314462618… J/(mol·K), exact in the 2019 SI (N_A × k)",
            "T": "absolute temperature in kelvin"
        }
    },
    "worked_example": {
        "inputs": {
            "solve": "volume",
            "pressure": "101.325",
            "pressure_unit": "kpa",
            "volume": "22.4",
            "volume_unit": "l",
            "moles": "1",
            "temperature": "0",
            "temperature_unit": "c"
        },
        "steps": [
            "T = 0 + 273.15 = 273.15 K; P = 101,325 Pa.",
            "V = n R T ÷ P = 1 × 8.314462618 × 273.15 ÷ 101,325 = 0.0224140 m³.",
            "That is 22.414 L, matching the CODATA molar volume of an ideal gas at 0 °C and 1 atm (22.41397 L/mol)."
        ],
        "result": "One mole of an ideal gas at 0 °C and 1 atm occupies 22.414 litres."
    },
    "interpretation": "Real gases follow the ideal law closely at low pressure and well above their boiling point; air at room conditions deviates by well under 1%. Always use absolute pressure and absolute temperature.",
    "assumptions": [
        "Ideal gas: no intermolecular forces and negligible molecular volume."
    ],
    "limitations": [
        "At high pressure or near condensation, use a real-gas equation (van der Waals, Peng–Robinson) or a compressibility factor Z.",
        "Gauge pressure readings must have atmospheric pressure added first."
    ],
    "rules": null,
    "faqs": [
        {
            "question": "Why must temperature be in kelvin?",
            "answer": "The law is proportional to absolute temperature. Doubling from 10 °C to 20 °C is only a 3.5% rise in kelvin (283.15 to 293.15 K)."
        },
        {
            "question": "What value of R should I use?",
            "answer": "R = 8.314462618 J/(mol·K), which equals 8.314462618 kPa·L/(mol·K) or 0.0820574 L·atm/(mol·K). This calculator converts units for you."
        }
    ],
    "sources": [
        {
            "title": "NIST: Fundamental physical constants (CODATA)",
            "url": "https://physics.nist.gov/"
        },
        {
            "title": "BIPM: The International System of Units (SI)",
            "url": "https://www.bipm.org/"
        }
    ],
    "related": [
        {
            "name": "Pressure Calculator",
            "url": "https://calculators.geekmidst.com/calculators/pressure-calculator"
        },
        {
            "name": "Temperature Converter",
            "url": "https://calculators.geekmidst.com/calculators/temperature-converter"
        },
        {
            "name": "Molarity Calculator",
            "url": "https://calculators.geekmidst.com/calculators/molarity-calculator"
        },
        {
            "name": "Molecular Weight Calculator",
            "url": "https://calculators.geekmidst.com/calculators/molecular-weight-calculator"
        },
        {
            "name": "Gas Density Calculator",
            "url": "https://calculators.geekmidst.com/calculators/gas-density-calculator"
        }
    ],
    "disclaimer": null,
    "publisher": "GM¹X CalcVerse"
}