ciencia

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
  • Private — runs on your device
Calculator Free · Private
Edited by: (editorial policy ) · Last editorial review:
Have a website? Embed this calculator for free Free — copy the code and paste it on your website Embed on your site
<iframe src="https://hacecuentas.com/embed/gas-ideal-pv-nrt" width="100%" height="560" style="border:1px solid #e2e8f0;border-radius:12px;max-width:720px" loading="lazy" title="Ideal Gas Law Calculator (PV = nRT) — Solve for n, P, V, or T"></iframe>
<p style="font-size:13px;text-align:center;margin:8px 0">Powered by <a href="https://hacecuentas.com" target="_blank" rel="noopener">Hacé Cuentas</a> — <a href="https://hacecuentas.com/gas-ideal-pv-nrt" target="_blank" rel="noopener">Ideal Gas Law Calculator (PV = nRT) — Solve for n, P, V, or T</a></p>
Preview →

Paste it on your site. Keep the credit link — thanks for sharing. More widgets →

The Ideal Gas Law Calculator solves for the number of moles (n) of a gas using the equation PV = nRT, where P is absolute pressure in Pascals (Pa), V is volume in cubic meters (m³), T is absolute temperature in Kelvin (K), and R is the universal gas constant (8.314 J·mol⁻¹·K⁻¹). This law combines Boyle's Law (P∝1/V), Charles's Law (V∝T), and Avogadro's Law (V∝n) into one unified equation. It is valid for ideal gas behavior — low pressures and high temperatures where intermolecular forces are negligible. Enter any three known variables to instantly solve for the fourth.

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 systemR valueUnits
SI (Pa, m³, K)8.314J·mol⁻¹·K⁻¹
Liters & atm0.08206L·atm·mol⁻¹·K⁻¹
Liters & mmHg62.364L·mmHg·mol⁻¹·K⁻¹
Liters & bar0.08314L·bar·mol⁻¹·K⁻¹
Liters & kPa8.314L·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 Pa

The 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

FromTo PaMultiply by
1 atmPa101,325
1 barPa100,000
1 psiPa6,894.76
1 mmHg (torr)Pa133.322
1 kPaPa1,000

FromTo m³Multiply by
1 L0.001
1 mL0.000001
1 ft³0.028317

---

Reference Table — Molar Volume at Common Conditions

How many liters does 1 mole of ideal gas occupy at various standard conditions?

ConditionT (K)P (Pa)Molar Volume (L/mol)
STP (IUPAC 1982)273.15101,32522.414
STP (IUPAC 2014)273.15100,00022.711
NTP (20°C, 1 atm)293.15101,32524.055
Room Temp (25°C, 1 atm)298.15101,32524.466
Body Temp (37°C, 1 atm)310.15101,32525.447
Liquid N₂ boiling (77 K, 1 atm)77.00101,3256.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

Volumen (mol)
1 L0.0010.0409
10 L0.0100.409
22.4 L0.02240.916
100 L0.1004.09
500 L0.50020.4
1,000 L (1 m³)1.00040.9

---

Typical Cases

Case 1 — Classic STP Verification


  • Given: P = 101,325 Pa, V = 0.02241 m³ (22.41 L), T = 273.15 K

  • Calculate: n = (101,325 × 0.02241) / (8.314 × 273.15)

  • n = 2270.69 / 2270.96 ≈ 1.000 mol

  • This is the textbook definition of molar volume at STP.
  • Case 2 — Pressurized Nitrogen Tank


  • Given: P = 506,625 Pa (5 atm), V = 0.010 m³ (10 L), T = 298.15 K (25°C)

  • Calculate: n = (506,625 × 0.010) / (8.314 × 298.15)

  • n = 5066.25 / 2478.82 ≈ 2.044 mol

  • At 5 atm, the same 10 L tank holds ~5× more moles than at 1 atm — consistent with Boyle's Law.
  • Case 3 — CO₂ from Dry Ice Sublimation


  • Given: P = 101,325 Pa, V = 0.500 m³ (500 L), T = 293.15 K (20°C)

  • Calculate: n = (101,325 × 0.500) / (8.314 × 293.15)

  • n = 50,662.5 / 2437.36 ≈ 20.79 mol

  • Mass = 20.79 mol × 44.01 g/mol ≈ 915 g of CO₂ — useful for estimating dry ice sublimation in a confined space.
  • ---

    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

    Given: P = 506,625 Pa (5 atm), V = 0.010 m³ (10 L), T = 298 K (25°C)
    n = (506,625 × 0.010) / (8.314 × 298)
    n = 5,066.25 / 2,477.57 ≈ 2.044 mol
    2.044 mol — a 10 L tank at 5 atm, 25°C holds about 2 moles of ideal gas

    Frequently asked questions

    What is the Ideal Gas Law and what does PV=nRT mean?
    PV = nRT is the Ideal Gas Law, where P is absolute pressure (Pa), V is volume (m³), n is the amount of substance in moles, R is the universal gas constant (8.314 J·mol⁻¹·K⁻¹), and T is absolute temperature (Kelvin). It unifies Boyle's Law (P∝1/V at constant T, n), Charles's Law (V∝T at constant P, n), and Avogadro's Law (V∝n at constant P, T) into a single equation that describes the state of any ideal gas.
    What is the universal gas constant R and where does its value come from?
    R = 8.314462618 J·mol⁻¹·K⁻¹, defined exactly since the 2019 SI redefinition of base units (NIST CODATA 2018). It equals the product of Boltzmann's constant (k_B = 1.380649×10⁻²³ J/K) and Avogadro's number (Nₐ = 6.02214076×10²³ mol⁻¹). In non-SI units it becomes 0.082057 L·atm·mol⁻¹·K⁻¹ or 1.987 cal·mol⁻¹·K⁻¹.
    What is the difference between STP and NTP, and which should I use?
    STP (Standard Temperature and Pressure) is 0°C (273.15 K) and 100,000 Pa (1 bar) per the 1982 IUPAC definition — giving a molar volume of 22.711 L/mol. The older pre-1982 STP used 101,325 Pa (1 atm), yielding 22.414 L/mol, still common in many textbooks. NTP (Normal Temperature and Pressure) is 20°C (293.15 K) and 1 atm — molar volume 24.055 L/mol. When in doubt, check which standard your course or datasheet specifies.
    When does the Ideal Gas Law break down and become inaccurate?
    The ideal gas approximation fails at high pressures (>10–20 atm) and low temperatures near the gas's condensation point, where intermolecular attractions and molecular volume become significant. For example, CO₂ at 40 atm and 0°C shows a ~7% deviation from ideal behavior. In these cases, the van der Waals equation or other equations of state (Redlich-Kwong, Peng-Robinson) should be used instead.
    Can I solve for pressure, volume, or temperature instead of moles?
    Yes — PV = nRT can be rearranged for any single unknown: P = nRT/V, V = nRT/P, T = PV/(nR). Simply ensure all known values are in SI units (Pa, m³, K, mol) before rearranging. This calculator specifically solves for n (moles), but the same formula applies by substitution for any of the four variables.
    How do I convert common pressure units to Pascals for this calculator?
    Key conversions: 1 atm = 101,325 Pa; 1 bar = 100,000 Pa; 1 psi = 6,894.76 Pa; 1 mmHg (torr) = 133.322 Pa; 1 kPa = 1,000 Pa. For example, a 5 atm tank is 5 × 101,325 = 506,625 Pa. Always use absolute pressure (not gauge pressure) — add atmospheric pressure (~101,325 Pa) to gauge readings.
    How many molecules are in 1 mole of an ideal gas?
    Exactly 6.02214076×10²³ molecules (Avogadro's number, Nₐ), a defined constant since the 2019 SI revision. So at STP (273.15 K, 1 atm), 22.414 liters of any ideal gas contains 6.022×10²³ molecules, whether it's H₂, O₂, or CH₄ — a direct consequence of Avogadro's Law and the ideal gas model.
    Is the Ideal Gas Law applicable to gas mixtures like air?
    Yes — for ideal gas mixtures, Dalton's Law of Partial Pressures applies: P_total = P₁ + P₂ + P₃ + …, and n_total = n₁ + n₂ + n₃ + …. Dry air at 1 atm behaves very close to an ideal gas at normal temperatures. You can use PV = nRT with P_total to find total moles, then use mole fractions (e.g., O₂ ≈ 20.95%, N₂ ≈ 78.09%) to find individual component amounts.
    Why does a balloon shrink in the cold? How does the Ideal Gas Law explain it?
    At constant pressure (P) and constant moles (n), the ideal gas law gives V = nRT/P — volume is directly proportional to absolute temperature (Charles's Law). Dropping from 298 K (25°C) to 258 K (−15°C) reduces volume by a factor of 258/298 ≈ 0.866, so a 1 L balloon shrinks to about 0.87 L — roughly a 13% reduction. This is why car tires lose pressure in winter (temperature drop lowers both pressure and effective volume).

    Methodology & trust

    Editorial

    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.

    Updates

    Última revisión: June 27, 2026. Los parámetros se verifican periódicamente con las fuentes citadas.

    Privacy

    Calculations run 100% in your browser. We do not store or transmit your data.

    Limitations

    Indicative results. For critical decisions, consult a professional.

    📌 How to cite this calculator

    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.

    ✉️ Reportar un error en esta calculadora