Isothermal Work Calculator – W = nRT ln(V₂/V₁)
Use this free Isothermal Work Calculator to find the work done when an ideal gas expands or is compressed at constant temperature: W = nRT ln(V₂/V₁). Enter the moles, the temperature in kelvin and the two volumes, using R = 8.314 J/(mol·K).
Expand a gas slowly, in contact with a warm reservoir, and something elegant happens: the temperature never moves, yet the gas does real work pushing the piston out. Every joule of that work is paid for, joule for joule, by heat flowing in from the reservoir — because with the temperature fixed, the internal energy of an ideal gas cannot change, and the first law leaves heat nowhere else to go. The isothermal expansion is thermodynamics' cleanest transaction: heat in, work out, nothing stored, nothing wasted. Its formula, W = nRT ln(V₂/V₁), is the price list for that transaction.
The logarithm is the signature of a push that weakens as it goes. At constant pressure, work would just be PΔV — the same push over the whole distance. But in an isothermal expansion the pressure falls as 1/V throughout: the gas starts strong and ends feeble, and adding up a continuously weakening push is exactly what integration — and its answer, the natural logarithm of the volume ratio — is for. Only the ratio of volumes matters: doubling from 1 L to 2 L earns exactly the same work as doubling from 10 L to 20 L at the same n and T.
Isothermal steps are half of every famous engine cycle. The Carnot cycle — the most efficient engine physics allows — is two isothermal strokes (expand hot, compress cold) joined by two adiabatic ones. Whenever you meet a slow expansion in a water bath in a textbook, or a gas being compressed in a cooled cylinder in a factory, this calculator is the tool: it prices the work of the gentlest, most controlled change a gas can make.
Formula
Isothermal work W = nRT ln(V₂/V₁) • W in joules (work done by the gas), T in kelvin, volumes in any matching unit
The derivation is one line of calculus: W = ∫P dV from V₁ to V₂, with P = nRT/V at constant T, gives nRT × ln(V₂/V₁). Three consequences follow immediately. First, only the ratio V₂/V₁ matters, so litres and cubic metres give identical answers as long as both volumes share the unit — this calculator still asks, to keep your thinking tidy. Second, the sign is automatic: V₂ > V₁ makes W positive (expansion, work out); V₂ < V₁ makes it negative (compression, work in). Third, because ΔU = 0 at constant temperature for an ideal gas, the heat absorbed equals the work: Q = W, a result worth as much as the formula itself. A handy special case: each doubling of volume earns W = nRT ln 2 ≈ 0.693 × nRT.
| Symbol | Meaning | Units |
|---|---|---|
| W | work done by the gas (+ expansion, − compression) | joules (J) |
| n | amount of gas | moles (mol) |
| R | gas constant, 8.314 | J/(mol·K) |
| T | constant absolute temperature | kelvin (K) |
| V₁, V₂ | volumes before and after | any unit, same for both |
| ln | natural logarithm (base e) | — |
The reservoir's bargain: why Q must equal W
Hold the temperature constant and you have signed a contract with the first law. ΔU for an ideal gas is a function of temperature alone, so ΔU = 0; the first law ΔU = Q − W then forces Q = W at every instant. The gas is a pure conduit: it converts heat into work at a 100% rate for this step, storing nothing. That sounds like a perpetual-motion loophole, and the catch is the cycle: to repeat the trick you must compress the gas back, and isothermal compression demands exactly as much work input as the expansion returned — unless the compression happens at a lower temperature, which is precisely the loophole the Carnot cycle exploits legitimately, paying for it with rejected heat.
The contract also explains the word "slowly" in every isothermal problem. Heat needs time to flow; expand the gas suddenly and it cools before the reservoir can repay it, drifting toward adiabatic behaviour. Real isothermal changes are quasi-static — a piston creeping through a sequence of near-equilibria, ideally in a thin-walled cylinder immersed in a large bath whose temperature the process cannot dent. The bigger and better-stirred the reservoir, the more honest the "constant T" on the label.
The isothermal step is also where entropy enters thermodynamics most cleanly. Because the gas's internal energy is unchanged while it absorbs heat Q at temperature T, its entropy rises by exactly ΔS = Q/T = nR ln(V₂/V₁) — for Example 1, 8.314 × ln 2 = 5.76 J/K. The reservoir loses the same 5.76 J/K, so a reversible isothermal step merely relocates entropy from bath to gas; the universe's total is untouched, which is the precise meaning of "reversible". Compress the gas back isothermally and the entropy returns. It is only when the cycle runs between two temperatures — exporting entropy at a lower T than it imported — that a surplus of work appears, and that surplus is the Carnot engine's entire output. This page's modest logarithm is, in disguise, the entropy ledger of the gas.
How to use
- Enter the amount of gas in moles and the constant temperature in kelvin.
- Enter the initial volume V₁ and the final volume V₂, and choose their shared unit (m³ or litres).
- Click "Calculate Work" to get W in joules and kilojoules.
- Read the sign: positive W means the gas expanded and did work (absorbing the same amount of heat); negative W means work was done on the gas, which then sheds that much heat to stay at the same temperature.
Worked examples
Example 1 — the textbook doubling. 1 mol of gas at 300 K expands isothermally from 0.01 m³ to 0.02 m³:
W = 1 × 8.314 × 300 × ln(0.02/0.01) = 2,494.2 × ln 2 = 1,728.85 J = 1.73 kJ. The gas does 1,728.85 J of work and must absorb exactly the same amount of heat to stay at 300 K.
Example 2 — isothermal compression. Compress 2 mol at 400 K from 0.05 m³ to 0.025 m³: W = 2 × 8.314 × 400 × ln(0.5) = 6,651.2 × (−0.6931) = −4,610.26 J. The minus sign reports that 4,610.26 J of work is done on the gas — and 4,610.26 J of heat must flow out to the reservoir to hold the temperature.
Example 3 — a fourfold expansion. Half a mole at 273 K expands from 10 L to 40 L: W = 0.5 × 8.314 × 273 × ln 4 = 1,134.86 × 1.3863 = 1,573.25 J. Note ln 4 = 2 ln 2: a fourfold expansion is just two doublings, and the work is two doubling-payments added together.
Example 4 — a tenfold expansion. One mole at 350 K expands to ten times its volume: W = 8.314 × 350 × ln 10 = 2,909.9 × 2.3026 = 6,700.29 J. Tenfold sounds dramatic, but the logarithm keeps it modest — barely 3.9 times the payment for a single doubling at 300 K.
Example 5 — why not just PΔV? In Example 1 the initial pressure is P₁ = nRT/V₁ = 2,494.2 / 0.01 = 249,420 Pa. Had that pressure somehow stayed constant, the work would have been 249,420 × 0.01 = 2,494.2 J. The true isothermal work, 1,728.85 J, is smaller by exactly the factor ln 2 — the price of a push that halves as the volume doubles.
Example 6 — a bigger charge of gas. Three moles at 500 K double their volume: W = 3 × 8.314 × 500 × ln 2 = 12,471 × 0.6931 = 8,644.24 J. Work scales linearly with n and T — three moles at 500 K earn five times the single-mole 300 K payment, and the calculator's arithmetic shows why: 3 × (500/300) = 5.
Isothermal work in real life
The Carnot engine's power stroke. The hot isothermal expansion is where the ideal engine takes in all its heat and produces the largest share of its work. Every real engine's hot stroke is an attempt to approximate this line on the P–V diagram.
Compressed-air storage. Grid-scale energy storage compresses air into caverns; compressing slowly with intercooling — near-isothermally — wastes the least energy as heat, and the stored air returns W = nRT ln(V₂/V₁) on expansion. The logarithm is quite literally the storage capacity formula.
Scuba and breathing apparatus. Air expanding from a 200-bar cylinder through a regulator toward ambient pressure does isothermal-ish work and cools its surroundings — the reason regulators can frost. The work budget of the expansion is this formula's territory.
The slowly deflating balloon in a warm room. Gas leaking out at room temperature expands against the atmosphere near-isothermally; the tiny cooling is instantly repaid by the room. Not every application is an engine — some are just honest bookkeeping.
Laboratory gas handling. Expanding a gas sample from a small calibrated bulb into a larger evacuated volume (the classic gas-law experiment) is priced by the same logarithm when done in a thermostat bath, letting students measure R from work and heat flows.
Biological motors. Muscle and molecular motors operate essentially isothermally — the body is a superb reservoir at 310 K. Their chemistry converts free energy to work without any temperature swing, the living version of this page's bargain.
Isothermal vs adiabatic: the two ways to expand
Take the gas of Example 1 — 1 mol at 300 K, 0.01 m³, P₁ = 249,420 Pa — and expand it to 0.02 m³ adiabatically instead (γ = 1.40). The final pressure falls to P₂ = 249,420 × (1/2)1.4 = 249,420 ÷ 2.639 = 94,512 Pa ≈ 94.51 kPa, and the work, (P₁V₁ − P₂V₂)/(γ − 1) = (2,494.2 − 1,890.25)/0.4 = 1,509.87 J. Less than the isothermal 1,728.85 J — because the adiabatic gas cools (to about 227 K) and its push weakens faster. The difference, about 219 J, is the reservoir's contribution in the isothermal case: heat flowing in to hold the temperature is worth real, countable work. Choosing between the two formulas is choosing whether the reservoir is connected; the physics charges accordingly.
Inside the Stirling engine: isothermal steps doing honest work
One real machine leans on isothermal steps so heavily that it is worth meeting. The Stirling engine — patented in 1816, before Carnot published — runs a sealed charge of gas through expansion at the hot end and compression at the cold end, shuttling the gas between the two through a regenerator that banks its heat between strokes. Its two working strokes are as close to isothermal as metal and gas allow, and its theoretical efficiency equals Carnot's for the same temperatures: the same two logarithms, the same ratio of temperatures, the same ceiling. Stirling engines never conquered the car — they are bulky and slow to change speed — but they thrive where quiet, steady, efficient conversion matters: in submarines, solar-dish generators and cryocoolers, several of which are, quite literally, this page's formula with a flywheel attached.
The Carnot cycle's other two strokes are adiabats, and the division of labour is instructive. The isothermal strokes are where heat crosses the boundary — slowly, gently, at one temperature. The adiabatic strokes are where the temperature changes — quickly, in isolation, with work alone settling the account. Temperature change and heat transfer are assigned to separate strokes precisely because a single stroke cannot do both cleanly. When you solve a Carnot problem, notice that all the entropy enters and leaves during the two isothermal legs: QH/TH on the way in, QL/TL on the way out, equal in size — the deepest bookkeeping identity in thermodynamics, built entirely from this page's W = nRT ln(V₂/V₁) applied twice.
Quick reference: the logarithms that recur
| Volume ratio V₂/V₁ | ln(ratio) | W per mole at 300 K (J) |
|---|---|---|
| 1.5 | 0.405 | 1,011.31 |
| 2 | 0.693 | 1,728.85 |
| 3 | 1.099 | 2,740.16 |
| 4 | 1.386 | 3,457.70 |
| 5 | 1.609 | 4,014.26 |
| 10 | 2.303 | 5,743.11 |
Scale any row by n and by T/300 for other charges and temperatures. The compression rows are the same table read with a minus sign.
One habit worth forming: estimate with ln 2 ≈ 0.7 before reaching for the calculator. Most textbook expansions are doublings, halvings or tenfold changes, and 0.7 × nRT (or 2.3 × nRT for the tenfold) gets you within a few percent in your head — close enough to spot a misplaced decimal or a log₁₀-versus-ln slip in the precise answer, which is what mental estimates are really for.
Common mistakes
- Using log₁₀ instead of ln. The formula needs the natural logarithm. log₁₀(2) = 0.301 against ln(2) = 0.693 — using the wrong one shrinks the answer by a factor of 2.303.
- Using W = PΔV. That shortcut is only for constant pressure. In an isothermal change pressure varies continuously, and PΔV with any single P gives a wrong answer (Example 5 shows the size of the error).
- Celsius for T. The T in nRT is absolute. 27 °C must enter as 300 K.
- Mixing volume units between V₁ and V₂. Only the ratio matters, but the ratio must be honest: 0.02 m³ over 10 L is 2, not 0.002. Convert both to the same unit first — the calculator's unit selector applies to both.
- Reporting compression work as positive output. A negative W is information, not an error: it says work was consumed. Dropping the sign reverses the physics and corrupts any first-law calculation built on it.
FAQ
Why is there a logarithm in the formula?
During an isothermal expansion the pressure falls as the volume grows (P = nRT/V), so the push gets weaker along the way. Adding up P dV over the whole path gives the natural logarithm of the volume ratio.
What if V₂ is smaller than V₁?
Then ln(V₂/V₁) is negative and W is negative: the gas is being compressed and work is done on it. The size of the number is the work input needed.
How is this different from work at constant pressure?
At constant pressure the simple formula W = PΔV applies. In an isothermal change the pressure is not constant, so the logarithmic formula must be used instead.
Does the work depend on the starting volume?
No — only on the ratio V₂/V₁, plus n and T. Expanding from 2 L to 6 L earns exactly what expanding from 20 L to 60 L earns, because ln 3 is the same either way.
Where does the energy for the work come from?
Entirely from heat absorbed from the reservoir. The gas's internal energy is unchanged (ΔU = 0), so it acts as a converter with nothing stored — Q = W, joule for joule.
Can an isothermal expansion run forever and give free work?
No. The expansion ends at equilibrium with the surroundings, and restoring the gas to its start costs at least as much work unless the return trip happens colder. That asymmetry is the second law, and the Carnot cycle is its honest exploitation.
Why must the change be slow?
Because heat flow takes time. Expand quickly and the gas cools before the reservoir can repay the energy, sliding toward adiabatic behaviour with a different (smaller) work output.
What is the work if V₂ = V₁?
Zero: ln 1 = 0. No volume change, no boundary work — however much the pressure or temperature is being manipulated by other means.
How does this formula appear in the Carnot cycle?
Twice: the hot expansion absorbs QH = nRTH ln(V₂/V₁), and the cold compression rejects QL = nRTL ln(V₃/V₄). Their ratio, TL/TH, is where the famous Carnot efficiency 1 − TL/TH comes from.
Is the formula different for a real gas?
Slightly. Real gases have small intermolecular attractions, so their internal energy depends weakly on volume and ΔU is not exactly zero; the work integral also uses the real P–V relation. At ordinary pressures the ideal formula is accurate to well within a percent.