{"success":true,"version":"v1","request":{"tool":"get_calculator_schema","calculator_id":"ideal-gas-law"},"result":{"entity_type":"calculator","id":"ideal-gas-law","calculator_id":"ideal-gas-law","canonical_url":"https://tttkmbb.com/chemistry/ideal-gas-law","name":"Ideal Gas Law Calculator","title":"Ideal Gas Law Calculator – Solve PV = nRT for Pressure, Volume, Moles or Temperature","category":"chemistry","category_name":"Chemistry","tool_name":"solve_ideal_gas_law","featured_mcp_tool":false,"description":"Solves the ideal gas equation PV = nRT for whichever of pressure, volume, amount or temperature is left empty, with pressure in atm, kPa, bar, mmHg or psi and temperature in °C, K or °F.","use_when":"You know three of pressure, volume, moles and temperature of a gas and need the fourth, or the molar volume at given conditions.","do_not_use_when":"The gas is near condensation or at very high pressure (use a real-gas equation such as van der Waals), or you need the mass of gas without knowing its molar mass (combine with moles-mass).","inputs":[{"name":"pressure","label":"Pressure","type":"number","required":false,"exclusive_min":0,"description":"Gas pressure in the unit given by pressure_unit. Leave empty to solve for it.","example":1},{"name":"pressure_unit","label":"Pressure unit","type":"enum","required":false,"default":"atm","values":[{"value":"atm","label":"atm"},{"value":"kpa","label":"kPa","aliases":["kilopascal"]},{"value":"bar","label":"bar"},{"value":"mmhg","label":"mmHg (Torr)","aliases":["torr"]},{"value":"psi","label":"psi"}],"description":"Unit of the pressure input (1 atm = 101.325 kPa = 1.01325 bar = 760 mmHg = 14.696 psi).","example":"atm"},{"name":"volume_l","label":"Volume","type":"number","unit":"L","required":false,"exclusive_min":0,"description":"Gas volume in litres. Leave empty to solve for it."},{"name":"moles","label":"Amount of gas","type":"number","unit":"mol","required":false,"exclusive_min":0,"description":"Amount of gas in moles. Leave empty to solve for it.","example":1},{"name":"temperature","label":"Temperature","type":"number","required":false,"min":-459.67,"max":10000000,"description":"Gas temperature in the unit given by temperature_unit (must be above absolute zero). Leave empty to solve for it.","example":0},{"name":"temperature_unit","label":"Temperature unit","type":"enum","required":false,"default":"celsius","values":[{"value":"celsius","label":"°C","aliases":["c"]},{"value":"kelvin","label":"K","aliases":["k"]},{"value":"fahrenheit","label":"°F","aliases":["f"]}],"description":"Unit of the temperature input; the calculation uses kelvin.","example":"celsius"}],"outputs":[{"name":"solved_for","label":"Solved for","type":"string","decimals":4,"description":"pressure, volume_l, moles or temperature."},{"name":"pressure_atm","label":"Pressure","type":"number","unit":"atm","decimals":6,"description":"Pressure in standard atmospheres."},{"name":"pressure_kpa","label":"Pressure","type":"number","unit":"kPa","decimals":4,"description":"Pressure in kilopascals (1 atm = 101.325 kPa)."},{"name":"pressure_bar","label":"Pressure","type":"number","unit":"bar","decimals":6,"description":"Pressure in bar (1 atm = 1.01325 bar)."},{"name":"volume_l","label":"Volume","type":"number","unit":"L","decimals":4,"description":"Gas volume in litres."},{"name":"moles","label":"Moles","type":"number","unit":"mol","decimals":6,"description":"Amount of gas."},{"name":"temperature_k","label":"Temperature","type":"number","unit":"K","decimals":2,"description":"Absolute temperature."},{"name":"temperature_c","label":"Temperature","type":"number","unit":"°C","decimals":2,"description":"Temperature in degrees Celsius."},{"name":"molar_volume_l_per_mol","label":"Molar volume","type":"number","unit":"L/mol","decimals":4,"description":"V / n at these conditions (22.414 L/mol at 0 °C and 1 atm)."}],"input_schema":{"type":"object","properties":{"pressure":{"description":"Gas pressure in the unit given by pressure_unit. Leave empty to solve for it.","type":"number","exclusiveMinimum":0,"examples":[1]},"pressure_unit":{"description":"Unit of the pressure input (1 atm = 101.325 kPa = 1.01325 bar = 760 mmHg = 14.696 psi).","type":"string","enum":["atm","kpa","bar","mmhg","psi"],"default":"atm","examples":["atm"]},"volume_l":{"description":"Gas volume in litres. Leave empty to solve for it. Unit: L.","type":"number","exclusiveMinimum":0,"x-unit":"L"},"moles":{"description":"Amount of gas in moles. Leave empty to solve for it. Unit: mol.","type":"number","exclusiveMinimum":0,"examples":[1],"x-unit":"mol"},"temperature":{"description":"Gas temperature in the unit given by temperature_unit (must be above absolute zero). Leave empty to solve for it.","type":"number","minimum":-459.67,"maximum":10000000,"examples":[0]},"temperature_unit":{"description":"Unit of the temperature input; the calculation uses kelvin.","type":"string","enum":["celsius","kelvin","fahrenheit"],"default":"celsius","examples":["celsius"]}},"additionalProperties":false},"output_schema":{"type":"object","properties":{"solved_for":{"description":"pressure, volume_l, moles or temperature.","type":"string"},"pressure_atm":{"description":"Pressure in standard atmospheres. Unit: atm.","type":"number","x-unit":"atm"},"pressure_kpa":{"description":"Pressure in kilopascals (1 atm = 101.325 kPa). Unit: kPa.","type":"number","x-unit":"kPa"},"pressure_bar":{"description":"Pressure in bar (1 atm = 1.01325 bar). Unit: bar.","type":"number","x-unit":"bar"},"volume_l":{"description":"Gas volume in litres. Unit: L.","type":"number","x-unit":"L"},"moles":{"description":"Amount of gas. Unit: mol.","type":"number","x-unit":"mol"},"temperature_k":{"description":"Absolute temperature. Unit: K.","type":"number","x-unit":"K"},"temperature_c":{"description":"Temperature in degrees Celsius. Unit: °C.","type":"number","x-unit":"°C"},"molar_volume_l_per_mol":{"description":"V / n at these conditions (22.414 L/mol at 0 °C and 1 atm). Unit: L/mol.","type":"number","x-unit":"L/mol"}}},"formula":"P × V = n × R × T with R = 0.082057366 L·atm/(mol·K) (= 8.314462618 J/(mol·K)); P converted to atm, T to kelvin (K = °C + 273.15)","method":"Ideal-gas behaviour is accurate to about 1% for common gases near room temperature and pressures up to a few atmospheres; deviations grow near the boiling point and above roughly 10 atm.","sources":[{"name":"NIST – CODATA internationally recommended values of the fundamental physical constants (molar gas constant R = 8.314462618 J/(mol·K), exact)","url":"https://physics.nist.gov/cuu/Constants/index.html","type":"standard","retrieved_at":"2026-09-23"},{"name":"OpenStax Chemistry 2e – 9.2 Relating Pressure, Volume, Amount, and Temperature: The Ideal Gas Law","url":"https://openstax.org/books/chemistry-2e/pages/9-2-relating-pressure-volume-amount-and-temperature-the-ideal-gas-law","type":"textbook","retrieved_at":"2026-09-23"},{"name":"Wikipedia – Ideal gas law","url":"https://en.wikipedia.org/wiki/Ideal_gas_law","type":"reference","retrieved_at":"2026-09-23"}],"freshness":{"type":"static","max_age_seconds":null,"note":"Deterministic formula with fixed constants; results never go stale. Inputs supplied by the caller determine the output."},"examples":[{"name":"Molar volume at 0 °C and 1 atm","inputs":{"pressure":1,"pressure_unit":"atm","moles":1,"temperature":0,"temperature_unit":"celsius"},"expected":{"solved_for":"volume_l","volume_l":22.414,"molar_volume_l_per_mol":22.414,"temperature_k":273.15,"pressure_kpa":101.325},"url":"https://tttkmbb.com/api/v1/calculate/ideal-gas-law?pressure=1&pressure_unit=atm&moles=1&temperature=0&temperature_unit=celsius"},{"name":"Moles in 5 L at 101.325 kPa and 25 °C","inputs":{"pressure":101.325,"pressure_unit":"kpa","volume_l":5,"temperature":25},"expected":{"solved_for":"moles","moles":0.20437,"pressure_atm":1,"temperature_k":298.15,"molar_volume_l_per_mol":24.4654},"url":"https://tttkmbb.com/api/v1/calculate/ideal-gas-law?pressure=101.325&pressure_unit=kpa&volume_l=5&temperature=25"}],"faq":[{"q":"Why is the molar volume 22.414 L and not 22.7 L?","a":"22.414 L/mol applies at 0 °C and 1 atm (101.325 kPa). IUPAC's current STP is 0 °C and 1 bar (100 kPa), which gives 22.711 L/mol; enter pressure 1 bar to reproduce it."},{"q":"Can I enter temperature in Celsius?","a":"Yes, temperature_unit defaults to celsius and the value is converted to kelvin internally; temperatures at or below absolute zero are rejected."}],"tags":["ideal gas law","pv=nrt","gas constant","molar volume","stp","gas pressure volume temperature"],"related":[{"calculator_id":"moles-mass","reason":"Convert the moles of gas to mass or number of molecules."},{"calculator_id":"pressure","reason":"Pressure expressed in Pa, kPa, bar, psi and atm (or from force and area)."},{"calculator_id":"temperature","reason":"Convert between Celsius, Fahrenheit and kelvin."}],"links":{"html":"https://tttkmbb.com/chemistry/ideal-gas-law","markdown":"https://tttkmbb.com/chemistry/ideal-gas-law.md","json":"https://tttkmbb.com/chemistry/ideal-gas-law.json","api":"https://tttkmbb.com/api/v1/calculate/ideal-gas-law","schema":"https://tttkmbb.com/api/v1/calculators/ideal-gas-law","openapi":"https://tttkmbb.com/openapi.json","mcp":"https://tttkmbb.com/mcp"},"version":"v1","updated_at":"2026-09-23"},"timestamp":"2026-09-23T23:32:53Z"}