Calculate gas effusion rates, molar masses, or velocity ratios.
Rate₁ / Rate₂ = √(Mass₂ / Mass₁)
Instructions: Enter any 3 values below to calculate the 4th value. Leave the field you want to find blank.
Gas A
Units: mol/s, mL/min, etc.
Units: g/mol
Gas B
Units: mol/s, mL/min, etc.
Units: g/mol
Calculation Results
Solved For:–
Calculated Value:–
Rate Ratio (r₁/r₂):–
Inverse Mass Ratio (√(M₂/M₁)):–
Interpretation:
function calculateGrahamsLaw() {
// Get elements
var rate1Input = document.getElementById('rate1');
var mass1Input = document.getElementById('mass1');
var rate2Input = document.getElementById('rate2');
var mass2Input = document.getElementById('mass2');
var name1 = document.getElementById('gasName1').value || "Gas A";
var name2 = document.getElementById('gasName2').value || "Gas B";
var errorDiv = document.getElementById('errorMessage');
var resultDiv = document.getElementById('results');
// Get values
var r1 = rate1Input.value === "" ? null : parseFloat(rate1Input.value);
var m1 = mass1Input.value === "" ? null : parseFloat(mass1Input.value);
var r2 = rate2Input.value === "" ? null : parseFloat(rate2Input.value);
var m2 = mass2Input.value === "" ? null : parseFloat(mass2Input.value);
// Hide previous results/errors
errorDiv.style.display = 'none';
resultDiv.style.display = 'none';
// Validate non-negatives
if ((r1 !== null && r1 <= 0) || (m1 !== null && m1 <= 0) || (r2 !== null && r2 <= 0) || (m2 !== null && m2 <= 0)) {
errorDiv.innerText = "Error: All values must be positive numbers greater than zero.";
errorDiv.style.display = 'block';
return;
}
// Count nulls to determine logic
var inputs = [r1, m1, r2, m2];
var nullCount = 0;
for (var i = 0; i (r1/r2)^2 = m2/m1 -> m1 = m2 / (r1/r2)^2
var ratio = r1 / r2;
resultVal = m2 / (ratio * ratio);
targetLabel = "Molar Mass of " + name1 + " (M₁)";
unit = "g/mol";
solvedID = "mass1";
}
// Case 4: Find Mass 2
else if (m2 === null) {
// (r1/r2) = sqrt(m2/m1) -> (r1/r2)^2 = m2/m1 -> m2 = m1 * (r1/r2)^2
var ratio = r1 / r2;
resultVal = m1 * (ratio * ratio);
targetLabel = "Molar Mass of " + name2 + " (M₂)";
unit = "g/mol";
solvedID = "mass2″;
}
// Display Logic
document.getElementById('solvedFor').innerText = targetLabel;
document.getElementById('calculatedValue').innerText = resultVal.toFixed(4) + " " + unit;
// Fill the input back in for visual completeness (optional, but helps validation)
document.getElementById(solvedID).value = resultVal.toFixed(4);
// Re-fetch all values to ensure ratio calculation is consistent
r1 = parseFloat(document.getElementById('rate1').value);
m1 = parseFloat(document.getElementById('mass1').value);
r2 = parseFloat(document.getElementById('rate2').value);
m2 = parseFloat(document.getElementById('mass2').value);
// Ratios
var rRatio = r1 / r2;
var mRatio = Math.sqrt(m2 / m1);
document.getElementById('rateRatio').innerText = rRatio.toFixed(4);
document.getElementById('massRatio').innerText = mRatio.toFixed(4);
// Interpretation
var fasterGas = (r1 > r2) ? name1 : name2;
var lighterGas = (m1 r2) ? (r1/r2).toFixed(2) : (r2/r1).toFixed(2);
var interpText = fasterGas + " effuses " + factor + " times faster than " + ((fasterGas === name1) ? name2 : name1) + ". ";
interpText += "This is consistent with Graham's Law because " + lighterGas + " has the lower molar mass.";
document.getElementById('interpretationText').innerText = interpText;
resultDiv.style.display = 'block';
}
function resetCalculator() {
document.getElementById('rate1').value = ";
document.getElementById('mass1').value = ";
document.getElementById('rate2').value = ";
document.getElementById('mass2').value = ";
document.getElementById('gasName1').value = ";
document.getElementById('gasName2').value = ";
document.getElementById('results').style.display = 'none';
document.getElementById('errorMessage').style.display = 'none';
}
Understanding Graham's Law of Effusion
In chemistry and physics, effusion is the process where individual gas molecules pass through a tiny hole into a vacuum or a region of lower pressure without colliding with one another. This is distinct from diffusion, which involves the spreading of gas molecules throughout a volume filled with other gas particles.
This calculator utilizes Graham's Law of Effusion, formulated by Thomas Graham in 1848. The law states that the rate of effusion of a gas is inversely proportional to the square root of its molar mass.
The Formula
When comparing two gases (Gas A and Gas B) at the same temperature and pressure, the relationship between their effusion rates ($r$) and molar masses ($M$) is expressed as:
Rate A / Rate B = √( Molar Mass B / Molar Mass A )
This equation implies that lighter gases effuse faster than heavier gases. Specifically, if Gas A is 4 times heavier than Gas B, Gas B will travel through the aperture twice as fast as Gas A.
How to Use This Calculator
This tool is designed to help chemistry students and researchers solve for any missing variable in Graham's Law equations.
Step 1: Enter the known values for the two gases. You typically need Molar Masses for both gases (in g/mol) and one known Effusion Rate.
Step 2: Leave the field you wish to calculate blank. For example, if you want to find the rate of Gas B, leave the "Effusion Rate (r₂)" field empty.
Step 3: Click "Calculate Missing Variable".
Calculation Example
Scenario: Compare the effusion rates of Hydrogen gas ($H_2$) and Oxygen gas ($O_2$).
This means Hydrogen effuses approximately 3.98 times faster than Oxygen because it is much lighter.
Key Concepts
Molar Mass (M)
The mass of a given substance divided by the amount of substance. Usually expressed in grams per mole (g/mol). Heavier molar masses result in slower effusion rates.
Effusion Rate (r)
The amount of gas (in moles, volume, or mass) that passes through the aperture per unit of time. Common units include mol/s, mL/min, or m/s for velocity comparisons.
Temperature Effects
Graham's Law assumes both gases are at the same temperature. Since kinetic energy depends on temperature ($KE = \frac{1}{2}mv^2$), if temperatures differ, the formula must be adjusted.