Science Lab · Chemistry
Equation Balancer
In a chemical reaction no atom is made or destroyed; the atoms only change partners. Drag whole molecules onto each side until every element has the same count on the left and the right. You can only add or take away whole molecules, never change one, just as a real equation only lets you change the numbers in front.
Equation
Equation
Atom tally
Dragging
With hints on, while you hold a molecule its drop zone glows green if it brings its elements closer to balance, gold if it makes no difference, and red if it makes things worse. The tally marks each element ↓ closer or ↑ further.
How to play. Drag a molecule from a shelf up into its box to add one, or drag one out of a box back onto its shelf to take it away. A molecule can only go on its own side of the arrow, and every substance keeps at least one. The − and + buttons in the equation do the same. Keyboard: click the picture or tab to it, then ←↑→↓ move between the shelves and the boxes; Enter picks up a molecule, the arrow keys carry it to the places it may go, and Enter drops it; Esc puts it back; + and − add or take one away; C checks.
Why equations must balance
Atoms are not made or destroyed in a chemical reaction. They come apart and join up in new ways. So a correct equation has the same number of each kind of atom on both sides. This is the law of conservation of mass, and it is why a sealed jar weighs the same before and after a reaction inside it.
The small numbers in a formula, the subscripts, say what a substance is. H₂O is water; H₂O₂ is hydrogen peroxide, a different substance. So you never change a subscript to balance an equation. You change the big numbers in front, the coefficients, which say how many molecules take part. That is all the balancer lets you do: add or take away whole molecules.
A balanced equation uses the smallest whole numbers that work. 4 H₂ + 2 O₂ → 4 H₂O balances, but every number can be halved, so the answer is 2 H₂ + O₂ → 2 H₂O. Press Check and the balancer tells you the smallest set.
A way to balance any of them
- Count each element on both sides. The tally does this for you.
- Start with an element that appears in only one substance on each side, often a metal or carbon.
- Leave elements that stand alone, like O₂, H₂ or a metal, for last. You can change their number without upsetting anything else.
- If a group such as SO₄ or NO₃ goes through unchanged, count it as one unit.
- If you need half a molecule, as with 3½ O₂ for burning ethane, double every number.
- Check every element again at the end.
The ball colors follow a long custom among chemists, the CPK colors: hydrogen white, carbon gray, nitrogen blue, oxygen red, chlorine green, sulfur yellow. The colors here are close to the defaults of the free Jmol viewer. The pictures show which atoms join, not the true shape or size of each molecule; the metal compounds, such as salt and rust, are really crystals, drawn here as one small unit of the crystal.
For practice with numbers and more examples, see Balancing Equations on the Chemistry Ladder, and watch acids and bases react in the Mixing Lab.
How the dragging works
A molecule you drag doesn’t just follow your finger. The balancer knows the places it is allowed to be: inside its own box, or on its own shelf. It shows the allowed spot nearest your finger, so a reactant stops at the edge of its box and never crosses the arrow, and a substance’s last molecule can’t leave. While you drag, it works out what dropping there would do to every element’s count. The idea of dragging only between allowed states comes from a research paper, “Declarative Dragging” by Joshua Horowitz, Andrew Blinn and Jeffrey Heer (2026); the balancer’s code is our own. Every one of the 27 answers was also worked out separately from the atom counts with exact fractions, and the two agree.
Sources
- OpenStax, Chemistry 2e, 4.1 Writing and Balancing Chemical Equations (coefficients, not subscripts; methane, ethane, ammonia and other examples).
- OpenStax, Biology 2e, 8.1 Overview of Photosynthesis (the overall equation of photosynthesis).
- Jmol, Jmol colors (the default CPK-style element colors).
- J. Horowitz, A. Blinn and J. Heer, “Declarative Dragging”, UIST 2026: the idea of dragging only between allowed states.