First Law of Thermodynamics Calculator – ΔU = Q − W Solver

Use this free First Law of Thermodynamics Calculator to solve ΔU = Q − W for any one of the three quantities. Enter the two you know — heat Q, work W, or the change in internal energy ΔU — and this calculator finds the third.

The first law of thermodynamics is the universe's accounting rule, applied to heat: energy is never created or destroyed, only moved and stored. For any system — a gas in a cylinder, a steam plant, a living cell — the change in what it stores (ΔU, its internal energy) equals what flowed in as heat (Q) minus what flowed out as work (W): ΔU = Q − W. Three quantities, one equation, and this calculator solves for whichever one you are missing. It is the most-used equation in all of thermodynamics, and everything else in the subject is a special case of it.

Why does it deserve the word "law"? Because it has survived every audit ever run on it. When nineteenth-century experiments seemed to lose energy in friction, the missing amount was always found as heat; when nuclear reactions seemed to create it, the mass–energy ledger was found to balance instead. Joule's paddle-wheel experiments of the 1840s — churning water with falling weights and measuring the temperature rise — established the exchange rate between work and heat that the equation is built on: 4.186 joules per calorie, the mechanical equivalent of heat. The first law is bookkeeping that nature herself keeps.

First Law of Thermodynamics Calculator — formula and diagram

The subtleties are all in the signs, and this page uses the physics convention throughout: Q is positive when heat flows into the system, W is positive when the system does work on its surroundings. (Chemistry texts often define W the other way and write ΔU = Q + W; the physics is identical, the bookkeeping mirrored.) Master the signs here and every process in thermodynamics — isothermal, adiabatic, engine cycles, refrigerators — becomes a matter of setting one term to zero or solving for another.

the energy ledger — what comes in, what goes out, what stays system stores ΔU Q in (+) W out (+) ΔU = Q − W : in − out = stored

Formula

First law of thermodynamics ΔU = Q − W  •  rearranged: Q = ΔU + W and W = Q − ΔU

All three quantities are in joules, and the equation is one line of arithmetic once the signs are set. The sign convention (physics form, used here and across this site): Q > 0 heat flows in, Q < 0 heat flows out; W > 0 the system does work on the surroundings (expansion), W < 0 work is done on the system (compression); ΔU > 0 the system stores more internal energy — for an ideal gas, it ends hotter. The chemistry convention defines W as work done on the system and writes ΔU = Q + Won; since Won = −Wby, the two forms are the same statement. What the first law does not tell you is the direction a process will run or how much of the heat can become work — that is the second law's territory. The first law is the audit; the second law is the tax code.

SymbolMeaningSign rule
ΔUchange in internal energy+ stored more (gas: hotter)
Qheat transferred+ into the system
Wwork transferred+ done by the system

State functions and path functions: the law's hidden structure

ΔU, Q and W look like three equal citizens of one equation, but they are different species. U is a state function: it belongs to the system's condition — for an ideal gas, to its temperature alone — and ΔU between two states is the same by every route. Q and W are path functions: they belong to the journey, and the same two states can be joined by journeys with wildly different heat and work. Expand a gas isothermally and Q = W with ΔU = 0; reach the same end state adiabatically-then-rigidly and both numbers change while ΔU stands still. The first law is precisely the statement that the two path quantities conspire, on every path, to reproduce the one state quantity.

This is why the equation is written with a Δ on one side only. You can speak of the ΔU of a gas; you cannot speak of "the Q of a gas" — a system contains internal energy, but it does not contain heat or work, which exist only in transit, like rain rather than water in a lake. Keeping that distinction straight — stores versus flows — dissolves most beginner confusion in thermodynamics, and it is why the calculator asks for transfers (Q, W) and a change (ΔU), never for absolutes.

A useful way to feel the asymmetry: internal energy can be inventoried at an instant, like the balance of a bank account on a statement date, while heat and work are the transactions listed between statements. Two accounts can share the same balance change with completely different transaction histories — one busy with large deposits and withdrawals, one nearly dormant. The first law is the bank's guarantee that the statement and the transactions always reconcile; it says nothing about which history a given customer lived. Every "find Q" or "find W" problem is a missing-transaction problem, and every state-function shortcut — computing ΔU from temperatures alone — is reading the statement instead of the receipts.

Joule's paddle wheel — the experiment behind the law falling weight does work W water warms: ΔU = W exactly — 4.186 J per calorie work and heat, one currency — the first law is the exchange rate

How to use

  1. Choose which quantity to solve for — ΔU, Q or W. The two input boxes relabel themselves to the other two quantities.
  2. Enter both known values in joules, with signs: negative for heat leaving the system or work done on it.
  3. Click "Calculate" to get the missing quantity, with a sentence stating what its sign means.
  4. Cross-check with the story of the process: an expanding gas that absorbs heat should not end with a large negative ΔU unless the work exceeds the heat — let the physics audit the arithmetic.

Worked examples

Example 1 — the reference case. A gas absorbs Q = 500 J of heat and does W = 200 J of work pushing a piston:
ΔU = Q − W = 500 − 200 = 300 J. Of the 500 J that flowed in, 200 J left again as work — so the gas's internal energy (and temperature) rises by the 300 J that stayed behind.

Example 2 — solving for the heat. A system's internal energy falls by 150 J (ΔU = −150 J) while it does W = 100 J of work. What heat flowed? Q = ΔU + W = −150 + 100 = −50 J: 50 J of heat left the system. Read the ledger plainly: the store fell by 150 J in total; 100 J of that left as work, so the remaining 50 J must have left as heat.

Example 3 — solving for the work. A gas absorbs Q = 1,200 J and its internal energy rises by ΔU = 450 J. Then W = Q − ΔU = 1,200 − 450 = 750 J of work done by the gas. Nearly two-thirds of the heat escaped as work; the rest is the temperature rise you would measure.

Example 4 — the adiabatic case. An insulated gas does W = 350 J of work with Q = 0: ΔU = 0 − 350 = −350 J. No heat entered to pay the bill, so the internal energy paid it all — the gas cools, as in the spray can and the expanding air of the adiabatic page.

Example 5 — the isothermal case. An ideal gas expands at constant temperature, absorbing Q = 900 J. Constant T means ΔU = 0, so W = Q − ΔU = 900 J: every joule of heat is converted to work in this step. The catch, as the isothermal page explains, is that resetting the gas for another round costs work elsewhere.

Example 6 — compression with heat loss. Work is done on a gas, W = −250 J, while Q = −100 J of heat leaks out: ΔU = −100 − (−250) = +150 J. Two negative signs, one positive result: the 250 J of work pushed in exceeds the 100 J that leaked, so the gas ends 150 J richer — the bicycle pump's warming barrel, in ledger form.

The first law in real life

Every engine ever built. A car engine's cycle obeys ΔU = 0 over each complete loop (the engine returns to its starting state), forcing Qnet = Wnet: the work out is the heat in minus the heat rejected. Efficiency is then just the fraction of Qin that survives as W — bookkeeping, all the way down.

Your body. You are a thermodynamic system in near-steady state: ΔU ≈ 0 over a day, so the food energy you take in (Q, in the loose sense) leaves as work and heat. Eat more than you emit and ΔU > 0 — the surplus is stored, measurably, as tissue. Dieting is the first law with the signs reversed.

Refrigerators. Run the law on a fridge cycle: ΔU = 0 over a loop, and the work input Won reappears exactly in QH = QL + W. The COP page is this equation wearing a ratio.

Power stations. A thermal plant's whole design is a first-law budget: of the fuel's heat, roughly a third becomes electricity (W), the rest leaves as Q to cooling towers and rivers. The towers are not waste by carelessness — the second law mandates the rejection, the first law merely counts it.

Batteries and charging. Charging a battery does work on a chemical system and raises its ΔU; discharging reverses the flow. Heat appearing in a fast-charging phone is the part of the input that took the Q exit instead of the storage door.

Weather systems. A rising air parcel does expansion work, absorbs or releases latent heat as water condenses, and its ΔU tracks its temperature — meteorologists run the first law on parcels of atmosphere exactly as this page runs it on a cylinder of gas.

a full cycle: back at the start, so ΔU = 0 Q_in W_out + Q_out therefore Q_net = W_net — the engine's whole story

The four processes through first-law glasses

Set one term by the process's rule and the first law solves the rest — this table is the fastest diagnostic in thermodynamics. Isothermal (ideal gas): ΔU = 0, so Q = W. Adiabatic: Q = 0, so ΔU = −W. Isochoric (rigid): W = 0, so ΔU = Q. Isobaric: nothing vanishes; ΔU = Q − PΔV. Any complete cycle: ΔU = 0, so Qnet = Wnet. Check the worked examples against it: Example 4 is the adiabatic row, Example 5 the isothermal row, and Example 1 the general case with all three terms alive. When a problem statement names a process, it is handing you one row of this table — the first law does the rest.

The cycle row deserves one more line, because it defines efficiency. An engine that takes in Qin = 1,000 J per cycle and rejects Qout = 600 J must, by ΔU = 0, deliver Wnet = 400 J — an efficiency of 400/1,000 = 40%. No separate efficiency law is needed: the percentage is the first law's arithmetic, and the second law's only role is to cap how small Qout is allowed to be. Every efficiency figure ever quoted for a heat engine is this subtraction, expressed as a fraction.

Quick reference: solving for each quantity

You knowYou wantFormulaCheck with
Q = 500, W = 200ΔUΔU = Q − W300 J
ΔU = −150, W = 100QQ = ΔU + W−50 J
Q = 1,200, ΔU = 450WW = Q − ΔU750 J
Q = 0, W = 350ΔUΔU = −W−350 J
ΔU = 0, Q = 900WW = Q900 J
Q = −100, W = −250ΔUΔU = Q − W+150 J

Every row is one of the worked examples — the table is the examples with the story stripped away, for revision.

Common mistakes

  • Sign chaos. The law is trivial arithmetic wrapped in strict sign rules. Decide the direction of every flow before touching numbers, and let negatives mean what the convention says — never flip a sign "to make the answer positive".
  • Mixing conventions mid-problem. ΔU = Q − W (physics) and ΔU = Q + W (chemistry) differ only in what W means. Pick one, label W "by" or "on" in your notes, and never borrow a formula from the other camp.
  • Treating heat as something a body contains. Bodies contain internal energy; heat exists only while crossing a boundary. "The heat of the gas" is a category error that leads to double-counting.
  • Assuming ΔU = 0 whenever a process is "steady" or "slow". ΔU = 0 is earned by isothermal ideal-gas changes and by complete cycles — nothing else. A slow adiabatic expansion still has ΔU = −W.
  • Forgetting the cycle rule's direction. Over a full cycle ΔU = 0 gives Qnet = Wnet — net heat in equals net work out. Using gross Qin instead of the net silently invents the rejected heat's worth of energy.

FAQ

Why do some books write ΔU = Q + W?
That is the chemistry sign convention, where W means work done on the system. Both forms say the same physics — just check which way W is defined. This calculator uses the physics convention, W = work done by the system.

What does a negative ΔU mean?
The system lost internal energy — it gave out more energy (as work and/or heat) than it took in, so for a gas its temperature falls.

What is ΔU for a complete cycle?
Zero. Internal energy is a state function, so after any full cycle the system returns to its starting state and ΔU = 0 — which is why for an engine cycle Qnet = Wnet.

Is the first law just conservation of energy?
Yes — conservation of energy, specialised to systems where heat is one of the transfer channels. Its historical contribution was proving heat is energy transfer, with Joule's exchange rate of 4.186 J per calorie between mechanical and thermal accounts.

Can the first law tell me if a process will happen?
No. It vetoes processes that would unbalance the ledger (perpetual-motion machines of the first kind), but many ledger-balanced processes never occur — heat flowing from cold to hot unaided balances fine and still never happens. Direction is the second law's ruling.

What is a perpetual-motion machine of the first kind?
A device that outputs more energy than it takes in — W > Q over a cycle with ΔU = 0. The first law forbids it outright; every claimed example in history has failed its audit.

How does the law apply to an open system like a turbine?
The same ledger gains extra columns: mass flowing in and out carries energy with it, which engineering handles with enthalpy (H = U + PV) in the steady-flow energy equation. The first law itself does not change — the system boundary just has more doors.

Why is ΔU for an ideal gas tied to temperature alone?
Because ideal-gas molecules store energy only as motion, and temperature is the measure of that motion. So ΔU = (f/2)nRΔT for any process whatsoever — isothermal steps give zero, and every other step's ΔU can be found from its endpoints without knowing the path.

Does the law hold for living things?
Completely. Calorimetry on animals — measuring heat output and work against food energy input — balances to within experimental error, which is why nutrition science can price food in joules and why "burning calories" is literal bookkeeping.

What units should I use?
Joules for all three quantities in SI work. Older sources use calories for Q (1 cal = 4.186 J) and litre-atmospheres for W (1 L·atm = 101.325 J); convert everything to joules before applying the equation, or the ledger will not balance.

Anna Kowalski

Anna Kowalski

Physics Editor · Heat & Atoms

Anna Kowalski creates and reviews our thermodynamics and nuclear physics calculators at CalcVIP. Every calculator is checked against hand-worked examples before it is published, so the formula, the diagram and the answer all agree.

View full profile & all calculators by Kowalski →