The Ideal Gas Law Calculator solves PV = nRT for whichever variable is left blank. Enter pressure, volume, amount and temperature with a consistent gas constant R; the tool returns the unknown and shows the substituted arithmetic. Temperature converts to kelvin before solving so Celsius never enters the product as if it were absolute.
Solve PV = nRT for any variable
Four measurable quantities describe an ideal gas sample: pressure, volume, amount in moles and absolute temperature. The product PV equals nRT, so any one unknown follows once the other three and a matching R are known. The tool fills the blank field and prints the substituted numbers with units so mixed-unit mistakes stay visible.
P = nRT / V
V = nRT / P
n = PV / RT
T = PV / nR
Enter three known values plus a chosen R, then read the fourth. When all four are supplied, compare PV to nRT as a consistency check. Mismatch usually means mixed units or a Celsius temperature left unconverted. Ideal behaviour assumes point particles, no attractions and elastic collisions. Air near room temperature and one atmosphere is close enough for most teaching labs; steam near saturation or CO2 near its critical point is not.
Significant figures should follow the weakest input. A pressure known to two figures does not justify reporting volume to five decimals even if the floating-point engine can print them.
Choose the right value of R
The gas constant R is a family of numerically different constants that encode unit conversions, not a single universal digit string. Using 8.314 while pressure is in atmospheres and volume is in litres produces nonsense results that still look precise. Match R to the pressure and volume units on the problem statement before solving.
| R (approx.) | When P and V are in |
|---|---|
| 0.082057 L·atm·K⁻¹·mol⁻¹ | litres and atmospheres |
| 8.314 J·K⁻¹·mol⁻¹ | m³ and pascals (SI), or energy form |
| 62.364 L·Torr·K⁻¹·mol⁻¹ | litres and torr (mmHg) |
| 8.314e-5 m³·bar·K⁻¹·mol⁻¹ | m³ and bar |
The fixture value for litre-atmosphere work on this site is R = 0.082057 L·atm·K⁻¹·mol⁻¹. Rounded teaching values such as 0.0821 are fine for two-significant-figure problems; keep extra digits when the inputs justify them. With R = 8.314 J·K⁻¹·mol⁻¹, the product nRT has units of joules, which equals Pa·m³. Convert cm³ to m³ and kPa to Pa before trusting SI mode.
Convert temperature to kelvin
Gas-law temperature must be absolute. Celsius and Fahrenheit are shifted scales; inserting 25 into PV = nRT as if it were kelvin understates T by roughly an order of magnitude for everyday lab work and throws every other variable off. Convert first, then multiply.
T(K) = t(°C) + 273.15
So 25 °C becomes 298.15 K. Zero °C is 273.15 K, not zero. Negative Celsius values remain positive kelvin until absolute zero. Fahrenheit converts by T(K) = (t(°F) - 32) × 5/9 + 273.15, or convert to Celsius first. The calculator applies the +273.15 step when a Celsius input is selected. If a problem already states kelvin, leave the unit on K so the offset is not applied twice.
Rankine is another absolute scale used in some US engineering texts. Prefer kelvin unless the assigned R is built for Rankine, and never mix Rankine with a kelvin-based R.
Calculate the volume of 1 mole at STP
Standard molar volume is the classic check that R, T and P are wired correctly. Introductory texts often treat STP as 1 atm and 273.15 K (0 °C). For one mole of ideal gas those inputs should return about 22.4 litres when R is the litre-atmosphere constant used here.
V = nRT / P
V = (1.000 × 0.082057 × 273.15) / 1.000
V ≈ 22.41 L
That is the familiar "about 22.4 litres per mole" figure. Some standards bodies define STP differently (for example 100 kPa instead of 1 atm). Always read which P and T a table calls standard before comparing volumes.
Room-temperature check at 25 °C. Same n and P = 1.000 atm, T = 298.15 K:
V = (1.000 × 0.082057 × 298.15) / 1.000 ≈ 24.47 L
One mole occupies more volume at 25 °C than at 0 °C at the same pressure. The Ideal Gas Law Calculator should match these figures when R = 0.082057 and units are L and atm. Changing only T while holding P and n fixed is a direct Charles's-law style check inside the full equation.
Apply the combined gas law
Fixed amount of gas means PV/T stays constant between two states, which is the combined gas law. Pressure, volume and temperature can each change; moles do not. Solve for any one unknown after a before-and-after experiment when n is unchanged and the ideal model still holds.
P1 V1 / T1 = P2 V2 / T2
Example: gas at 1.00 atm and 2.00 L and 298.15 K is cooled to 273.15 K at constant pressure.
V2 = V1 × (T2 / T1) = 2.00 × (273.15 / 298.15) ≈ 1.83 L
Boyle's law (T fixed), Charles's law (P fixed) and Gay-Lussac's law (V fixed) are special cases of the same relation. The full ideal-gas form is needed when n also changes, for example when gas is added to a cylinder. Keep both temperatures in kelvin; cancelling Celsius values in a ratio is invalid because the zero points differ.
Understand when the ideal gas law fails
Real gases depart from PV = nRT when molecules occupy appreciable volume or attract each other strongly. High pressure packs particles close enough that finite size matters. Low temperature strengthens attractions relative to kinetic energy. Near condensation, measured volumes and pressures can miss the ideal prediction by large fractions.
van der Waals and other real-gas equations add corrections (a for attractions, b for excluded volume). Use them when a problem states critical constants or when compressibility factor Z = PV/nRT drifts far from 1. For dry air at 1 atm and 25 °C, Z is close enough to 1 that ideal estimates are usually within a percent; that comfort disappears for refrigerants in a compressor discharge line.
Mixtures still use the ideal law with total P and total n when each component behaves ideally (Dalton's law of partial pressures). Non-ideal mixtures need fugacities, which this calculator does not claim to provide. Report Z beside an ideal estimate when a process operates near critical conditions so readers know the model limit.
Unit checklist before solving
A short checklist prevents the usual homework disasters before algebra starts. Convert temperature to kelvin. Match volume and pressure units to R. Express amount in moles (mass / molar mass when grams are given). Solve, then round to the precision of the weakest input so extra decimals do not imply false accuracy.
- Convert temperature to K.
- Convert volume to the unit that matches R (L with 0.082057; m³ with SI R).
- Convert pressure to the matching unit (atm, Pa, torr, bar).
- Express amount in moles.
- Solve and round to the weakest input.
Skipping the kelvin step is the error that produces 25 K "lab" temperatures and absurd pressures. The calculator's unit selectors exist to make that failure mode visible. Pairing with the molecular-weight page covers formula-to-moles work when the sample mass is given instead of n.
Frequently asked questions
What is the ideal gas law?
The ideal gas law is PV = nRT, which relates pressure, volume, moles and absolute temperature through the gas constant R. It models gases when intermolecular forces and particle volume are negligible compared with the spacing and kinetic energy of the sample. Teaching labs use it for dry air and many light gases near room conditions.
Which R should be used with litres and atmospheres?
Use about 0.082057 L·atm·K⁻¹·mol⁻¹ (often rounded to 0.0821) when volume is in litres and pressure is in atmospheres. Do not mix that R with pascals and cubic metres; switch to 8.314 J·K⁻¹·mol⁻¹ (and SI volume/pressure) for that unit set instead.
How do you convert 25 °C for the gas law?
Add 273.15 to Celsius to obtain kelvin: 25 + 273.15 = 298.15 K. Never insert 25 directly into PV = nRT. The same offset applies to any other Celsius temperature before multiplication by R.
What is the molar volume at STP?
About 22.4 L/mol when STP means 1 atm and 273.15 K with R ≈ 0.082057 L·atm·K⁻¹·mol⁻¹. Confirm the STP definition in the source being compared; a 100 kPa standard shifts the molar volume slightly.
Can the calculator solve for moles from mass?
Enter moles directly, or convert mass to moles first with molar mass (mass / M). Pairing with the molecular-weight page covers formula-to-moles work when only a chemical formula and a gram amount are known.
When does the ideal gas law fail?
The ideal model fails at high pressure, low temperature, near condensation, or for gases with strong interactions. Check compressibility factor Z or switch to a real-gas equation when accuracy matters for process design.
Is STP the same as 25 °C and 1 atm?
No. Conditions near 25 °C and 1 atm are sometimes called SATP or a room-temperature reference; molar volume is then near 24.5 L, not 22.4 L. Label the T and P used whenever quoting a molar volume.
Does R include Avogadro's number?
Yes. R equals NA times Boltzmann's constant k. Macroscopic PV = nRT already folds that relation in when n is expressed in moles, so Avogadro's number does not appear as a separate factor in ordinary ideal-gas algebra.
Can temperature be in Rankine?
Temperature may be in Rankine if R is chosen for Rankine-compatible units. Prefer kelvin to avoid mixing absolute scales. Mixing Rankine with a kelvin-based R is as wrong as mixing Celsius with kelvin R.
Summary
The Ideal Gas Law Calculator solves PV = nRT after temperature is on the kelvin scale and R matches the pressure-volume units. With R = 0.082057 L·atm·K⁻¹·mol⁻¹, one mole at 1 atm and 273.15 K occupies about 22.4 L; at 25 °C (298.15 K) the same amount occupies about 24.5 L.
Combined-gas rearrangements cover fixed-n changes of state, and real-gas caveats apply when Z drifts from 1.