
Web Scripts & Software
DEV3 Ideal Gas Law Calculator (PV = nRT) & Gas Laws — Source Code (React + Tailwind)
from $20$29
Loading…
Everyday tool
Free, no sign-up. Runs in your browser; nothing is uploaded. Buy the source code: $29 Regular / $69 Extended
Related: molar mass calculator, molarity and dilution, unit converter. Runs in your browser.
Need Ideal Gas Law Calculator (PV = nRT) & Gas Laws as a full mobile or web app? We build it in about a week. Built in about a week, from $99. Send your requirements or SOW; you get a fixed quote and a delivery date.
The ideal gas law calculator (pv = nrt) & gas laws stays free to use online. If you want the code to run, edit and ship in your own project, get the full source from the DEV3 Marketplace. Instant download, 6 months of support.
Get the full app behind this tool. Buy once, own the source, and try each one live first.

Web Scripts & Software
from $20$29

Web Scripts & Software Mobile app
from $69$99

Enterprise SaaS Starters
from $69$99

Enterprise SaaS Starters
from $69$99

Web Scripts & Software
from $69$99

Web Scripts & Software Mobile app
from $69$99

Web Scripts & Software Mobile app
from $69$99

Web Scripts & Software Mobile app
from $69$99
The calculator solves the equation of state of an ideal gas for whichever variable you leave blank. Enter pressure in atm, kPa, bar, mmHg, Torr, psi or more; volume in litres, millilitres, cubic metres, cubic feet or US gallons; temperature in kelvin, Celsius, Fahrenheit or Rankine; amount in moles, or give a mass and a formula and let the tool find the moles.
Pick the unknown, fill in the other three values and read the answer with the working. Quick presets load STP (both IUPAC definitions), SATP, NTP, room and body conditions. A table lists R in 12 unit combinations, including calories and imperial units, with a CSV download.
Use Boyle's, Charles's, Gay-Lussac's, Avogadro's or the combined law when a gas goes from one state to another. Leave one of the values empty and it is solved. Temperature in the laws must be absolute, so the tool converts for you and warns about values at or below absolute zero.
Convert between density and molar mass at any temperature and pressure, compare the lift of helium or hydrogen with air, and use Graham's law to find how much faster a light gas effuses.
Dalton's law gives each gas's partial pressure from its mole fraction. Load the composition of dry air or enter your own mixture.
Choose carbon dioxide, methane, ammonia, nitrogen and other gases, and compare the ideal pressure with the van der Waals result, the compressibility factor Z and a Z curve against pressure. Constants come from the CRC Handbook.
R is the exact SI value, 8.31446261815324 J/(mol K). Ideal behaviour is a good approximation near room conditions at pressures below a few atmospheres. Everything runs in your browser.
PV = nRT links pressure P, volume V, amount of gas n in moles and absolute temperature T through the gas constant R. R = 8.314 J/(mol K) = 0.08206 L atm/(mol K) = 62.36 L Torr/(mol K). Pick which of the four variables to solve for and enter the other three in any units.
Use the one that matches your units, or just let the calculator convert for you. With pressure in atm and volume in L use 0.082057 L atm/(mol K); with kPa and L use 8.3145 L kPa/(mol K). Temperature must always be in kelvin, which the tool converts from °C, °F or °R.
IUPAC STP is 0 °C and 100 kPa, giving 22.711 L/mol; the older definition uses 1 atm and gives 22.414 L/mol, still common in textbooks. SATP is 25 °C and 100 kPa (24.79 L/mol). Presets for STP, SATP, NTP and room conditions fill in T and P for you.
They are special cases with two quantities held constant. Boyle: P1V1 = P2V2 at fixed T and n. Charles: V1/T1 = V2/T2 at fixed P and n. Gay-Lussac: P1/T1 = P2/T2 at fixed V and n. The combined law P1V1/T1 = P2V2/T2 covers all three when the amount is fixed.
At high pressure and low temperature, when molecules are close together and attract or repel each other. The real-gas tab uses the van der Waals equation and shows the compressibility factor Z: carbon dioxide at 1 mol in 1 L and 300 K has Z of about 0.90, so the real pressure is 10 % below the ideal value.
Rearranging PV = nRT gives density = PM / (RT), so air (28.96 g/mol) at 20 °C and 1 atm is 1.204 kg/m³. In reverse, M = ρRT / P identifies an unknown gas: a density of 1.784 g/L at STP gives 39.95 g/mol, which is argon.