How to use the ideal gas law calculator
- Select which variable to solve for using the Solve for dropdown.
- Enter the known values in SI units: pressure in pascals, volume in cubic meters, amount in moles and temperature in kelvins.
- The calculator updates live as you type, showing the computed result along with common unit conversions.
- Use the conversion hints below each field if you need to convert from atmospheres, liters or degrees Celsius first.
How the ideal gas law works
The ideal gas law relates four state variables of a hypothetical ideal gas through the equation PV = nRT. Here P is absolute pressure in pascals, V is volume in cubic meters, n is the amount of substance in moles, T is absolute temperature in kelvins and R is the universal gas constant, exactly 8.314462618 J/(mol K).
To find any one variable, rearrange the formula algebraically. For example, solving for pressure gives P = nRT / V. If you have 1 mole of gas at 273.15 K occupying 0.022414 m3, the calculation is 1 x 8.314462618 x 273.15 / 0.022414 = 101,324.86 Pa, which is very close to 1 standard atmosphere.
Unit conversions for gas law problems
This ideal gas law calculator requires inputs in SI units. Use these exact conversion factors before entering your values:
| From | To SI | Multiply by |
|---|---|---|
| Atmospheres (atm) | Pascals (Pa) | 101,325 |
| Kilopascals (kPa) | Pascals (Pa) | 1,000 |
| Bar | Pascals (Pa) | 100,000 |
| Liters (L) | Cubic meters (m3) | 0.001 |
| Milliliters (mL) | Cubic meters (m3) | 0.000001 |
| Degrees Celsius (°C) | Kelvins (K) | Add 273.15 |
If you frequently work with atmospheres and kilopascals, the atm to kPa converter can help you switch between those pressure units quickly.
When the ideal gas law applies
The equation PV = nRT models gases that behave ideally, meaning their molecules occupy negligible volume and exert no intermolecular forces. Real gases approximate this behavior well under conditions of relatively low pressure and high temperature compared to their critical points.
Common applications include estimating the volume of a gas produced in a chemical reaction, calculating the pressure inside a sealed container when heated, and determining how many moles of gas are present in a given space. For instance, standard temperature and pressure (STP) is defined as 273.15 K and 100,000 Pa (1 bar), where one mole of an ideal gas occupies about 22.711 liters.
At very high pressures or very low temperatures, real gases deviate from ideal behavior. In those cases, equations like the Van der Waals equation add correction terms for molecular size and attraction. However, for most introductory chemistry and engineering calculations, the ideal gas law provides sufficient accuracy.
Rearranged formulas reference
Depending on which variable you need, use the corresponding rearrangement of PV = nRT:
- Pressure:
P = nRT / V - Volume:
V = nRT / P - Moles:
n = PV / RT - Temperature:
T = PV / nR
In every case, R remains 8.314462618 J/(mol K). Ensure all inputs are converted to pascals, cubic meters, moles and kelvins before substituting them into the chosen formula. Mixing unit systems is the most frequent source of errors in gas law calculations.
Common mistakes to avoid
Several pitfalls trip up students and professionals when using the ideal gas law. The most common is forgetting to convert temperature to kelvins. Entering 25 instead of 298.15 will produce a result off by more than a factor of ten.
Another frequent error is using liters directly instead of converting to cubic meters. Since R is expressed in joules per mole per kelvin, and a joule is a pascal times a cubic meter, volume must be in m3 for the units to cancel correctly. One liter equals 0.001 m3.
Finally, gauge pressure versus absolute pressure causes confusion. The ideal gas law requires absolute pressure. If a tire gauge reads 220 kPa, the absolute pressure is roughly 220 kPa plus atmospheric pressure (about 101.325 kPa), totaling approximately 321 kPa. Always add atmospheric pressure to gauge readings before entering them into this calculator.
Worked examples
Each result below was produced by the same code the tool runs, so you can check your own numbers against them.
| Example | Input | Result |
|---|---|---|
| Standard pressure for 1 mole at 0 °C in 22.414 L | Solve for: P; Volume (m³): 0.022414; Amount of substance (mol): 1; Temperature (K): 273.15 | Pressure (P): 101,324.8623 Pa; Pressure: 101.3249 kPa; Pressure: 0.999999 atm |
| Volume of 2 moles at 1 atm and 298.15 K | Solve for: V; Pressure (Pa): 101325; Amount of substance (mol): 2; Temperature (K): 298.15 | Volume (V): 0.048931 m³; Volume: 48.9308 L |
| Moles in a 10 L tank at 200 kPa and 300 K | Solve for: n; Pressure (Pa): 200000; Volume (m³): 0.01; Temperature (K): 300 | Moles (n): 0.8018 mol |
| Temperature of 0.5 mol at 50 kPa in 25 L | Solve for: T; Pressure (Pa): 50000; Volume (m³): 0.025; Amount of substance (mol): 0.5 | Temperature (T): 300.6809 K; Temperature: 27.5309 °C |
FAQ
What is the value of R in the ideal gas law?
The universal gas constant R is exactly 8.314462618 J/(mol K) when using SI units. Other common values include 0.082057 L atm/(mol K) and 62.364 L Torr/(mol K), but this calculator uses the SI value exclusively.
Why does the calculator require pascals and cubic meters?
Using SI base units ensures dimensional consistency with R = 8.314462618 J/(mol K). A joule equals one pascal times one cubic meter, so pressure in pascals and volume in cubic meters make the units cancel correctly.
Can I use this ideal gas law calculator for real gases?
It provides a good approximation for real gases at moderate pressures and temperatures well above their condensation point. Near phase transitions or at extreme pressures, real gases deviate significantly and require more complex equations of state.
How do I convert Celsius to Kelvin for this tool?
Add 273.15 to the Celsius temperature. For example, 25 degrees Celsius equals 298.15 K. The temperature field requires kelvins because the ideal gas law depends on absolute temperature.
What happens if I enter zero for volume or temperature?
The calculator returns an error. Dividing by zero volume or zero temperature is mathematically undefined, and physically, a gas cannot have zero absolute temperature or occupy zero volume.
Is my data sent to a server when I use this tool?
No. All calculations happen locally in your browser. Nothing you type is uploaded or stored anywhere.