Ideal Gas Law Calculator for Chemistry and Physics Labs
Updated November 2026. The ideal gas law is the compact relation PV = nRT that first-year chemistry and physics labs still use to connect pressure, volume, amount of substance and temperature for a gas treated as ideal. This article is a method guide for an ideal gas law calculator PV=nRT workflow: pick a consistent set of units, choose a clearly labelled value of the molar gas constant R, solve for the missing variable, and state the ideal-gas assumption out loud. You can run the arithmetic in the official “Ideal Gas Law (PV = nRT)” tool in the free Free Technology Calculators collection from My Advisers (officially 669 calculators). The tool is a calculator, not a laboratory instrument and not a substitute for your course’s required data sheet. A wider tour of the collection is in this blog’s complete tools guide.
Ideal gas law calculator PV=nRT: units first, then the missing variable
The equation is PV = nRT, where P is pressure, V is volume, n is the amount of substance in moles, T is the absolute temperature in kelvin, and R is the molar gas constant. You may rearrange it as P = nRT / V, V = nRT / P, n = PV / RT, or T = PV / nR. A calculator is only doing legitimate work if every quantity on the right-hand side uses the same unit system as the R you typed.
Two labelled laboratory values of R appear in almost every lab manual, and they must not be mixed in one line:
- R = 8.314 J·mol−1·K−1, which is a rounded SI value consistent with joule, which is also pascal·metre3. Use this when pressure is in pascals (or kilopascals, after you convert) and volume is in cubic metres (or litres, after you convert to m3: 1 L = 0.001 m3).
- R = 0.0821 L·atm·mol−1·K−1, a common laboratory rounding, for pressure in atmospheres and volume in litres.
A more precise SI value, from CODATA as published by NIST, is 8.314462618 J·mol−1·K−1. Lab rounding to 8.314 is usually enough for a teaching experiment; what is not acceptable is using 8.314 with P in atmospheres and V in litres in the same product, or using 0.0821 with pascals and cubic metres. Convert first, then multiply.
Temperature must be absolute. If a problem gives 25 °C, convert: T = 25 + 273.15 = 298.15 K. If it already gives kelvin, do not add 273.15 again. Pressure units also need a conversion table you trust: 1 atm = 101325 Pa exactly, by the conventional definition used in this article; 1 bar = 100000 Pa. Do not treat “1 atm” and “1 bar” as the same number when you are close to a textbook’s standard-volume figure.
Standard temperature and pressure (STP) conventions differ, and this is a common source of a 22.4 versus 22.7 litre argument. An older convention uses 0 °C (273.15 K) and 1 atm, which with R = 0.0821 L·atm·mol−1·K−1 gives a molar volume V = R T / P = 0.0821 × 273.15 / 1 = 22.425 L per mole, usually rounded in teaching to about 22.4 L. IUPAC has recommended a standard of 0 °C and 1 bar (105 Pa), which gives a different official standard molar volume (often quoted near 22.7 L·mol−1). This article will not pretend those two conventions are identical. Always write the P and T you meant, and do not force a calculator’s “STP” button unless you have read which convention it uses.
Worked examples
Example 1 — volume of 1.00 mol at 298.15 K and 1.00 atm, with R = 0.0821 L·atm·mol−1·K−1. V = nRT / P = (1.00 × 0.0821 × 298.15) / 1.00 = 24.478 L, which you would typically report as 24.5 L if you are working to three significant figures set by 0.0821. The same problem in SI, with R = 8.314 J·mol−1·K−1, P = 101325 Pa, is V = (1.00 × 8.314 × 298.15) / 101325 = 0.024465 m3, or 24.465 L. The small difference is the rounding of R and the exact pascal equivalent of 1 atm, not a second physical law. Pick one consistent set and stay with it.
Example 2 — volume of 2.00 mol at 300 K and 2.00 atm, same laboratory R of 0.0821 L·atm·mol−1·K−1. V = (2.00 × 0.0821 × 300) / 2.00 = 24.63 L. Doubling both n and P leaves the volume in the same neighbourhood as Example 1, which is what the equation predicts.
Example 3 — find n when P = 1.50 atm, V = 10.0 L, T = 290 K, R = 0.0821 L·atm·mol−1·K−1. n = PV / RT = (1.50 × 10.0) / (0.0821 × 290) = 15.0 / 23.809 = 0.630 mol, to three significant figures.
| Example | Given | Find | Result (labelled R) |
|---|---|---|---|
| 1 | n = 1.00 mol, T = 298.15 K, P = 1.00 atm | V | 24.478 L (R = 0.0821 L·atm·mol−1·K−1) |
| 2 | n = 2.00 mol, T = 300 K, P = 2.00 atm | V | 24.63 L (same R) |
| 3 | P = 1.50 atm, V = 10.0 L, T = 290 K | n | 0.630 mol (same R) |
Real gases deviate from PV = nRT, especially at high pressure and low temperature, and when the gas is near liquefaction. A laboratory cylinder at very high pressure, or a gas collected over water if you have not accounted for water vapour in the way your procedure requires, is not automatically an ideal-gas problem. The official calculator will still compute the ideal-gas rearrangement of the numbers you enter; it will not know that the physical sample has departed from the model. State the assumption, and use a different official equation of state only if your course or procedure actually specifies one.
When a problem gives mass instead of moles, convert with the molar mass of that substance, using the molar mass your instructor or a cited data table requires. This article does not invent a molar mass for an unnamed gas. When it gives Celsius or Fahrenheit, convert to kelvin before you touch R.
Example 4 — solve for pressure in SI. You have n = 0.500 mol, V = 12.0 L = 0.0120 m3, T = 310.0 K, and R = 8.314 J·mol−1·K−1. Then P = nRT / V = (0.500 × 8.314 × 310.0) / 0.0120 = 1288.67 / 0.0120 = 1.074 × 105 Pa, or 107.4 kPa, to four significant figures on the arithmetic (report with the significant figures your procedure requires). If you had left the volume as 12.0 and still used 8.314, the pressure would be wrong by a factor of a thousand. That is the usual SI trap, and a calculator will not save you if you do not convert the litre value.
Example 5 — a collected-gas sketch, still under the ideal-gas assumption and still labelled. A student collects 240 mL of a dry gas (already corrected, in the lab notebook, for water vapour if the official procedure required it) at 22.0 °C and 0.980 atm, and wants n. Convert: V = 0.240 L, T = 295.15 K, R = 0.0821 L·atm·mol−1·K−1. n = PV / RT = (0.980 × 0.240) / (0.0821 × 295.15) = 0.2352 / 24.232 = 0.00971 mol, to three significant figures. The official calculator can repeat that line. It cannot decide whether the sample was actually dry, whether the temperature probe had equilibrated, or whether your procedure’s “room pressure” was an official barometer reading. Those are lab-book questions.
When two groups in a class get different volumes for “the same” STP fill-in, ask which STP they used before you ask which group made an arithmetic error. A 1 atm convention and a 1 bar convention will not agree at the second decimal of a molar volume, and an extra 273 instead of 273.15 is a smaller but real difference at teaching precision. Write the convention at the top of the notebook page, and type the same P and T into the official “Ideal Gas Law (PV = nRT)” tool. If the tool offers a preset labelled only “STP,” read the tool’s own unit labels; this article will not invent that preset’s official convention.
Dimensional checking is the fastest defence. The product nRT must have the same units as PV. If R is in J·mol−1·K−1, nRT is in joules, and PV must also be in joules, which pascals times cubic metres are. If one factor is still in litres or in celsius, the product is meaningless. Do that check before you worry about the third significant figure. Then, and only then, compare the calculator’s display with your hand calculation to catch a typing error.
A final labelled rearrangement is useful when a problem gives a mass. Suppose 4.00 g of a gas whose molar mass, taken from your official data table or instructor, is 32.00 g·mol−1 (a conventional value for O2 in many teaching tables, used here only as a labelled molar mass). Then n = 4.00 / 32.00 = 0.125 mol. Place that sample at 298.15 K and 1.00 atm with R = 0.0821 L·atm·mol−1·K−1, and V = 0.125 × 0.0821 × 298.15 / 1.00 = 3.060 L, or 3.06 L to three significant figures. Change the molar mass, and the volume changes in proportion; the official ideal-gas tool will not know the molar mass unless you convert to moles first, or unless a particular field on the official page asks for mass and molar mass together. This article does not invent extra official fields. Convert carefully, then enter n.
If your lab also uses other official calculators in the same collection for concentration work, keep the ideal-gas problem and the solution-chemistry problem in separate notebook sections. A gas-volume result is not a molarity unless you have dissolved that amount in a stated volume of solution, which is a different official tool and a different article. Do not import a litre of gas as if it were a litre of solution.
Frequently asked questions
Which value of R should I type?
The one whose units match P and V. Use 0.0821 L·atm·mol−1·K−1 only with litres and atmospheres, and 8.314 J·mol−1·K−1 only in a consistent SI set, after any litre-to-cubic-metre and atmosphere-to-pascal conversions.
Is 22.4 L always the molar volume at STP?
No. That teaching figure is tied to a 0 °C and 1 atm convention and a rounded R. A 1 bar STP convention gives a different molar volume. Write the pressure and temperature you mean.
Does the official calculator measure a real gas in the lab?
No. It rearranges PV = nRT for the numbers you enter. Your manometer, gas syringe and temperature probe are the instruments.
Can I mix kilopascals with litres and R = 8.314 without converting?
Not if you want a correct SI volume in cubic metres. Convert volume to cubic metres and pressure to pascals, or use a consistent R in kPa·L units that you have written down and checked. Do not mix silently.
Is this a chemistry-course substitute?
No. Follow your lab manual, significant-figure rules and safety procedures. The calculator is only arithmetic.
Disclaimer
This article is for education only. It is not laboratory advice and not a claim about a particular official calculator’s default STP convention. Confirm units, the value of R, and your course or institutional data. Real gases can deviate from the ideal-gas law.
References
- My Advisers, Free Technology Calculators (official “Ideal Gas Law (PV = nRT)” tool): https://myadvisers.in/free-technology-calculators/.
- NIST, CODATA value of the molar gas constant R: https://physics.nist.gov/cgi-bin/cuu/Value?r.
Comments
Post a Comment