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 , where is pressure, is volume, is the amount of gas in moles, is the absolute temperature in kelvin and 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
- Choose the pressure unit: atm, kPa or mmHg.
- Choose whether the temperature is in kelvin or degrees Celsius.
- Enter three of P, V (in litres), n (in moles) and T, and leave the unknown blank.
- Press Solve gas law.
- Read the result and the check that PV equals nRT.
Formulas
Ideal gas law
Gas constant
Absolute temperature
Moles from mass
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 K. Then L.
This is the familiar molar volume at standard temperature and pressure. At 25 °C and 101.325 kPa, two moles occupy 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
How we read your problem
Solve PV = nRT for V, with pressure in atm, volume in litres, amount in moles and temperature in kelvin.
Step-by-step solution
Convert the temperature to kelvin
The gas law needs absolute temperature.
Choose the gas constant to match the units
Pressure is in atm and volume in litres.
Rearrange PV = nRT for V and substitute
Formulas used
Ideal gas law
Kelvin
Combined gas law
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, L·atm/(mol·K); with kilopascals, 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 .
Using the law in problems
To find the number of moles in a 10 L tank at 2 atm and 300 K, rearrange to 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 follows from the ideal gas law because 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.