Ideal Gas Law Calculator
Enter any three of pressure, volume, moles and temperature, and this calculator solves PV = nRT for the fourth. Pick the unknown with the 'Solve for' menu, choose units for each row, and the values are converted to atm, litres and kelvin internally before the answer is converted back. It uses R = 0.082057 L atm per mol per kelvin and rounds results to six decimal places.
How to use the ideal gas law calculator
- Open the 'Solve for' menu and pick the unknown: Pressure (P), Volume (V), Moles (n) or Temperature (T).
- Set the unit dropdowns you need: pressure in atm or kPa, volume in L or m3, temperature in K or C.
- Type values into the other three rows. The row marked (unknown) is disabled and left blank.
- Read the four result cards, where the solved quantity is highlighted in the panel below.
- Click Copy to grab all four values as P, V, n and T lines.
Examples
Molar volume at STP (solve for volume)
Solve V, n = 1 mol, T = 273.15 K, P = 1 atm
V = 22.41387 L
Pressure of a compressed gas (solve for pressure)
Solve P, n = 2 mol, V = 10 L, T = 300 K
P = 4.92342 atm
Gas volume at room temperature in Celsius (solve for volume)
Solve V, n = 1 mol, P = 1 atm, T = 25 C
V = 24.465295 L
Frequently asked questions
What is the ideal gas law?
The ideal gas law is PV = nRT. It links the pressure, volume, amount in moles and absolute temperature of a gas through the gas constant R, treating the gas as ideal.
What value of R does this use?
It uses R = 0.082057 L atm per mol per kelvin. Because R is fixed in those units, any pressure in kPa, volume in m3 or temperature in Celsius is converted to atm, litres and kelvin before solving, then converted back for display.
How many values do I need to enter?
Exactly three of the four. From any three of pressure, volume, moles and temperature the fourth is fully determined. The 'Solve for' menu marks which one is the unknown, and that row is disabled.
Why must temperature be absolute?
PV = nRT is only valid on an absolute scale where zero means zero thermal energy. Celsius inputs are converted to kelvin by adding 273.15, so 0 C becomes 273.15 K. Entering a temperature at or below absolute zero is rejected.
What units can I mix and match?
Pressure in atm or kPa, volume in litres or cubic metres (m3), and temperature in kelvin or Celsius. Moles are always in mol. Each row has its own unit dropdown, so you can enter kPa and Celsius together, for example.
How precise are the answers?
Every result is rounded to six decimal places. That is why molar volume at STP reads 22.41387 L rather than an exact 22.414, since the underlying value carries more digits before rounding.
Does it work for real gases?
It assumes ideal behaviour, which is a close fit for many gases near room temperature and moderate pressure. Accuracy drops at high pressure or low temperature, where intermolecular forces and molecular volume matter and an equation like van der Waals fits better.
What if I enter a zero or negative value?
Pressure, volume and moles must be greater than zero and temperature must be above absolute zero, so the calculator flags any zero or negative entry rather than returning a nonsense answer.
Is my input sent anywhere?
No. The calculation runs entirely in your browser with no server round trip, so the numbers you type never leave your device.
Learn more
- PV = nRT explained: the ideal gas law in plain terms
What each letter in PV = nRT means, why R has the value it does, and how to rearrange the formula to solve for any one variable.
Related tools
Molar Mass Calculator
Calculate the molar mass and molecular weight of any chemical formula. Get a full per element breakdown for compounds like H2O, NaCl, H2SO4 and hydrates.
Molarity Calculator
Calculate molarity in mol per litre and solve for moles, volume or concentration. Find moles from mass and molar mass, then get the missing value.
Density Calculator
Calculate density, mass or volume from the other two using density = mass / volume. Supports grams, kilograms, cubic centimetres, litres and more.
555 Timer Calculator
Calculate 555 timer astable frequency, period, high and low times and duty cycle from R1, R2 and the timing capacitor. Free oscillator design helper.
Absolute Humidity Calculator
Calculate absolute humidity in grams of water vapor per cubic meter from air temperature and relative humidity. Fast, free and works in your browser.
Allele Frequency Calculator
Find allele frequencies from genotype counts. Enter the number of AA, Aa and aa individuals to get the A and a allele frequencies and allele totals.