Your country

Tools that support it use your country for local currency, number formats, units and paper size. Your choice is saved only in this browser.

Type a name or a two-letter code. Use the up and down arrow keys to move through the countries, Enter to choose one and Escape to close.

Ideal Gas Law Calculator (PV = nRT)

PV = nRT in any units, plus gas density, molar mass, STP volumes and real gases.

Science No upload Works offline Free, no sign-up
Calculate
Solve for

The value being solved is filled in for you (dashed box); change its unit to see it in another unit.

Volume (V) —

    How it was worked out

    The gas constant R in other units
    • 8.314462618 J/(mol·K) = Pa·m³/(mol·K) = L·kPa/(mol·K)
    • 0.0831446262 L·bar/(mol·K)
    • 0.0820573661 L·atm/(mol·K)
    • 62.36359822 L·Torr/(mol·K)
    • 1.987204259 cal/(mol·K)

    Next steps

    About the Ideal Gas Law Calculator (PV = nRT)

    Solve the ideal gas law PV = nRT for whichever quantity you need — pressure, volume, amount or temperature — with pressures in kPa, bar, atm, torr, mmHg or psi, volumes in L, mL, m³ or ft³, temperatures in K, °C or °F, and the amount as moles or as a mass (type the gas formula, such as CO2, and its molar mass is worked out). Celsius and Fahrenheit are converted to kelvins for you, and every answer shows the working.

    Three more tabs cover the rest of a gases chapter: gas density and molar mass from measurements (the Dumas method, with a list of gases that match), molar volumes under the different “STP” definitions side by side, and a van der Waals comparison that shows how far a real gas departs from ideal behaviour, using textbook constants or values derived from a gas’s critical point.

    How to use it

    1. Choose a tab: PV = nRT, Density & molar mass, Molar volume or Real gas.
    2. Pick what to solve for, then type the other values with their units. For a mass of gas, also type the gas (a formula such as N2, “air”, or a molar mass in g/mol).
    3. Read the answer, the same state in other units and the steps; the solved box shows the answer in the unit you choose for it.
    4. Copy the result if you need it in a report or homework.

    Examples

    Volume of a gas
    Input
    655 g of CH₄ at 25 °C and 745 torr
    Result
    V = 1,019 L (about 1.02 × 10³ L)

    OpenStax Chemistry 2e Example 9.9.

    Pressure in a tank
    Input
    2,520 mol of H₂ at 27 °C in 180 L
    Result
    P = 349.4 bar (about 350 bar)

    OpenStax Example 9.9, Check Your Learning.

    Gas density
    Input
    N₂ at 0 °C and 1 atm
    Result
    ρ = 1.250 g/L

    OpenStax Example 9.11: 1.25 g/L.

    Molar mass (Dumas)
    Input
    0.494 g of vapour in 129 cm³ at 99.6 °C and 742.1 mmHg
    Result
    M = 120 g/mol — chloroform, CHCl₃

    OpenStax Example 9.13.

    Molar volume
    Input
    1 mol at IUPAC STP (0 °C, 100 kPa) and at 0 °C, 1 atm
    Result
    22.711 L/mol and 22.414 L/mol
    Real gas
    Input
    3.46 mol CO₂ in 4.25 L at 229 °C
    Result
    van der Waals 32.37 atm vs ideal 33.55 atm (Z = 0.965)

    OpenStax Example 9.24: 32.4 and 33.5 atm.

    Common uses

    • Chemistry and physics homework on the gas laws, with every step shown.
    • Lab work: the moles of gas collected, or the molar mass of a vapour from a Dumas-bulb measurement.
    • Converting gas volumes between “standard” conditions used in different textbooks, data sheets and industries.
    • Checking when a gas at high pressure or low temperature can no longer be treated as ideal.

    The ideal gas law and R

    PV = nRT relates the pressure P, volume V, amount n (moles) and absolute temperature T of an ideal gas. The molar gas constant is exact in the SI: R = N_A·k = 8.314 462 618… J/(mol·K), because the Avogadro and Boltzmann constants are fixed exactly (BIPM SI Brochure). In other units:

    • 8.314 462 618 L·kPa/(mol·K) = 8.314 462 618 J/(mol·K)
    • 0.083 144 626 L·bar/(mol·K)
    • 0.082 057 366 L·atm/(mol·K)
    • 62.363 598 L·Torr/(mol·K)

    Temperatures must be absolute: 25 °C is 298.15 K, and using 25 in place of 298.15 gives an answer that is wrong by a factor of 12.

    Density and molar mass of a gas

    With n = m/M, the ideal gas law gives the density ρ = PM ÷ RT and the molar mass M = mRT ÷ PV = ρRT ÷ P (OpenStax Chemistry 2e §9.3). This is the Dumas method: vaporise a liquid in a flask of known volume at a known temperature and pressure, weigh the vapour, and calculate M. The tool lists common gases and vapours whose molar mass is within 2 % of the result — a hint, not an identification, since different substances can share a molar mass.

    Which “STP”?

    IUPAC defines standard temperature and pressure for gases as 0 °C and 100 kPa (1 bar), giving a molar volume of 22.711 L/mol. Many textbooks, including OpenStax Chemistry 2e, still use 0 °C and 1 atm (101.325 kPa), giving the familiar 22.414 L/mol (“22.4 L”). Other reference conditions are common too: 25 °C and 100 kPa (SATP, 24.790 L/mol), 20 °C and 1 atm (often called NTP, 24.055 L/mol) and 15 °C or 60 °F at 1 atm for gas volumes in industry. The Molar volume tab shows them side by side; always state which one you use.

    Real gases and the van der Waals equation

    Real molecules take up space and attract each other, so gases depart from PV = nRT at high pressure and low temperature. The van der Waals equation corrects for both: (P + a·n²/V²)(V − n·b) = nRT, where b is the excluded volume per mole and a measures the attraction (OpenStax §9.6). The compressibility factor Z = PV ÷ nRT is 1 for an ideal gas; Z < 1 means attractions dominate, Z > 1 that the molecules’ own volume does.

    The constants for N₂, O₂, CO₂, H₂O, He and CCl₄ are those of OpenStax Table 9.3. For H₂, Ar, CH₄, NH₃ and Cl₂ they are calculated from the critical point, a = 27R²T_c²/(64p_c) and b = RT_c/(8p_c), with T_c and p_c from the NIST Chemistry WebBook — or enter your own a and b, or a critical point. Different books give slightly different constants, so use the ones your course gives when they differ.

    Sources

    • BIPM, The International System of Units (SI Brochure, 9th ed.): exact N_A = 6.022 140 76 × 10²³ mol⁻¹ and k = 1.380 649 × 10⁻²³ J/K.
    • OpenStax, Chemistry 2e: §9.2 (ideal gas law, Examples 9.9–9.10), §9.3 (density and molar mass, Examples 9.11–9.13) and §9.6 (van der Waals equation, Table 9.3, Example 9.24).
    • IUPAC Gold Book, “standard conditions for gases”: 273.15 K and 10⁵ Pa.
    • NIST Chemistry WebBook (SRD 69), phase-change data: critical temperatures and pressures of H₂, Ar, CH₄, NH₃ and Cl₂.
    • NIST SP 811, Appendix B.8: pressure and volume conversion factors. Molar mass of dry air, 28.9644 g/mol: U.S. Standard Atmosphere, 1976.

    Limitations

    • The ideal gas law works to within a percent or so for most gases at room temperature and about one atmosphere; it becomes poor at high pressure, at low temperature and close to condensation.
    • The van der Waals equation is a two-parameter model: it shows the direction and rough size of real-gas effects, not accurate properties. Near and below the critical temperature it does not say which phase is stable.
    • Gas mixtures are treated as one gas: give their mean molar mass (such as 28.9644 g/mol for dry air) for density and mass.
    • Molar masses from a formula use IUPAC (CIAAW 2024) atomic weights; the “close to” list is a short built-in list of common gases and vapours.

    Privacy

    Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.

    Frequently asked questions

    What value of R should I use?

    Any — as long as its units match yours. With P in kPa and V in L use 8.314 L·kPa/(mol·K); with atm and L use 0.08206 L·atm/(mol·K); with bar and L use 0.08314 L·bar/(mol·K). The calculator converts every input to SI and uses the exact SI value.

    Why must the temperature be in kelvins?

    PV = nRT is proportional to absolute temperature: at 0 K the volume or pressure of an ideal gas would be zero. A Celsius value of 0 does not make the volume zero, so °C must be converted (add 273.15) before you multiply or divide by T.

    What is the volume of one mole of gas at STP?

    22.711 L at IUPAC STP (0 °C and 100 kPa), or 22.414 L at 0 °C and 1 atm — the “22.4 L” of older textbooks. At 25 °C and 1 atm it is 24.465 L.

    How do I find the molar mass of a gas from its density?

    Use M = ρRT ÷ P. For a gas of density 1.25 g/L at 0 °C and 1 atm: M = 1.25 × 0.08206 × 273.15 ÷ 1 = 28.0 g/mol, which matches N₂ or CO.

    When is a gas not ideal?

    At high pressure (molecules are close together, so their own volume matters) and at low temperature (attractions matter, especially near the boiling point). The Real gas tab shows the compressibility factor Z; values far from 1 mean the ideal gas law is not reliable.

    Can I use this for air?

    Yes — type “air” as the gas to use the mean molar mass of dry air, 28.9644 g/mol. Air at 15 °C and 101.325 kPa then comes out at 1.225 kg/m³, the standard sea-level value.

    Quick answers and tool search

    Type to search tools or to get a quick answer, for example 18% of 2500. Use the up and down arrow keys to move through the results, Enter to choose, and Escape to close.