On this page
Left alone, a sealed box of air at one temperature never splits into a warm half and a cool half. James Clerk Maxwell asked what would happen if someone could watch the molecules one by one, and the standard answer took more than a century to arrive.
What is Maxwell's demon thought experiment?
Maxwell's demon is an imagined being that sorts gas molecules by speed through a tiny door, so one side of a box gets hotter and the other colder without any work being done. Maxwell put it into print in his textbook *Theory of Heat* in the early 1870s (history of the demon on Wikipedia; full text of the 1899 edition on the Internet Archive). In his words, the being “can see the individual molecules, opens and closes this hole, so as to allow only the swifter molecules to pass from A to B, and only the slower ones to pass from B to A.”
Maxwell first raised the idea in an 1867 letter to his colleague Tait (Stanford Encyclopedia of Philosophy) and never called it a demon. William Thomson, later Lord Kelvin, did, in an 1874 Nature paper.
Why does the demon seem to break the second law?
Maxwell stated the second law this way: in a sealed box where temperature and pressure are the same everywhere, it is “impossible … to produce any inequality of temperature or of pressure without the expenditure of work” (Theory of Heat).
The catch is that temperature is an average. Maxwell pointed out that molecules in air at uniform temperature “are moving with velocities by no means uniform”, the spread you can see in Maxwell's 1860 distribution of molecular speeds. A demon that lets fast ones into B and slow ones into A would, he wrote, “without expenditure of work, raise the temperature of B and lower that of A, in contradiction to the second law of thermodynamics.”
A heat engine running between hot B and cold A would then draw work from a box that started at one temperature, which the Kelvin-Planck and Clausius statements of the second law rule out. Maxwell's own conclusion: the law is “undoubtedly true as long as we can deal with bodies only in mass”. It is statistical.
A worked example: how much work is one bit worth?
In 1929 Leo Szilard shrank the demon's job to one molecule (Zeitschrift für Physik). These steps follow the Stanford Encyclopedia of Philosophy's account of the Szilard engine.
A box holds one molecule, kept at temperature T.
A partition slides into the middle. Left or right: one bit of information.
The demon looks and records which side.
It hooks the partition to a pulley and lets the molecule push it to the far wall, an expansion at constant temperature.
The volume doubles, so W = kT ln 2, the one-molecule version of W = nRT ln(V2/V1).
Now the numbers. The Boltzmann constant is exactly 1.380 649 × 10^-23 J/K (NIST). At T = 300 K, with ln 2 ≈ 0.693, W ≈ 1.380649 × 10^-23 × 300 × 0.693 ≈ 2.87 × 10^-21 J per cycle. Tiny, but free work repeated forever would still break the law.
So what saves the second law?
For decades the suspect was measurement: Szilard argued that finding out which side the molecule is on must carry a compensating entropy cost (Stanford Encyclopedia of Philosophy).
The standard answer, though still debated by some philosophers of physics, points at forgetting instead. In 1961 Rolf Landauer argued that erasure is the costly step (IBM Journal of Research and Development): resetting one bit to zero must turn at least kT ln 2 of work into heat. In 1982 Charles Bennett argued that measurement can in principle be done reversibly, without producing heat (International Journal of Theoretical Physics; summarised by the Stanford Encyclopedia).
So to keep sorting, the demon must wipe its record of each molecule, releasing at least kT ln 2 of heat each time: what the Szilard engine earned. Total entropy does not fall.
In 2012 Antoine Bérut and colleagues tested this with a single colloidal particle in a double-well trap as a one-bit memory: the average heat released on erasing it levelled off at the Landauer bound for slow erasures (Nature abstract on PubMed).
How do you explain Maxwell's demon in an exam or viva?
A four-step answer covers it:
Setup: gas at one temperature, a wall with a door, a being that lets fast molecules through one way and slow ones the other.
Paradox: one side heats, the other cools, with no work done.
Resolution: the demon must erase what it learns; each erased bit releases at least kT ln 2 of heat, so total entropy does not fall.
Lesson: information is physical, and the second law is statistical.
To see why sorting lowers entropy, try this coin-and-box introduction to entropy. If molecular speeds are hard to picture, the Fermi Simulation Lab has interactive simulations for ideas that are easier to see than to read. For isothermal-work numericals, the Fermi Problem Library has worked problems with a step-by-step solver that explains the reasoning.



