Ideal Gas Law Calculator (PV = nRT) — Solve for n, P, V, or T
Solve PV = nRT instantly. Enter pressure (Pa), volume (m³), and temperature (K) to find moles (n). Includes unit conversion guide, molar volume reference table, and worked examples.
- Data verified · June 2026
- Edited by Martín Rodríguez
- Private — runs on your device
See step-by-step calculation
When to use this calculator
- Chemistry lab: calculating how many moles of nitrogen gas are contained in a 10 L tank pressurized to 5 atm (506,625 Pa) at room temperature (298 K).
- Engineering: verifying the amount of CO₂ produced in a combustion reaction by measuring post-reaction gas pressure and volume in a sealed vessel.
- Education: confirming that exactly 1 mole of any ideal gas occupies 22.414 L at STP (0°C, 1 atm) — the classic molar volume demonstration.
- Scuba diving safety: estimating how the volume of a gas bubble changes as a diver ascends from 30 m depth (4 atm) to the surface (1 atm) at constant temperature.
- Industrial process control: determining the number of moles of hydrogen gas produced during electrolysis by measuring tank pressure increase over time at a known temperature.
Value of R (Universal Gas Constant) in Common Unit Systems
| Unit system | R value | Units |
|---|---|---|
| SI (Pa, m³, K) | 8.314 | J·mol⁻¹·K⁻¹ |
| Liters & atm | 0.08206 | L·atm·mol⁻¹·K⁻¹ |
| Liters & mmHg | 62.364 | L·mmHg·mol⁻¹·K⁻¹ |
| Liters & bar | 0.08314 | L·bar·mol⁻¹·K⁻¹ |
| Liters & kPa | 8.314 | L·kPa·mol⁻¹·K⁻¹ |
Fuente: NIST CODATA 2018 — physics.nist.gov/cgi-bin/cuu/Value?r. El valor exacto de R = 8.314462618 J·mol⁻¹·K⁻¹ es una constante definida desde la redefinición del SI de 2019. Los valores derivados (L·atm, L·mmHg, L·bar) se obtienen aplicando las conversiones de presión y volumen declaradas en la calculadora.
How it works
How It Is Calculated
The Ideal Gas Law relates four state variables of an ideal gas:
PV = nRT
Solving for moles:
n = (P × V) / (R × T)
Where:
P = Absolute pressure [Pascals, Pa]
V = Volume [cubic meters, m³]
n = Amount of substance [moles, mol]
R = Universal gas constant 8.314 J·mol⁻¹·K⁻¹ (NIST CODATA 2018)
T = Absolute temperature [Kelvin, K]
Unit conversions you must apply BEFORE calculating:
1 atm = 101,325 Pa
1 L = 0.001 m³
°C → K = °C + 273.15
1 bar = 100,000 Pa
1 psi = 6,894.76 PaThe value of R = 8.314462618 J·mol⁻¹·K⁻¹ is an exact defined constant since the 2019 SI redefinition of the mole (NIST).
---
Quick Unit Conversion Table
| From | To Pa | Multiply by |
|---|---|---|
| 1 atm | Pa | 101,325 |
| 1 bar | Pa | 100,000 |
| 1 psi | Pa | 6,894.76 |
| 1 mmHg (torr) | Pa | 133.322 |
| 1 kPa | Pa | 1,000 |
| From | To m³ | Multiply by |
|---|---|---|
| 1 L | m³ | 0.001 |
| 1 mL | m³ | 0.000001 |
| 1 ft³ | m³ | 0.028317 |
---
Reference Table — Molar Volume at Common Conditions
How many liters does 1 mole of ideal gas occupy at various standard conditions?
| Condition | T (K) | P (Pa) | Molar Volume (L/mol) |
|---|---|---|---|
| STP (IUPAC 1982) | 273.15 | 101,325 | 22.414 |
| STP (IUPAC 2014) | 273.15 | 100,000 | 22.711 |
| NTP (20°C, 1 atm) | 293.15 | 101,325 | 24.055 |
| Room Temp (25°C, 1 atm) | 298.15 | 101,325 | 24.466 |
| Body Temp (37°C, 1 atm) | 310.15 | 101,325 | 25.447 |
| Liquid N₂ boiling (77 K, 1 atm) | 77.00 | 101,325 | 6.319 |
> Note: IUPAC changed the standard pressure definition from 101,325 Pa (1 atm) to exactly 100,000 Pa (1 bar) in 1982. Many textbooks still use the older definition. Always verify which STP your course or industry uses.
---
Moles at 1 atm, 25°C for Common Volumes
| Volume | m³ | n (mol) |
|---|---|---|
| 1 L | 0.001 | 0.0409 |
| 10 L | 0.010 | 0.409 |
| 22.4 L | 0.0224 | 0.916 |
| 100 L | 0.100 | 4.09 |
| 500 L | 0.500 | 20.4 |
| 1,000 L (1 m³) | 1.000 | 40.9 |
---
Typical Cases
Case 1 — Classic STP Verification
Case 2 — Pressurized Nitrogen Tank
Case 3 — CO₂ from Dry Ice Sublimation
---
Common Errors
1. Using Celsius instead of Kelvin for T. The gas law requires absolute temperature. Using T = 25°C instead of 298.15 K inflates the denominator error — at 25°C vs 298.15 K, results differ by a factor of ~12×. Always add 273.15.
2. Mixing pressure units (atm or psi instead of Pa). If you enter P = 1 instead of P = 101,325, your result for n will be off by a factor of 101,325. Convert everything to SI units (Pa, m³, K) before calculating.
3. Using liters instead of cubic meters for V. 22.4 L ≠ 22.4 m³. Divide liters by 1,000 to get m³. Failing to do so overestimates n by a factor of 1,000.
4. Assuming real gases behave ideally at high pressures. Above ~10 atm or near the gas's boiling point, intermolecular forces cause significant deviation. Use the van der Waals equation [P + a(n/V)²][V − nb] = nRT for real gas corrections. For air at 300 atm, the ideal law overestimates n by >5%.
5. Using the wrong value of R. R has different numerical values depending on units: 8.314 J·mol⁻¹·K⁻¹ (SI), 0.08206 L·atm·mol⁻¹·K⁻¹, or 62.364 L·mmHg·mol⁻¹·K⁻¹. Mixing R with incompatible units gives completely wrong results.
Worked Example
Frequently asked questions
What is the Ideal Gas Law and what does PV=nRT mean?
What is the universal gas constant R and where does its value come from?
What is the difference between STP and NTP, and which should I use?
When does the Ideal Gas Law break down and become inaccurate?
Can I solve for pressure, volume, or temperature instead of moles?
How do I convert common pressure units to Pascals for this calculator?
How many molecules are in 1 mole of an ideal gas?
Is the Ideal Gas Law applicable to gas mixtures like air?
Why does a balloon shrink in the cold? How does the Ideal Gas Law explain it?
Sources & references
Methodology & trust
Calculadora de ciencia revisada por el equipo editorial de Hacé Cuentas, contrastada con NIST — Fundamental Physical Constants (CODATA 2018): Gas Constant R, según nuestra política editorial y metodología.
Última revisión: June 27, 2026. Los parámetros se verifican periódicamente con las fuentes citadas.
Calculations run 100% in your browser. We do not store or transmit your data.
Indicative results. For critical decisions, consult a professional.
Rodríguez, M. (2026). Ideal Gas Law Calculator (PV = nRT) — Solve for n, P, V, or T. Hacé Cuentas. https://hacecuentas.com/gas-ideal-pv-nrt
Contenido bajo licencia CC-BY 4.0 — reutilizable citando la fuente con enlace a Hacé Cuentas.