PV = nRT solver
Ideal Gas Law Calculator
Enter any three known values. The calculator solves for the fourth, with automatic unit conversion.
What Does the Ideal Gas Law Calculator Do?
The ideal gas law calculator solves the equation PV = nRT for any one of its four variables: pressure, volume, moles, or temperature. Enter the three values you know, pick matching units from the dropdowns, and it converts everything behind the scenes, applies the correct rearranged formula, and shows each substitution step.

How to Use the Calculator
The tool has four solve modes. Pick the one that matches your unknown, fill in the other three quantities with their units, and press Calculate. Every result includes the rearranged formula and the substituted numbers so you can follow the math.
- Solve for Pressure (P): enter moles (n), temperature (T), and volume (V). The calculator uses P = nRT / V. For example, 2 moles of gas at 298 K in a 48.9 L tank gives 1.00 atm.
- Solve for Volume (V): enter moles (n), temperature (T), and pressure (P). The calculator uses V = nRT / P. One mole at 273.15 K and 1 atm occupies 22.41 L.
- Solve for Moles (n): enter pressure (P), volume (V), and temperature (T). The calculator uses n = PV / RT. A 22.4 L sample at 1 atm and 273.15 K contains 1.00 mol.
- Solve for Temperature (T): enter pressure (P), volume (V), and moles (n). The calculator uses T = PV / nR. One mole at 1 atm in 24.5 L sits at 298.6 K.
Worked Examples You Can Verify
Each row below was computed with the same R = 0.08206 L atm / (mol K) that the calculator uses internally. Try them yourself and compare.
| Scenario | Known values | Solve for | Result |
|---|---|---|---|
| One mole at 0 C and 1 atm | n = 1 mol, T = 273.15 K, P = 1 atm | Volume | 22.41 L |
| Moles in 22.4 L at 0 C, 1 atm | P = 1 atm, V = 22.4 L, T = 273.15 K | Moles | 1.00 mol |
| 2 mol in 48.9 L at 25 C | n = 2 mol, T = 298 K, V = 48.9 L | Pressure | 1.00 atm |
| 1 mol in 24.5 L at 1 atm | P = 1 atm, V = 24.5 L, n = 1 mol | Temperature | 298.6 K |
| Mixed units: kPa, mL, Fahrenheit | P = 101.325 kPa, V = 22400 mL, T = 32 F | Moles | 1.00 mol |
Which Units Can You Use?
You never have to convert units by hand. Pick whatever your problem gives you; the calculator converts everything to atmospheres, liters, and kelvin before applying the formula, then converts the answer back into the unit you choose.
- Pressure: atm, kPa, mmHg, psi, bar (1 atm = 101.325 kPa = 760 mmHg = 14.6959 psi = 1.01325 bar)
- Volume: L, mL, m3, ft3 (1 m3 = 1000 L; 1 ft3 = 28.3168 L)
- Temperature: K, C, F (0 C = 273.15 K; 32 F = 273.15 K)
- Amount: mol (moles are already the natural unit for this equation)
The one rule that matters: temperature is always converted to kelvin before the calculation, because the gas law only works on an absolute temperature scale. Entering 25 C is fine; the calculator turns it into 298.15 K for you.
When the Ideal Gas Law Works Best
PV = nRT is a model, and like every model it has a comfort zone. It is highly accurate for most gases at ordinary pressures (around 1 atm) and temperatures well above the point where the gas would liquefy. That covers classroom problems, weather balloons, scuba tanks, and car tires.
At very high pressures or very low temperatures, real gases deviate: molecules take up space and attract each other, so measured pressures run a few percent off the ideal prediction. For those cases chemists use corrected equations such as the van der Waals equation. For everyday conditions, the ideal gas law is more than accurate enough.
Frequently Asked Questions
What is the ideal gas law formula?
The ideal gas law is PV = nRT, where P is pressure, V is volume, n is the number of moles, R is the gas constant, and T is the absolute temperature in kelvin. It states that pressure times volume is proportional to the amount of gas times its temperature.
What value of R should I use?
Use R = 0.08206 L atm / (mol K) when pressure is in atmospheres and volume is in liters. If your problem uses kilopascals and liters, use R = 8.314 instead. The calculator handles this internally, so you only need to pick your input units.
Can I enter temperature in Celsius or Fahrenheit?
Yes. Select C or F from the temperature unit dropdown and the calculator converts your entry to kelvin automatically. Never plug Celsius directly into PV = nRT yourself, because the equation requires an absolute temperature scale.
What is STP in the ideal gas law?
Standard temperature and pressure (STP) is 0 C (273.15 K) and 1 atm. At STP, one mole of an ideal gas occupies 22.41 L, often rounded to 22.4 L. It is a handy reference point for checking your answers.
How accurate are the results?
For typical conditions near 1 atm and room temperature, the ideal gas law predicts real gas behavior within about 1 percent. Accuracy falls off at very high pressures or near condensation temperatures, where molecular attractions matter.
Why does the calculator show the substitution steps?
Showing the rearranged formula and the substituted numbers lets you verify the answer and learn the method. Teachers and students can trace exactly how 1 mol at 273.15 K and 1 atm becomes 22.41 L instead of taking a black-box number on trust.