Elements and compounds
An element is a substance made of only one kind of atom. Hydrogen, oxygen, chlorine, sodium and magnesium are elements, and so are about a hundred others: every atom of oxygen has eight protons, whatever it is part of. A compound is a substance made of atoms of two or more elements joined chemically, in a ratio that is always the same. Water is a compound of hydrogen and oxygen. Table salt is a compound of sodium and chlorine.
The jar starts with two elements side by side. In Water they are two colourless gases mixed together, hydrogen and oxygen, and nothing happens until a flame reaches them. Switch on Molecules and you see them as two-atom molecules: white hydrogen, H₂, and red oxygen, O₂, passing each other without combining. In Table salt a pea of soft grey sodium sits on a steel spoon, and the jar it goes into is tinted the faint yellow-green of chlorine, Cl₂.
Try it: switch on Molecules, choose Water, and drag Run the reaction slowly from Elements apart to Reaction over. Follow a single red oxygen atom from its O₂ molecule into a water molecule at the bottom of the jar.
A recipe that never changes
Around 1800 the French chemist Joseph Proust argued, against some of the most respected chemists of his day, that a compound always contains its elements in the same proportions by mass, however it is made. Water from a spring, water from a candle flame and water made in a laboratory all hold 11.2 % hydrogen and 88.8 % oxygen: about 1 gram of hydrogen to 7.94 grams of oxygen. This is the law of definite proportions.
John Dalton’s atomic theory explained it a few years later. If elements are made of atoms, and a compound is made of identical small groups of them, then every group carries the same atoms, and so the whole compound carries the same ratio. A water molecule is always two hydrogen atoms and one oxygen atom, written H₂O. An oxygen atom is about 16 times heavier than a hydrogen atom, so the oxygen in each molecule outweighs its two hydrogens by about 8 to 1, and the same is true of a glass of them.
The readings beside the Scene show both versions of the recipe for the compound you choose: the atoms in one unit, and the grams of the second element that one gram of the first takes up.
When one element runs out
The balanced equation beside the Scene counts whole molecules: two hydrogen molecules and one oxygen molecule make two water molecules, 2 H₂ + O₂ → 2 H₂O. The reaction goes on in steps like that until one of the two elements is used up. Whatever remains of the other is left exactly as it was.
Try it: with Molecules on, slide Oxygen or chlorine supplied up to 2 × needed, run Run the reaction to the end, and count the red O₂ molecules still flying about above the water. Then slide it down to 0.5 × needed and find the spare hydrogen instead.
The jar shows the same thing in Hydrogen chloride. With more chlorine than the hydrogen needs, some of the yellow-green is still there when the flame has passed; with exactly enough, the jar ends up clear.
Extra oxygen never makes the water richer in oxygen. Every molecule of water is still H₂O; the surplus is simply not part of the compound. The element that runs out first is called the limiting reactant, and it decides how much compound forms. That is why cooks, chemists and engineers measure out their ingredients: anything beyond the right proportion is waste.
Atoms are never created or destroyed in the process. Every atom in the jar at the end was there at the start, only joined to different partners. Antoine Lavoisier showed in the 1780s that a sealed vessel weighs the same before and after a reaction for exactly this reason.
New substance, new properties
A compound is not just its elements stirred together. Hydrogen is a gas that burns; oxygen is a gas that keeps things burning. Together they make water, a liquid that puts fires out. Sodium is a soft metal that fizzes and catches fire in water; chlorine is a poisonous yellow-green gas used as a weapon in the First World War. Together they make table salt, white crystals you sprinkle on food. In the jar, warm sodium burns in chlorine with the bright yellow of its own light, and the salt rises as white smoke and settles on the glass.
The properties change because the atoms are bonded differently. In water and hydrogen chloride, atoms share pairs of electrons in covalent bonds, and the compound is made of separate molecules. Sodium and magnesium instead hand electrons over to chlorine. A sodium atom gives up one electron and becomes a small positive ion, Na⁺; a chlorine atom takes one and becomes a larger negative ion, Cl⁻. With Molecules on, the violet sodium atoms shrink and the green chlorine atoms swell as they swap partners. The ions stack into a crystal, a regular three-dimensional pattern with no separate molecules at all, so the formula NaCl means one sodium ion for every chloride ion.
Try it: switch between Table salt and Magnesium chloride and compare the recipes beside the Scene. Magnesium ribbon burns dazzling white rather than yellow. A magnesium atom gives up two electrons, so each Mg²⁺ ion pairs with two Cl⁻ ions, and the formula becomes MgCl₂.
Compounds and mixtures
Before the reaction, the jar holds a mixture of hydrogen and oxygen. A mixture can have any proportions you like, each substance in it keeps its own properties, and it can be separated by physical means, such as cooling it until one gas condenses before the other. A compound can only be split by another chemical reaction: water comes apart into hydrogen and oxygen only when an electric current is passed through it, in electrolysis, and it gives back exactly the same ratio of the two.
Salt water is a mixture too: a compound, salt, dissolved in another compound, water, in whatever amount you choose. Boil the water away and the salt is left, unchanged.
What this model leaves out
Molecules counts a few dozen atoms where the jar holds about 6 × 10²¹ molecules, so each one counted stands for close to a millimole. With so many, nothing is left over in practice unless the amounts are unbalanced. The counts move in whole steps while the jar changes smoothly, and both are slowed down: a jar of hydrogen and oxygen goes off in a fraction of a second with a loud bang, and hydrogen and chlorine just as fast once a flame or strong light reaches them. What the flames and smoke look like is drawn from how these reactions are known to go, not simulated, and no free photograph of sodium or magnesium burning in chlorine was found to check them against.
The crystal grains are simplified. Real salt grows as a cubic lattice of millions of ions in every direction, and magnesium chloride’s layers are stacked in a more intricate pattern than the column drawn here. With Molecules on, the metal on the spoon is drawn as a handful of balls, where a real lump holds thousands of billions of billions of atoms. The balls cannot show the shine and softness that come from the sea of electrons those atoms share; the lump itself, in the jar, shows them.
The law of definite proportions itself has exceptions. Some solid compounds, such as one of the oxides of iron, FeO, have a few iron atoms missing from their crystals and so vary slightly in composition. And because elements come as isotopes of different masses, the ratio by mass depends on which isotopes are present: water made from heavy hydrogen is about 20 % hydrogen by mass instead of 11 %, though its atoms still combine two to one.



