Chemistry calculator
Ideal Gas Law Calculator
Solve the ideal gas law for temperature using liters and atmospheres.
Uses R = 0.082057 L·atm·mol⁻¹·K⁻¹ and solves PV = nRT for temperature.
Temperature
—
This tool solves specifically for temperature
The ideal gas law relates four quantities, but this calculator is wired to solve for only one of them: temperature. You supply pressure in atmospheres, volume in liters, and amount of gas in moles, and it rearranges PV = nRT to T = PV ÷ nR. To solve for pressure, volume, or moles instead, rearrange the equation yourself — for example P = nRT ÷ V — and use a general calculator, since this page won't do that rearrangement for you.
All three inputs must be strictly greater than zero, not merely non-negative. A pressure, volume, or mole count of exactly zero describes a sample with no gas or no space for it to occupy, which makes T = PV ÷ nR either 0 ÷ 0 or division by zero, so the result stays blank rather than showing a false answer.
There are no unit dropdowns on this page — pressure must already be in atmospheres and volume in liters before you type them in. Converting from kPa, bar, mL, or another unit has to happen before you enter the numbers.
The ideal gas law, rearranged for temperature
At standard conditions of 1 atm, 22.414 L, and 1 mol: T = (1 × 22.414) ÷ (1 × 0.082057) = 22.414 ÷ 0.082057 ≈ 273.152 K, which the calculator also reports as 0.002 °C. The tiny 0.002 K gap from the textbook value of exactly 273.15 K comes from R being entered to five significant figures (0.082057) rather than its more exact value of 0.08205736 L·atm/(mol·K).
At room temperature, 1 mol of gas at 1 atm occupies close to 24.45 L: T = 24.45 ÷ 0.082057 ≈ 297.964 K, or 24.814 °C — the reason 24.45 L/mol at 1 atm is sometimes quoted alongside 22.414 L/mol at STP as a "room-temperature molar volume."
Where the ideal gas approximation stops being accurate
The ideal gas law assumes gas particles have no volume of their own and no attraction to each other, which holds up reasonably well at low pressure and high temperature but breaks down as a gas approaches the conditions where it would condense into a liquid. Carbon dioxide, for instance, deviates noticeably from ideal behavior well before reaching its critical point near 31 °C and 72.8 atm, and polar molecules like ammonia and water vapor deviate even at moderate pressure because of hydrogen bonding the ideal model doesn't account for.
Real-gas equations such as the Van der Waals equation add correction terms for molecular volume and intermolecular attraction; this calculator uses none of them, so results for gases near condensation, at very high pressure, or at very low temperature should be treated as rough approximations rather than precise values.
Using PV = nRT as a sanity check
Solving for temperature is often less about prediction and more about catching mistakes in the other three numbers:
- STP verification: 1 atm, 22.414 L, 1 mol → 273.152 K (0.002 °C), confirming the classic "22.4 liters per mole" approximation
- Room-temperature molar volume: 1 atm, 24.45 L, 1 mol → 297.964 K (24.814 °C)
- Reaction-flask check: 2 atm, 5 L, 0.1 mol → 1,218.665 K (945.515 °C) — a temperature far beyond typical glassware, flagging a likely mole-count or pressure entry error before it propagates into a lab report
- Compressed cylinder: 150 atm, 2 L, 12 mol → 304.666 K (31.516 °C), a plausible room-adjacent temperature for a small high-pressure cylinder
- Low mole count sensitivity: 0.25 atm, 5 L, 0.02 mol → 761.666 K (488.516 °C), showing how sharply the implied temperature rises when the mole count in the denominator is small
Frequently asked questions
Can this calculator solve for pressure, volume, or moles instead of temperature?
No, it only computes T = PV ÷ nR. To find pressure, volume, or moles, rearrange the ideal gas law algebraically — for instance P = nRT ÷ V — and work it out with a general-purpose calculator.
Why do pressure, volume, and moles all need to be strictly greater than zero?
A value of exactly zero for any of them describes a sample with no gas present or no space for it, which turns the formula into an undefined 0 ÷ 0 or a division by zero rather than a real temperature.
Why doesn't the STP example give exactly 273.15 K?
The calculator uses R = 0.082057 L·atm/(mol·K), rounded to five significant figures. The more precise value, 0.08205736, would bring the STP result a hair closer to the textbook 273.15 K; the 0.002 K difference is just rounding in the constant.
What units does the calculator expect?
Pressure in atmospheres and volume in liters — there's no dropdown to change this. If your data is in kPa, bar, or milliliters, convert it to atm and L before entering the numbers.
Does the ideal gas law work for gases like steam or ammonia?
Only approximately, and the approximation gets worse as those gases approach the temperature and pressure where they'd condense. Polar, hydrogen-bonding molecules like water vapor and ammonia deviate from ideal behavior more than nonpolar gases like nitrogen or helium do.
How do I get moles from a mass in grams?
Divide the mass in grams by the substance's molar mass in g/mol. The calculator doesn't perform this conversion — moles must already be calculated before you enter the number.