What are the laws of thermodynamics?

The laws of thermodynamics: ΔU = Q − W. Heat always flows from hot to cold by itself, and energy is never lost: heat you put into something either warms it or lets it do work. Because of this, no engine can turn all its heat into work, and nothing can ever be cooled all the way to absolute zero.

Heat flows downhill, energy always balances, no engine is perfect and absolute zero is out of reach. Watch hot and cold molecules share their speed, push a piston with a heater, run Carnot's perfect engine, pump heat uphill with an AC, and meet Maxwell's demon.

The laws of thermodynamicsOpened 27 Sept 202612 min to playFree · no sign-up

In 60 seconds

  1. Temperature is jiggling, and heat flows downhill

    Air molecules at 20 °C fly at about 500 m/s. Put a hot box against a cold one and the fast molecules share their energy until both reach one temperature: the zeroth law. Heat never flows back from cold to hot by itself: the second law.

  2. The energy books: ΔU = Q − W

    Heat a gas under a piston and part of the heat raises its internal energy while the rest pushes the piston as work. For air at steady pressure, 2/7 of the heat becomes work. Lock the piston and all of it warms the gas.

  3. No engine can be perfect

    Heat does work only while flowing from hot to cold, and some must always be dumped. Carnot's limit is 1 − T_cold ÷ T_hot in kelvin: 88% for a car's burning gas, but real engines reach about 30%.

  4. Pumping heat uphill costs work

    An AC or fridge moves heat from cold to hot and pays in electricity. Heat out = heat taken + electricity. The smaller the temperature gap, the more heat each unit moves, up to Carnot's T_cold ÷ (T_hot − T_cold).

  5. Entropy, the demon and absolute zero

    Spread-out arrangements vastly outnumber tidy ones, so entropy grows. Maxwell's demon can sort molecules, but wiping its memory costs more entropy than it saves. And every cooling step leaves something: 0 K is never reached.

Where you'll meet it

ΔU = Q − W

change in a thing's internal energy = heat put in − work it does; heat flows by itself only from hot to cold, so total entropy never falls (ΔS ≥ 0)

The history

From a warm glass bulb in Padua to atoms a few trillionths of a degree above absolute zero: 400 years of learning what heat is and where it can go.

Read the full history
  1. 1593A glass bulb that shows heat
  2. 1845Paddle wheels and the price of heat
  3. 1865A new word: entropy
  4. 1906The third law: you can never reach absolute zero

The full explanation

The laws of thermodynamics, chapter by chapter

Chapter 1

Heat flows downhill, and the books always balance

Hot meets cold, a heater pushes a piston, and a gas spreads out and never un-spreads.

Thermodynamics is the science of heat, work and temperature. It rests on four short laws, and they explain everything from an ice cube in your drink to the engine in a car.

Temperature is how fast molecules jiggle. In air at 20 °C the molecules fly at about 500 metres a second, some slower, some faster. Hot air's molecules are faster. The board shows their speeds: the curve is the Maxwell–Boltzmann spread.

Zeroth law: put two things in touch and heat flows until they reach the same temperature. That is thermal equilibrium, and it is why a thermometer works: it settles to the temperature of whatever it touches.

First law: energy is never made or destroyed (see EnergyClear). For a gas it reads ΔU = Q − W: the change in the gas's inner energy U equals the heat Q put in, minus the work W the gas does pushing the piston. Switch to Piston and watch the books balance.

Second law: heat flows from hot to cold by itself, never the other way. The reason is counting. There are vastly more ways for energy and molecules to be spread out than bunched up, so things spread. The measure of that spreading is entropy, and in anything left alone it only grows. Third law: you can get ever closer to absolute zero, −273.15 °C, but never reach it (see chapter 5).

Try “The laws, live” in the interactive model →

Chapter 2

No engine can turn all its heat into work

Carnot’s perfect engine, and the petrol engine in a car.

A heat engine turns heat into motion. Fuel burns and makes a hot gas, the hot gas pushes, and the push drives wheels or a generator. Car engines, motorbikes, power stations and jet engines are all heat engines.

In 1824 a young French engineer, Sadi Carnot, worked out the rule for all of them. Heat can only do work while it flows from something hot to something cold, just as a water wheel needs water to fall. And some heat must always be dumped into the cold side. You can never turn all of it into work.

The best any engine can possibly do is the Carnot limit: efficiency = 1 − Tcold ÷ Thot, with both temperatures in kelvin. Between 600 K and 300 K, at most half the heat can become work. That is the second law in its engineer's form: the entropy the heat carries in must be carried out, and the cold side can only take it with some heat.

A car's petrol engine squeezes air and fuel into a small space, sparks it, and the burning gas at about 2,500 K pushes the piston down. Carnot would allow 88%. Real engines manage about 25 to 35%: heat soaks into the cylinder walls and coolant, the exhaust leaves still very hot, and friction takes its share. See CarClear and MotorcycleClear.

Try “Heat engines” in the interactive model →

Chapter 3

Pushing heat uphill costs work

An AC and a fridge move heat from cold to hot. The second law sets the price.

Heat flows from hot to cold by itself. So on a 35 °C day, heat leaks into a 24 °C room through the walls, the window and the roof, all the time. To keep the room cool, something has to carry that heat back out, uphill, from cold to hot.

That machine is a heat pump. An AC and a fridge are both heat pumps. A cold liquid in the inside coil soaks up heat, the compressor squeezes the vapour until it is hotter than the outside air, and the outside coil dumps the heat there. See ACClear and FridgeClear.

The second law says moving heat uphill always costs work. The first law says where it all goes: heat out = heat taken + electricity. So the outdoor unit blows out more heat than the AC removes from your room.

How much heat you move per unit of electricity is the COP (coefficient of performance). Carnot's rule caps it at Tcold ÷ (Thot − Tcold), in kelvin. The smaller the temperature gap, the cheaper the pumping. That is why setting your AC at 24 °C instead of 18 °C saves so much.

Try “Heat pumps” in the interactive model →

Chapter 4

Cold never flows in: heat flows out

Ice in a drink and a pot on the flame. Heat always runs downhill, and entropy always grows.

Drop ice into a warm drink and the drink gets cold. It feels as if cold flows out of the ice. It doesn't. Heat flows out of the drink into the ice, downhill, as the second law says. There is no such thing as a flow of "cold".

That heat first warms the ice from the freezer's −18 °C up to 0 °C. Then it does something sneaky: it melts the ice without warming it at all. Melting 1 gram takes 334 joules, enough to cool 80 grams of drink by 1 °C. That hidden latent heat, not the ice's coldness, is why ice cools a drink so well.

At the end, the drink and the meltwater sit at one temperature. That's the zeroth law again: thermal equilibrium. And the total entropy has gone up: the ice gained more entropy than the drink lost, because the same heat counts for more at a lower temperature (ΔS = Q ÷ T).

On the hob, heat tumbles down a staircase: a flame at about 1,950 °C, the pot, the water at up to 100 °C, and finally the kitchen at 30 °C. Every step makes entropy, and none can run backwards. Hot flue gas that misses the pot goes up the chimney hood. See ChimneyClear, and AirFryerClear for heat blown into food.

Try “In the kitchen” in the interactive model →

Chapter 5

Absolute zero, a clever demon, and a fridge that heats

Why you can never reach 0 K, why sorting molecules isn’t free, and why an open fridge warms the kitchen.

Third law: as things get colder, molecules slow down, and at absolute zero, 0 K or −273.15 °C, they would have the least motion that quantum physics allows. But every cooling step removes only part of the heat that is left, so you can get closer and closer and never arrive. Walther Nernst worked this out between 1906 and 1912.

Physicists have come astonishingly close. With laser beams that push on atoms and then let the fastest escape, they cooled rubidium to 170 billionths of a kelvin in 1995, and the atoms merged into one quantum blob, a Bose–Einstein condensate. Deep space, by comparison, is a warm 2.7 K.

Maxwell's demon is a thought experiment from 1867. A tiny being opens a door only for fast molecules going one way and slow ones going the other. The gas splits into hot and cold with no work: the second law broken? The catch, found by Rolf Landauer and Charles Bennett, is information. The demon must remember each molecule, and wiping its memory costs at least k T ln 2 of heat per bit, which makes more entropy than it removed.

Life seems to break the second law too: a seed builds a tree, beautifully ordered. But living things take in low-entropy food or sunlight and give out heat and waste with far more entropy. The total still grows. Order here is paid for by more disorder elsewhere.

Myth-buster: a fridge does not "make cold". It moves heat. Open its door in a closed kitchen and the room gets warmer, by exactly the electricity it uses. And the second law is about odds, not force: a gas could un-spread by chance, but for real numbers of molecules the chance is so tiny it never happens in the life of the universe.

Try “Limits and surprises” in the interactive model →

Test yourself

Frequently asked

A spoon at 20 °C sits in soup at 70 °C. What happens?

Heat flows from the soup into the spoon until they reach the same temperature. Heat flows from hotter to colder by itself until both are at one temperature: thermal equilibrium. There is no such thing as "cold" flowing.

You put 100 J of heat into a gas and it does 30 J of work pushing a piston. How much did its internal energy go up?

70 J. First law: ΔU = Q − W = 100 − 30 = 70 J. The rest of the energy left as work on the piston.

Why does a gas that has spread through a box never gather back in one half by itself?

There are overwhelmingly more spread-out arrangements than bunched ones, so it is almost impossible. For 100 molecules the chance of all being on one side is 1 in 2¹⁰⁰, about 1 in 10³⁰. Real gases have around 10²² molecules in a litre. That counting is the second law.

An engine takes heat from steam at 600 K and dumps heat to a river at 300 K. What is the best efficiency it could possibly have?

50%. Carnot limit = 1 − 300 ÷ 600 = 0.5, so 50%. Even a perfect engine must dump half the heat into the river.

Why can’t a car engine turn all the heat from its fuel into motion?

Heat can only do work while flowing to something colder, and some must always be dumped there. The second law: some heat must flow out to the cold side (exhaust and radiator). Carnot’s limit is the best possible, and real losses make it worse.

How could you raise the Carnot limit of an engine?

Make the hot side hotter or the cold side colder. 1 − T_cold ÷ T_hot grows when T_hot goes up or T_cold goes down. That is why power-station turbines run as hot as their metals allow.

An AC removes 5 kW of heat from a room using 1.5 kW of electricity. How much heat comes out of the outdoor unit?

6.5 kW. First law: heat out = heat taken + electricity = 5 + 1.5 = 6.5 kW. That is why the outdoor unit blows hot air.

Why does a heat pump need electricity at all?

Heat never flows from cold to hot by itself, so moving it uphill takes work. The second law: heat flows downhill by itself. Carrying it uphill always costs work, just as pumping water uphill does.

When is an AC most efficient (highest COP)?

When the inside and outside temperatures are close. Carnot COP = T_cold ÷ (T_hot − T_cold). A small gap means a big COP, so less electricity per unit of heat moved.

When you drop ice into a warm drink, what actually flows?

Heat flows from the drink into the ice. Heat always flows from hotter to colder. The drink loses heat to the ice, which is why the drink cools. "Cold" is just less heat.

Why is ice at 0 °C much better at cooling a drink than the same amount of water at 0 °C?

Melting soaks up 334 J per gram without the ice warming up. Melting takes latent heat: 334 J per gram. Ice soaks up that heat as it melts, while water at 0 °C can only warm up.

A pot of water sits on a flame at about 1,950 °C. Why doesn’t the water get hotter than 100 °C?

At 100 °C the heat goes into turning water into steam instead. At the boiling point, each 2,257 J boils off a gram of water. The temperature stays at 100 °C until the water is gone.

Why can’t anything be cooled all the way to absolute zero?

Each cooling step removes only part of what’s left, so you get closer for ever without arriving. That is the third law. Each step gets you a fraction closer, like halving a distance over and over. Scientists have reached billionths of a kelvin, but never zero.

What stops Maxwell’s demon from breaking the second law?

It must record each molecule, and erasing that memory makes at least as much entropy as the sorting removed. Landauer and Bennett showed that information has a cost: wiping each bit releases at least k T ln 2 of heat. The books still balance in the second law’s favour.

You leave the fridge door open in a closed, sealed kitchen. What happens to the kitchen?

It warms up. The fridge pulls heat from the air in front and dumps it, plus its own electricity, out of the back into the same room. Net effect: the room gains the electricity as heat.

Words worth knowing

Temperature
How fast molecules jiggle on average. In kelvin it starts at absolute zero, −273.15 °C.
Heat (Q)
Energy that flows because of a temperature difference, by itself always from hotter to colder.
Work (W)
Energy passed on by a push through a distance, like gas pushing a piston.
Internal energy (U)
All the jiggling and spinning energy of the molecules inside something.
Thermal equilibrium
Things in touch at the same temperature, with no more heat flowing between them.
Entropy (S)
A count of the ways energy and molecules can be arranged, S = k ln W. Left alone, it only grows.
Carnot limit
The best efficiency any heat engine can have: 1 − T_cold ÷ T_hot, in kelvin.
Absolute zero
0 K, the coldest possible temperature. You can get ever closer but never reach it.

Fork it. Teach with it.

This box is plain HTML, CSS and JavaScript, with no build step and no accounts. Run it yourself and it sends nothing anywhere. The code is MIT. The words, images and videos are CC BY 4.0, so you can reuse them anywhere if you credit “Glassbox, glassbox.how/e/thermoclear”.

git clone https://github.com/bdeeps/thermoclear.git

Built with three.js (MIT), Geist, Instrument Serif (SIL OFL 1.1).

←→ previous / next box · / search

Would you like to see the full page, with the interactive model?