ΔU = Q − WQ = ΔU + W  ·  W = Q − ΔU  ·  all three in joules

First law of thermodynamics: the change in a system’s internal energy equals the heat added to it minus the work it does on its surroundings, ΔU = Q − W. It is conservation of energy written for heat engines, gases and chemical reactions. This free calculator solves for any one of the three quantities and shows every step of the working.

What Is the First Law of Thermodynamics Calculator?

The first law of thermodynamics calculator is a free online tool built on the formula ΔU = Q − W. Enter the values you already know, in whichever units suit you, and it solves for internal energy change, heat added or work done and shows every step of the substitution. First Law of Thermodynamics is energy conservation for a thermodynamic system, ΔU = Q − W.

Variables used by the first law of thermodynamics calculator
SymbolQuantityDefault unitAlso acceptsExample value
ΔUChange in internal energyJkJ, MJ400
QHeat added to the systemJkJ, MJ600
WWork done by the systemJkJ, MJ200

How to calculate the first law of thermodynamics

The first law is an energy ledger. Heat you put into a system (Q) either stays inside as internal energy (ΔU) or leaves again as work (W) done on the surroundings. Nothing is lost and nothing appears from nowhere, which is why the three quantities are locked together by ΔU = Q − W. Give the calculator any two and it returns the third.

There are three steps. First, choose what you are solving for in the Solve for menu — the calculator rearranges the formula for you, to Q = ΔU + W or W = Q − ΔU as needed. Second, enter the two quantities you know, in joules or kilojoules. Third, read the answer together with the worked steps, which show the rearrangement, your numbers substituted in, and the result to three significant figures.

The one thing to get right is the sign convention. This calculator uses the physics convention: Q > 0 is heat flowing into the system and W > 0 is work done by the system. So a gas that is compressed by its surroundings has negative W, and a system that loses heat has negative Q. All three quantities may be positive or negative, and the formula is purely additive — there is no division, so no combination of inputs can break it.

To see where the four standard processes come from, try the first law of thermodynamics simulator, which animates a piston and shows Q, W and ΔU balancing in real time. If you need to turn a temperature change into a heat value before using this calculator, start with the specific heat calculator and Q = mcΔT. For the limit on how much of that heat can become useful work, see Carnot efficiency; for the term itself, see the physics glossary.

Worked example

A gas absorbs 600 J of heat and does 200 J of work pushing a piston outwards. Its change in internal energy is ΔU = Q − W = 600 J − 200 J = 400 J. The gas keeps 400 J of the energy it received and spends the other 200 J on the piston, so its temperature rises. Reverse the question and the same numbers work backwards: if you know ΔU = 400 J and W = 200 J, then Q = ΔU + W = 600 J.

Now lock the piston so the gas cannot expand. With no volume change there is no work, W = 0, and the first law collapses to ΔU = Q — all 600 J go into internal energy and the temperature rises further than before. This is the point students most often miss: the same 600 J of heat produces a different temperature change depending on whether the gas is allowed to do work.

Why it matters

The first law is the accounting rule behind every engine, refrigerator and power station: it fixes how much of the fuel’s heat can appear as work, and where the rest must go. It governs the compression heating in a diesel engine, the cooling of gas escaping a valve, the energy balance of the atmosphere, and the calorimetry used to measure the energy in food. Any proposed machine that produces more energy than it consumes is refused by this one equation.

Frequently asked questions

What units should I use?

Enter all values in joules (J); the calculator also accepts kilojoules and megajoules and converts them for you. Because ΔU = Q − W simply adds and subtracts energies, every term must be in the same unit. If you need to turn a temperature change into a quantity of heat first, use the specific heat calculator to find Q = mcΔT, then bring that value here.

Which sign convention does this calculator use?

The physics convention: Q > 0 means heat added TO the system, and W > 0 means work done BY the system on its surroundings. That is why the formula subtracts the work: energy that leaves as work is no longer stored inside. Be aware that many chemistry and engineering texts define W as work done ON the system and write ΔU = Q + W instead — the physics is identical, only the bookkeeping differs.

Can ΔU be negative?

Yes. ΔU < 0 means the system lost internal energy — it cooled down, or it did more work than the heat it received. A gas expanding adiabatically is the classic case: with no heat supplied, every joule of work it does comes straight out of its internal energy, so it cools as it expands.

How do I find Q from a temperature change?

Use Q = mcΔT, where m is the mass, c the specific heat capacity and ΔT the temperature change — the specific heat calculator does this for you. Take the resulting value of Q, enter it here along with the work done, and the first law gives the change in internal energy.

What if work is done ON the system?

Enter W as a negative number. In this convention W is the work done by the system, so work done on it — compressing a gas, for example — is negative work. Subtracting a negative adds that energy back, so the calculator correctly increases ΔU. A bicycle pump warming up as you compress the air is exactly this case.

References & formula source

  • Halliday, Resnick & Walker — Fundamentals of Physics, Chapter 18 (Temperature, Heat & the First Law of Thermodynamics).
  • Young & Freedman — University Physics with Modern Physics, §19.4 (Internal energy and the first law of thermodynamics).
  • Çengel & Boles — Thermodynamics: An Engineering Approach, Chapter 4 (Energy analysis of closed systems).

Embed this calculator

Add this free First Law of Thermodynamics calculator to your own website — copy the snippet below.