First Law of Thermodynamics Calculator (ΔU = Q − W)

Apply the first law of thermodynamics ΔU = Q − W.
Enter any two of internal energy change, heat, and work to find the third, with sign-convention guidance.

First Law Result

Energy conservation, written for heat and work

The first law of thermodynamics is the law of conservation of energy applied to systems that exchange heat and do work. It says the internal energy of a system changes by exactly the heat you add minus the work the system does. Energy is never created or destroyed; it only moves between heat, work, and the internal store.

The formula (physics convention)

ΔU = Q − W

Where:

  • ΔU = change in the system’s internal energy (joules)
  • Q = heat added to the system (joules), positive when heat flows in
  • W = work done by the system on its surroundings (joules), positive when the system pushes outward

This calculator solves for whichever of the three you leave blank.

The sign convention trap

This is the single most confusing thing in introductory thermodynamics, because two conventions are in common use and they disagree about the sign of work:

  • Physics and engineering convention: ΔU = Q − W, where W is work done BY the system. A gas expanding and pushing a piston does positive work, which drains internal energy.
  • Chemistry convention: ΔU = Q + W, where W is work done ON the system. Same physics, opposite bookkeeping sign for W.

This calculator uses the physics convention, ΔU = Q − W with W as work done by the system. If your textbook writes ΔU = Q + W, just flip the sign of the work value before entering it. Both conventions give identical final internal-energy changes; they only differ in how they label the work term.

Reading the signs

Quantity Positive means Negative means
Q Heat flows into the system Heat flows out (system cools its surroundings)
W System does work on surroundings (expansion) Work done on the system (compression)
ΔU Internal energy rises (often hotter) Internal energy falls (often cooler)

For an ideal gas, internal energy depends only on temperature, so a positive ΔU usually means the gas got hotter.

The four classic processes

The first law takes a simple form in each of the standard idealized processes:

  • Isothermal (constant temperature): ΔU = 0 for an ideal gas, so Q = W. All the heat you add comes straight back out as work.
  • Adiabatic (no heat exchange): Q = 0, so ΔU = −W. The system does work purely by spending internal energy, which is why compressed air heats up and expanding gas cools (the principle behind refrigeration and why a spray can goes cold).
  • Isochoric (constant volume): no volume change means no expansion work, W = 0, so ΔU = Q. All heat goes into internal energy. This is how a bomb calorimeter measures heat of reaction.
  • Isobaric (constant pressure): W = PΔV, and ΔU = Q − PΔV. Most everyday heating of gases at atmospheric pressure works this way.

Worked example, a gas expanding

You add 500 J of heat to a gas, and it expands, doing 200 J of work pushing a piston.

ΔU = Q − W = 500 − 200 = 300 J

The internal energy rises by 300 J. Of the 500 J of heat poured in, 200 J left immediately as mechanical work and 300 J stayed behind, warming the gas.

Worked example, adiabatic compression

You compress a gas with 150 J of work and let no heat escape (Q = 0). Work done ON the gas is negative work done BY the gas, so W = −150 J.

ΔU = Q − W = 0 − (−150) = +150 J

All 150 J of compression work becomes internal energy, so the gas heats up. This is exactly why a bicycle pump gets warm and why diesel engines ignite fuel by compression alone, with no spark plug.

Why it matters

The first law underlies every heat engine, refrigerator, power plant, and internal combustion engine. It sets the energy bookkeeping that the second law then constrains (the second law is what says you cannot convert all that heat back into work). Together they are the foundation of all of thermodynamics, and the first law is where every analysis starts: account for the energy, and nothing is allowed to go missing.


Embed This Calculator

Copy the code below and paste it into your website or blog.
The calculator will work directly on your page.