Skip to content
  • Open the math solver
  • Ask the AI tutor
  • Find an AP course
  • Create a quiz
  • Open the calculator
  • Graphing Calculator
  • Browse all calculators
  • Read math guides
↑ ↓Enter to open · Esc to close
Solve a problem

Ideal Gas Law Calculator

Enter three of pressure, volume, amount of gas and temperature, leave the fourth blank, and choose your units. The calculator selects the matching gas constant, rearranges PV = nRT and checks the answer.

Leave exactly one of P, V, n and T empty.

Examples

About the Ideal Gas Law Calculator

The ideal gas law is the single most used equation in gas chemistry. It connects the pressure, volume, temperature and amount of a gas, so it answers questions like how much carbon dioxide fits in a cylinder, what pressure a heated container reaches or how many moles of oxygen a balloon holds.

Most errors come from units rather than algebra: a temperature left in degrees Celsius, a pressure in kilopascals used with the gas constant for atmospheres, or a volume in millilitres. This calculator converts Celsius to kelvin for you and picks the value of R that matches the pressure unit, then shows the rearranged equation with every number substituted so you can follow and copy the method.

What is the ideal gas law?

The ideal gas law states that PV=nRTPV = nRT, where PP is pressure, VV is volume, nn is the amount of gas in moles, TT is the absolute temperature in kelvin and RR is the gas constant. It combines Boyle's law, Charles's law and Avogadro's law into one relationship.

An ideal gas is a model in which molecules have no volume of their own and do not attract each other. Real gases behave almost ideally at ordinary temperatures and pressures, which is why the law is accurate enough for most laboratory and textbook calculations.

How to use the Ideal Gas Law Calculator

  1. Choose the pressure unit: atm, kPa or mmHg.
  2. Choose whether the temperature is in kelvin or degrees Celsius.
  3. Enter three of P, V (in litres), n (in moles) and T, and leave the unknown blank.
  4. Press Solve gas law.
  5. Read the result and the check that PV equals nRT.

Formulas

Ideal gas law

PV=nRTPV = nRT

Gas constant

R=0.082057 L⋅atmmol⋅K=8.3145 L⋅kPamol⋅K=62.364 L⋅mmHgmol⋅KR = 0.082057\ \tfrac{\text{L·atm}}{\text{mol·K}} = 8.3145\ \tfrac{\text{L·kPa}}{\text{mol·K}} = 62.364\ \tfrac{\text{L·mmHg}}{\text{mol·K}}

Absolute temperature

T(K)=T(∘C)+273.15T(\text{K}) = T(^\circ\text{C}) + 273.15

Moles from mass

n=mMn = \frac{m}{M}

Use the molar mass calculator to find M.

Worked example: Volume of 1 mol at 0 °C and 1 atm

The worked example finds the volume of 1 mol of gas at 0 °C and 1 atm. First T=0+273.15=273.15T = 0 + 273.15 = 273.15 K. Then V=nRT/P=1×0.082057×273.15/1≈22.414V = nRT/P = 1 \times 0.082057 \times 273.15 / 1 \approx 22.414 L.

This is the familiar molar volume at standard temperature and pressure. At 25 °C and 101.325 kPa, two moles occupy V=2×8.3145×298.15/101.325≈48.93V = 2 \times 8.3145 \times 298.15 / 101.325 \approx 48.93 L, which is about 24.47 L per mole.

The solution below is generated by the same engine that powers the calculator above.

Final answer

V=22.414 LV = 22.414\ \text{L}

How we read your problem

Solve PV = nRT for V, with pressure in atm, volume in litres, amount in moles and temperature in kelvin.

PV=nRT, V=?PV = nRT,\ V = ?

Step-by-step solution

  1. Convert the temperature to kelvin

    The gas law needs absolute temperature.

    T=0+273.15=273.15 KT = 0 + 273.15 = 273.15\ \text{K}
  2. Choose the gas constant to match the units

    Pressure is in atm and volume in litres.

    R=0.082057366 L⋅atm/(mol⋅K)R = 0.082057366\ \text{L·atm/(mol·K)}
  3. Rearrange PV = nRT for V and substitute

    V=nRTP=1×0.082057366×273.151=22.414 LV = \frac{nRT}{P} = \frac{1 \times 0.082057366 \times 273.15}{1} = 22.414\ \text{L}

Formulas used

  • Ideal gas law

    PV=nRTPV = nRT
  • Kelvin

    T(K)=T(∘C)+273.15T(\text{K}) = T(^\circ\text{C}) + 273.15
  • Combined gas law

    P1V1T1=P2V2T2\frac{P_1V_1}{T_1} = \frac{P_2V_2}{T_2}

An ideal gas obeys PV = nRT: pressure times volume is proportional to the amount of gas and its absolute temperature. Real gases follow it closely at low pressure and high temperature.

Verification

  • PV = 22.414 and nRT = 22.414, which agree.

Detailed explanation

Why kelvin matters

Gas volume and pressure are proportional to absolute temperature, which starts at absolute zero. Doubling a temperature from 10 °C to 20 °C does not double the pressure, because in kelvin it only goes from 283.15 K to 293.15 K, an increase of about 3.5%.

Using Celsius directly can even give a negative or zero volume, which is impossible. The calculator rejects any temperature at or below absolute zero and converts Celsius automatically when you select it.

Matching R to the units

The numerical value of R depends on the units. With pressure in atmospheres and volume in litres, R=0.082057R = 0.082057 L·atm/(mol·K); with kilopascals, R=8.3145R = 8.3145 L·kPa/(mol·K), which is the same number as the SI value 8.3145 J/(mol·K) because 1 L·kPa equals 1 J.

Volume must be in litres for these constants. Convert millilitres by dividing by 1000 and cubic metres by multiplying by 1000. If a question gives grams of gas, convert to moles first with n=m/Mn = m/M.

Using the law in problems

To find the number of moles in a 10 L tank at 2 atm and 300 K, rearrange to n=PV/(RT)=20/(0.082057×300)≈0.8124n = PV/(RT) = 20 / (0.082057 \times 300) \approx 0.8124 mol. Multiplying by a molar mass would turn this into grams, and dividing a sample mass by the moles gives the molar mass of an unknown gas.

For a fixed amount of gas whose conditions change, the combined gas law P1V1/T1=P2V2/T2P_1V_1/T_1 = P_2V_2/T_2 follows from the ideal gas law because nRnR stays constant. Solving each state separately with this calculator gives the same answers.

Common mistakes

  • Leaving the temperature in degrees Celsius.
  • Using R = 8.314 with pressure in atmospheres, or 0.0821 with kilopascals.
  • Entering a volume in millilitres instead of litres.
  • Entering grams instead of moles for n.
  • Applying the ideal model to gases at very high pressure or near condensation without noting the error.

Tips

  • Write the units next to every number before substituting; they should cancel to the unit of the unknown.
  • 1 atm = 101.325 kPa = 760 mmHg.
  • At 0 °C and 1 atm, one mole of an ideal gas occupies about 22.4 L; use this to sanity-check answers.
  • Keep the gas constant to at least four significant figures to avoid rounding drift.
  • For gas mixtures, n is the total moles, and each gas's partial pressure is proportional to its own moles.

Frequently asked questions

What is the value of the gas constant R?

R is 0.082057 L·atm/(mol·K), 8.3145 L·kPa/(mol·K) or J/(mol·K), and 62.364 L·mmHg/(mol·K). Choose the one that matches your pressure unit with volume in litres.

Why must temperature be in kelvin?

The ideal gas law relies on temperature measured from absolute zero. The Celsius scale starts at the freezing point of water, so using it would make pressure and volume proportional to the wrong quantity.

How do I solve PV = nRT for volume?

Divide both sides by P to get V = nRT/P. Substitute the moles, the gas constant, the kelvin temperature and the pressure in matching units.

What is molar volume at STP?

At 0 °C and 1 atm, one mole of ideal gas occupies about 22.414 L. With the newer IUPAC standard of 0 °C and 100 kPa it is about 22.711 L.

When does the ideal gas law fail?

It becomes inaccurate at high pressures and low temperatures, where molecules are close together and their attractions and own volume matter. Equations such as van der Waals then work better.

How do I find moles of gas from its mass?

Divide the mass in grams by the molar mass in g/mol. For example, 8.8 g of CO₂ with M ≈ 44.01 g/mol is about 0.200 mol.

Can the gas law find the molar mass of an unknown gas?

Yes. Measure P, V, T and the sample mass, solve for n with PV = nRT, then divide the mass by n to get the molar mass.

Solve your gas law problem

Enter three values above, leave one blank and choose your units to solve PV = nRT with every step.

More math calculators