Ideal gas law

Calculate ideal gas law using the values and assumptions you provide.

Calculate ideal gas law using the values and assumptions you provide.

Both dots and commas are accepted as decimal separators.

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 Pa
TypeScript
const n = 1, R = 8.314462618, T = 273.15, V = 0.0224;
const pressure: number = n * R * T / V;
console.log(pressure); // Pa
Python
n, R, T, V = 1, 8.314462618, 273.15, 0.0224
print(n * R * T / V)  # pressure in Pa
Java
System.out.println(1 * 8.314462618 * 273.15 / 0.0224); // Pa
C#
Console.WriteLine(1 * 8.314462618 * 273.15 / 0.0224); // Pa