Activity and Fugacity Calculator

Correct pressure and mole fraction for non-ideal behavior, and see how it shifts the chemical potential.

🧮 Activity and Fugacity Calculator
Gas preset (approximate, 300 K)
Temperature (T)
K
Pressure (P)
bar
Second virial coefficient (B)
cm3/mol
Standard pressure (P0)
bar
Temperature (T)
K
Mole fraction (x)
Activity coefficient (gamma)
Fugacity f
—
Fugacity coefficient phi
—
Compressibility Z
—
Shift RT ln phi
—
Activity f / P0
—
f minus P
—

Activity a = gamma x
—
Shift mu - mu* = RT ln a
—
Ideal part RT ln x
—
Excess part RT ln gamma
—
Ratio a / x
—
Behavior
—

🧮 What are Activity and Fugacity?

Fugacity and activity are the corrections that let the simple chemical potential formulas work for real gases and real solutions. For an ideal gas the chemical potential is μ° + RT ln(P/P°), and for an ideal solution it is μ* + RT ln x. Real systems depart from these because molecules attract and repel each other. Fugacity f replaces the pressure of a real gas by an effective pressure, so that μ = μ° + RT ln(f/P°) stays true. Activity a replaces the mole fraction of a solution component by an effective concentration, so that μ = μ* + RT ln a stays true.

Both are tied to a correction factor. The fugacity coefficient φ = f/P tells you how far a gas is from ideal behavior, and the activity coefficient γ = a/x does the same for a solution component. A value of 1 means ideal. Chemical engineers use fugacity for high-pressure vapor-liquid equilibrium and for gas-phase equilibrium constants, as in ammonia synthesis at hundreds of bar. Geochemists use it for fluids deep in the crust, and physical chemists use activity to describe non-ideal mixtures and electrolyte solutions.

It is easy to mix these ideas up. Fugacity is a property of a gas (or of a component in the gas phase) and has the units of pressure. Activity is dimensionless and refers to a component in any phase, relative to a standard state. Neither is a measured quantity by itself: each is defined through the chemical potential. This page does not estimate the ionic activity coefficient from ionic strength; for that see the Debye-Huckel activity coefficient calculator, which can supply a gamma that you enter here.

The calculator has two modes. Gas fugacity uses the two-term virial equation with the second virial coefficient B, giving φ, f, the compressibility factor Z and the chemical potential shift RT ln φ. Solution activity multiplies the mole fraction by an activity coefficient you provide and shows the shift RT ln a, split into the ideal and excess parts. Each mode draws a chart against the ideal case. The virial coefficients in the gas presets are rounded and approximate.

📐 Formula

ln φ  =  B P ÷ (R T),    f  =  φ P,    Z  =  1 + B P ÷ (R T)
B = second virial coefficient (cm3/mol), negative when attraction dominates
P = pressure (bar); R = 8.314462618 J/(mol K); T = temperature (K)
Shift: μ − μideal = R T ln φ at the same pressure
Example: CO2 at 300 K, 20 bar, B = −122 cm3/mol gives BP/RT = −0.0978, φ = 0.9068 and f = 18.14 bar
a  =  γ x,    μ − μ*  =  R T ln a  =  R T ln x + R T ln γ
x = mole fraction, γ = activity coefficient (1 for an ideal solution)
Example: x = 0.5 and γ = 1.8 give a = 0.9000 and a shift of −0.2612 kJ/mol at 298.15 K

📖 How to Use This Calculator

Steps

1
Choose gas fugacity or solution activity - Use the tabs to pick a real gas, or a component of a solution.
2
Enter the state - For a gas give T, P and B (or pick a preset to fill T and B). For a solution give T, the mole fraction x and the activity coefficient gamma.
3
Read the result - The main box shows f or a. The others give phi, Z, the chemical potential shift and the ideal and excess parts.
4
Compare with ideal - The chart shows the real curve and the ideal reference, with your state marked.

💡 Example Calculations

Example 1 - Carbon dioxide at 20 bar

CO2 at 300 K, 20 bar, B = −122 cm3/mol (approximate)

1
BP/RT = (−122 × 20) / (10 × 8.314462618 × 300) = −0.09782, so Z = 0.9022.
2
φ = exp(−0.09782) = 0.9068.
3
f = 0.9068 × 20 = 18.14 bar, and RT ln φ = 2.494 × (−0.09782) = −0.2440 kJ/mol.
f = 18.14 bar, φ = 0.9068
Try this example →

Example 2 - Methane at 50 bar

Methane at 300 K, 50 bar, B = −42 cm3/mol (approximate)

1
BP/RT = (−42 × 50) / (10 × 8.314462618 × 300) = −0.08420, so Z = 0.9158.
2
φ = exp(−0.08420) = 0.9193.
3
f = 0.9193 × 50 = 45.96 bar, which is 4.037 bar below the pressure.
f = 45.96 bar, Z = 0.9158
Try this example →

Example 3 - A positive-deviation mixture

x = 0.5, γ = 1.8 (illustrative), 298.15 K

1
a = 1.8 × 0.5 = 0.9000.
2
RT = 2.479 kJ/mol. RT ln x = 2.479 × ln 0.5 = −1.718 kJ/mol and RT ln γ = 2.479 × ln 1.8 = +1.457 kJ/mol.
3
Total shift = RT ln 0.9 = −0.2612 kJ/mol. The positive deviation lifts the component's chemical potential above the ideal value.
a = 0.9000, shift = −0.2612 kJ/mol
Try this example →

Example 4 - A dilute component with negative deviation

x = 0.1, γ = 0.72 (illustrative), 298.15 K

1
a = 0.72 × 0.1 = 0.0720.
2
RT ln x = 2.479 × ln 0.1 = −5.708 kJ/mol; RT ln γ = 2.479 × ln 0.72 = −0.8143 kJ/mol.
3
Total shift = RT ln 0.072 = −6.522 kJ/mol, lower than the ideal −5.708 kJ/mol.
a = 0.0720, shift = −6.522 kJ/mol
Try this example →

❓ Frequently Asked Questions

What is fugacity?+
Fugacity is an effective pressure that replaces the real pressure in the chemical potential expression for a non-ideal gas. It is defined so that mu = mu0 + RT ln(f/P0), and it equals the pressure for an ideal gas.
What is the fugacity coefficient?+
The fugacity coefficient phi is the ratio f/P of fugacity to pressure. It is 1 for an ideal gas, below 1 when attractions dominate and above 1 when repulsions dominate. It measures the non-ideal part of the molar Gibbs energy: RT ln phi.
How do you calculate fugacity from the virial equation?+
With the pressure-form virial equation Z = 1 + BP/RT, ln phi = BP/RT, so f = P exp(BP/RT). For CO2 at 300 K and 20 bar with B = -122 cm3/mol, ln phi = -0.0978, phi = 0.9068 and f = 18.14 bar.
What is the relation between Z and the fugacity coefficient?+
ln phi equals the integral from 0 to P of (Z - 1)/P dP. For a gas that follows Z = 1 + BP/RT the integrand is constant, so ln phi = BP/RT, which equals Z - 1.
What is activity?+
Activity is a dimensionless effective concentration: a = gamma x for a component in a solution, with x the mole fraction and gamma the activity coefficient. It replaces x in the chemical potential: mu = mu* + RT ln a.
What does an activity coefficient greater than 1 mean?+
Gamma above 1 means the component escapes from the solution more readily than ideal mixing predicts, a positive deviation from Raoult's law. Gamma below 1 means the component is held more strongly, a negative deviation.
How does the chemical potential change with fugacity or activity?+
The shift from the ideal value is RT ln phi for a gas at the same pressure, or RT ln gamma for a solution component at the same mole fraction. At 298.15 K, gamma = 1.8 shifts the chemical potential by +1.457 kJ/mol.
How is this different from the Debye-Huckel activity coefficient calculator?+
The Debye-Huckel page estimates the activity coefficient of ions from ionic strength. This page takes gamma or the virial coefficient as an input and turns it into activity, fugacity and a chemical potential shift. The two can be used together.
When is fugacity needed?+
Use fugacity for gases at high pressure or low temperature, where pressure no longer represents the escaping tendency, for example in high-pressure equilibrium constants for ammonia synthesis. At low pressure f and P are almost the same.
Which units does the tool use?+
Temperature is in kelvin, pressure and fugacity are in bar, and the second virial coefficient B is in cm3/mol. Chemical potential shifts are in kJ/mol.

📚 Sources and Notes

The definitions of fugacity and the fugacity coefficient follow the Wikipedia article on fugacity and the LibreTexts chapter on the chemical potential and fugacity of a gas. The closed form ln phi = BP/RT for a gas with Z = 1 + BP/RT follows directly from the integral definition. The second virial coefficients in the gas presets are rounded, approximate values near 300 K and are illustrative; the activity coefficients in the examples are also illustrative, not measured data.

See also the chemical potential calculator, the virial equation of state calculator and the activity coefficient calculator.

What is fugacity?

Fugacity is an effective pressure that replaces the real pressure in the chemical potential expression for a non-ideal gas. It is defined so that mu = mu0 + RT ln(f/P0), and it equals the pressure for an ideal gas.

What is the fugacity coefficient?

The fugacity coefficient phi is the ratio f/P of fugacity to pressure. It is 1 for an ideal gas, below 1 when attractions dominate and above 1 when repulsions dominate. It measures the non-ideal part of the molar Gibbs energy: RT ln phi.

How do you calculate fugacity from the virial equation?

With the pressure-form virial equation Z = 1 + BP/RT, ln phi = BP/RT, so f = P exp(BP/RT). For CO2 at 300 K and 20 bar with B = -122 cm3/mol, ln phi = -0.0978, phi = 0.9068 and f = 18.14 bar.

What is the relation between Z and the fugacity coefficient?

ln phi equals the integral from 0 to P of (Z - 1)/P dP. For a gas that follows Z = 1 + BP/RT the integrand is constant, so ln phi = BP/RT, which equals Z - 1.

What is activity?

Activity is a dimensionless effective concentration: a = gamma x for a component in a solution, with x the mole fraction and gamma the activity coefficient. It replaces x in the chemical potential: mu = mu* + RT ln a.

What does an activity coefficient greater than 1 mean?

Gamma above 1 means the component escapes from the solution more readily than ideal mixing predicts, a positive deviation from Raoult's law. Gamma below 1 means the component is held more strongly, a negative deviation.

How does the chemical potential change with fugacity or activity?

The shift from the ideal value is RT ln phi for a gas at the same pressure, or RT ln gamma for a solution component at the same mole fraction. At 298.15 K, gamma = 1.8 shifts the chemical potential by +1.457 kJ/mol.

How is this different from the Debye-Huckel activity coefficient calculator?

The Debye-Huckel page estimates the activity coefficient of ions from ionic strength. This page takes gamma or the virial coefficient as an input and turns it into activity, fugacity and a chemical potential shift. The two can be used together.

When is fugacity needed?

Use fugacity for gases at high pressure or low temperature, where pressure no longer represents the escaping tendency, for example in high-pressure equilibrium constants for ammonia synthesis. At low pressure f and P are almost the same.

Which units does the tool use?

Temperature is in kelvin, pressure and fugacity are in bar, and the second virial coefficient B is in cm3/mol. Chemical potential shifts are in kJ/mol.