Equation Balancer
Automatically balance any chemical equation by mass and charge.
2H2 + O2 → 2H2O
To balance a chemical equation, add whole-number coefficients so each element has the same atom count on both sides — the law of conservation of mass. For H₂ + O₂ → H₂O, the balanced form is 2 H₂ + O₂ → 2 H₂O, giving 4 H and 2 O on each side.
How balancing works
A balanced equation has the same number of each atom on both sides — the law of conservation of mass. The balancer treats each element as an equation, builds a system of linear equations from the formulas, and solves for the smallest set of whole-number coefficients that satisfies them all at once.
Worked example
Balance H₂ + O₂ → H₂O, the formation of water.
- 1 Count atoms on each side. Left: 2 H, 2 O. Right: 2 H, 1 O. Oxygen doesn’t match yet.
- 2 Adjust coefficients to balance oxygen. Put a 2 in front of H₂O → 2 H₂O. Now the right has 4 H and 2 O.
- 3 Rebalance hydrogen. Put a 2 in front of H₂ → 2 H₂ + O₂ → 2 H₂O. Both sides now have 4 H and 2 O.
Common reaction types
Balanced examples; coefficients of 1 are written implicitly.
| Type | Balanced equation | Pattern |
|---|---|---|
| Synthesis | 2 H₂ + O₂ → 2 H₂O | A + B → AB |
| Decomposition | 2 H₂O → 2 H₂ + O₂ | AB → A + B |
| Combustion | CH₄ + 2 O₂ → CO₂ + 2 H₂O | fuel + O₂ → CO₂ + H₂O |
| Single replacement | Zn + 2 HCl → ZnCl₂ + H₂ | A + BC → AC + B |
| Double replacement | AgNO₃ + NaCl → AgCl + NaNO₃ | AB + CD → AD + CB |
Why coefficients, not subscripts
Change how many molecules, never the molecule. You balance by adjusting coefficients in front of formulas. Changing a subscript — turning H₂O into H₂O₂ — would change the substance from water to hydrogen peroxide.
Balance one element at a time. A useful order is metals first, then non-metals, then hydrogen, then oxygen last. Polyatomic ions that stay intact can be balanced as a single unit.
Common mistakes. Editing subscripts, leaving fractional coefficients (multiply the whole equation through to clear them), and forgetting to recount every element after each change.