Chemical Equation Balancer
Balance any chemical equation using matrix null-space methods.
Enter reactants and products separated by + and =, and get the smallest integer coefficients.
Balancing a chemical equation means finding integer coefficients (the small numbers in front of each species) so that every element has the same total atom count on both sides. This is a direct consequence of the law of conservation of mass — atoms are not created or destroyed during a chemical reaction.
This calculator solves the balancing problem algebraically using matrix null spaces. Each chemical species becomes a column; each element becomes a row; the entry at row i, column j is the count of element i in species j. Reactant entries are positive, product entries negative. A vector x of coefficients balances the equation exactly when M x = 0 — that is, x is in the null space of M.
For most chemical equations the null space is one-dimensional, giving a unique balancing (up to scaling). The calculator finds the basis vector, scales it to smallest positive integers, and reports the coefficients.
Worked example: propane combustion, C₃H₈ + O₂ = CO₂ + H₂O. Elements: C, H, O. Species: C₃H₈, O₂, CO₂, H₂O. Matrix:
- C row: 3, 0, -1, 0
- H row: 8, 0, 0, -2
- O row: 0, 2, -2, -1
Null space gives coefficients (1, 5, 3, 4): 1 C₃H₈ + 5 O₂ = 3 CO₂ + 4 H₂O. Verify: 3 C left, 3 right ✓; 8 H left, 8 right ✓; 10 O left, 10 right ✓.
Input format:
- Use + between species on the same side
- Use = or -> or → between reactant and product sides
- Subscripts go directly after element symbols, no superscripts
- Parentheses with subscripts are supported: Al2(SO4)3
- Capitalization matters — Co (cobalt) is different from CO (carbon monoxide)
Examples to try:
- H2 + O2 = H2O (the classic)
- Fe + O2 = Fe2O3 (rust formation)
- C2H6 + O2 = CO2 + H2O (ethane combustion)
- KMnO4 + HCl = KCl + MnCl2 + H2O + Cl2 (a tougher one with five products)
If the calculator returns an error like “underdetermined” or “no solution,” the equation likely has a typo, a missing species, or contains compounds that genuinely cannot react in the given proportions. The math reflects the chemistry — when you cannot balance, conservation is violated.
For redox reactions in solution, you may need to add H⁺, OH⁻, or H₂O explicitly as separate species. The calculator does not auto-add water or proton balancers.
How we build and check this calculator
This calculator runs entirely in your browser, so the numbers you enter stay on your device. The math behind it is written by hand and tested against worked examples and standard references before the page goes live.
SuperGlobalCalculator is independently built and maintained. See how we build and verify our calculators.