Chemical equation balancer
Exact balancing of a chemical equation by linear algebra over exact fractions, with the element-by-element check shown.
Result
4 Fe + 3 O2 → 2 Fe2O3
- Method
- Null space of the composition matrix, solved in exact fractions (Gaussian elimination over rationals), reduced to the smallest integers.
Element-by-element check
- Fe
- 4 = 4
- O
- 6 = 6
Note
Balanced: each of the 2 elements counts as many atoms on both sides, recounted independently of the solver.
Calculation, assumptions and sources
OverviewSmallest integer coefficients of a chemical equation (H2 + O2 -> H2O, parentheses accepted), by exact linear algebra, with an element-by-element check.
Smallest integer coefficients of a chemical equation (H2 + O2 -> H2O, parentheses accepted), by exact linear algebra, with an element-by-element check. Impossible cases are named with their reason.
Method & formulaseach element → one conservation equation
Each element gives one linear equation: as many atoms on the left as on the right. The system is solved by Gaussian elimination over exact fractions (big integers), with no rounding, then reduced to the smallest integer coefficients. The method also handles equations that are tedious by trial and error, such as KMnO4 + HCl -> KCl + MnCl2 + H2O + Cl2.
- Stoichiometric coefficients
- the numbers placed before each species to conserve atoms, given as smallest integers.
- Conservation of atoms
- a reaction rearranges bonds without creating or destroying atoms (Lavoisier).
- Symbol case
- an uppercase letter opens a symbol and a lowercase letter completes it; CO is one carbon and one oxygen, Co is cobalt.
Validity domainNeutral species only; ionic equations and redox half-equations, which also require charge and electron conservation, are not covered.
Neutral species only; ionic equations and redox half-equations, which also require charge and electron conservation, are not covered. Hydrates (CuSO₄·5H₂O) can be written expanded: CuSO4(H2O)5 works. Twelve species at most. A balanced equation says nothing about the thermodynamics or kinetics of the reaction.
Equations that cannot be balancedAn element present on one side only cannot be conserved: a species is missing.
An element present on one side only cannot be conserved: a species is missing. C + O2 -> CO + CO2 admits infinitely many solutions, because it superposes two independent reactions (C + O2 -> CO2 and 2C + O2 -> 2CO); their real proportions depend on experimental conditions.