Chemical Equation Balancer

Type a chemical equation and get the balanced version with the smallest whole-number coefficients.

How to use

  1. Type the unbalanced equation using element symbols and numbers — for example H2 + O2 -> H2O.
  2. Use -> or = between reactants and products. Parentheses like Ca(OH)2 are supported.
  3. Click Balance — the equation appears with the smallest whole-number coefficients that conserve every element.

About this tool

A balanced chemical equation has the same number of atoms of each element on both sides — the law of conservation of mass, stated by Lavoisier in 1789. This tool finds the smallest set of whole-number coefficients that achieves that balance, using Gaussian elimination on the element matrix.

For simple equations like H₂ + O₂ → H₂O the answer is immediate (2H₂ + O₂ → 2H₂O). For combustion, redox and organic reactions with many elements and compounds, the algebra gets tedious by hand — this is where the matrix method earns its keep.

The parser understands standard chemical notation: uppercase letter optionally followed by lowercase (Fe, Na, Cl), subscript numbers (H2O, C6H12O6), and parenthetical groups with subscripts (Ca(OH)2, Al2(SO4)3). It does not understand charges, phases or state symbols.

The formula

Set up a matrix where each row is an element and each column is a compound, with products negative. Find the null space via Gaussian elimination. Scale to the smallest positive integers.

Frequently asked questions

What notation does it accept?

Standard formulas (H2O, NaCl, Ca(OH)2, C6H12O6) separated by + on each side, with -> or = between reactants and products.

Does it handle ionic equations?

Not yet — it balances atoms, not charges. For full ionic equations you need to balance both, which this tool does not do.

Why does it say the equation cannot be balanced?

Usually because an element appears on only one side, or the formulas contain a typo. Check every symbol and subscript.

Does my equation leave the browser?

No. The matrix algebra runs in JavaScript on your device.

Related tools

Long links? Shorten them for free

Vai.la turns any URL into a short link with click statistics, QR Code and your own biolink.

Vai.la is not responsible for how the tools are used or for decisions made based on their results.