Chemical Equation Balancer

Enter an unbalanced chemical equation below (e.g., H2 + O2 = H2O). Our algorithm uses linear algebra to find the smallest integer coefficients that satisfy the law of conservation of mass.

How it works

The balancer constructs a system of linear equations based on the atomic count of each element. By representing the stoichiometry as a matrix where each row is an element and each column is a compound, we solve for the null space of the matrix. The resulting vector provides the stoichiometric coefficients.

Tips for Input

  • Use uppercase for the first letter of elements (e.g., Na, not na).
  • Use = or --> to separate reactants and products.
  • Case sensitivity is strictly enforced to distinguish between Co (Cobalt) and CO (Carbon Monoxide).