
Ideal gas law
Calculate ideal gas law using the values and assumptions you provide.
Your inputs stay in your browser. Displayed results are rounded to a maximum of 12 significant digits.
Method and assumptions
Method version 1.0.0 · Updated
Calculate
Formula: P = nRT / V, R = 8.314462618 J·mol⁻¹·K⁻¹
Calculate ideal gas law using the values and assumptions you provide.
- moles
- Amount of substance (mol)
- temperature
- Temperature (K)
- volume
- Volume (m³)
Results depend on the assumptions entered; verify professional or safety-critical decisions independently.
Calculate with code
These short examples use the same inputs and core calculation as this tool. Adapt validation and formatting to your application.
JavaScript
const n = 1, R = 8.314462618, T = 273.15, V = 0.0224;
console.log(n * R * T / V); // pressure in PaTypeScript
const n = 1, R = 8.314462618, T = 273.15, V = 0.0224;
const pressure: number = n * R * T / V;
console.log(pressure); // PaPython
n, R, T, V = 1, 8.314462618, 273.15, 0.0224
print(n * R * T / V) # pressure in PaJava
System.out.println(1 * 8.314462618 * 273.15 / 0.0224); // PaC#
Console.WriteLine(1 * 8.314462618 * 273.15 / 0.0224); // Pa