Chemical Equation Balancer
Smallest whole-number coefficients for any reaction, checked atom by atom.
Independent reactions
Each balances on its own; any positive mix of them balances the full equation.
Check
| Element | Left | Right | Balanced? |
|---|
Substances
| Substance | Coefficient | Molar mass (g/mol) | Mass (g) |
|---|
Mass = coefficient × molar mass: the grams that react per mole of reaction as written.
How it was worked out
Composition matrix and reduced row echelon form
Composition matrix A (products negative)
Reduced row echelon form
About the Chemical Equation Balancer
Type a reaction such as Fe + O2 = Fe2O3 or C3H8 + O2 -> CO2 + H2O and get it balanced with the smallest whole-number coefficients: 4Fe + 3O₂ → 2Fe₂O₃. Ionic equations and redox half-reactions work too — charges (MnO4-, Fe3+, Cr2O7^2-) and electrons (e-) are balanced along with the atoms — and so do states such as (s), (aq) and (g), hydrates, isotopes and common names.
Instead of trial and error, the balancer solves the equations exactly: one equation per element and one for charge, solved by rational Gaussian elimination for the null space of the composition matrix. It shows every step, checks each element and the charge on both sides, confirms that mass is conserved, and explains clearly when an equation cannot be balanced or can be balanced in more than one way.
How to use it
- Type the reactants, an arrow (
=,->,→or<=>) and the products, separated by+. Coefficients are optional — any you type are checked and then replaced by the smallest whole numbers. - For ions write the charge at the end (
SO4^2-,Fe3+,NH4+); for half-reactions add electrons ase-. - Read the balanced equation and the check table: every element and the charge must match on both sides.
- Copy it as text, as ASCII for typing, or as LaTeX (mhchem
\ce{…}), and open How it was worked out for the matrix method.
Examples
Fe + O2 = Fe2O3
4Fe + 3O₂ → 2Fe₂O₃
C3H8 + O2 -> CO2 + H2O
C₃H₈ + 5O₂ → 3CO₂ + 4H₂O
As in OpenStax Chemistry 2e Example 4.9.
KMnO4 + HCl = KCl + MnCl2 + Cl2 + H2O
2KMnO₄ + 16HCl → 2KCl + 2MnCl₂ + 5Cl₂ + 8H₂O
MnO4- + Fe2+ + H+ = Mn2+ + Fe3+ + H2O
MnO₄⁻ + 5Fe²⁺ + 8H⁺ → Mn²⁺ + 5Fe³⁺ + 4H₂O
Charge: +17 on each side.
Cr2O7^2- + H+ + e- = Cr3+ + H2O
Cr₂O₇²⁻ + 14H⁺ + 6e⁻ → 2Cr³⁺ + 7H₂O
K4Fe(CN)6 + KMnO4 + H2SO4 = KHSO4 + Fe2(SO4)3 + MnSO4 + HNO3 + CO2 + H2O
10K₄Fe(CN)₆ + 122KMnO₄ + 299H₂SO₄ → 162KHSO₄ + 5Fe₂(SO₄)₃ + 122MnSO₄ + 60HNO₃ + 60CO₂ + 188H₂O
Common uses
- Chemistry homework: balancing molecular, ionic and redox equations, with the method shown.
- Checking coefficients you balanced by hand — the page tells you whether yours already balance.
- Preparing stoichiometry: the balanced coefficients are the mole ratios — Calculate amounts opens the equation in the stoichiometry calculator.
- Writing up reactions in LaTeX with the mhchem package.
How the balancing works
Give each substance an unknown coefficient — for x₁ Fe + x₂ O₂ → x₃ Fe₂O₃ — and write one equation per element saying it is conserved: iron x₁ − 2x₃ = 0, oxygen 2x₂ − 3x₃ = 0. Ions add one more equation for charge. These are a homogeneous linear system A·x = 0, where A is the composition matrix (reactants counted positive, products negative) — the formula-matrix method of Smith and Missen.
The balancer reduces A to reduced row echelon form with exact fractions and reads off its null space, as L. R. Thorne describes (Chem. Educator 15, 304, 2010): here x₃ is free, and x₃ = 1 gives x = (2, 3/2, 1). Multiplying by the lowest common denominator, 2, gives the smallest whole numbers (4, 3, 2). Because no decimals are ever rounded, even large equations come out exact.
When an equation cannot be balanced, or balances many ways
- No solution: if the null space is empty, only zero coefficients satisfy every element — usually a reactant or product is missing (often H₂O, O₂, H⁺ or OH⁻) or a formula is wrong. The page names elements that appear on one side only, and says when the atoms could balance but the charge cannot (add electrons for a half-reaction).
- One solution: the usual case; if a substance can only balance on the other side of the arrow it is moved there, and one that cannot take part (coefficient 0) is left out — both with a warning.
- Several solutions: an equation such as H₂ + O₂ → H₂O + H₂O₂ mixes independent reactions (2H₂ + O₂ → 2H₂O and H₂ + O₂ → H₂O₂). Any positive mix balances; the page shows the one with the smallest whole numbers that uses every substance, lists the independent reactions, and confirms your own coefficients if they balance.
Redox reactions and half-reactions
The balancer balances the substances you list, so include what the reaction medium supplies: in acidic solution add H⁺ and H₂O, in basic solution OH⁻ and H₂O. For a half-reaction, add e- on the side that gains electrons; the charge row then fixes their number, as in Cr₂O₇²⁻ + 14H⁺ + 6e⁻ → 2Cr³⁺ + 7H₂O.
How to type equations
- Arrows:
=,->,→,⟶(also–>or—>as word processors write-->), and<=>or⇌for equilibria (shown as ⇌). - Separate substances with
+; spaces around it are best:Fe3+ + e- = Fe2+. - Charges at the end of a formula:
SO4^2-,SO4{2-},SO4²⁻,NH4+,Fe3+,Fe+++. - Electrons:
e-,e^-ore⁻. - States are kept:
H2O(l),NaCl(aq),CO2(g),AgCl(s). - Conditions written as terms, such as
+ heat,+ lightor+ energy, are left out of the balancing (with a note). - Oxidation states in Roman numerals are read and left out:
Fe(III)Cl3is FeCl₃. - Brackets, hydrates (
CuSO4·5H2O), isotopes (D2O,^13C) and common names (water,carbon dioxide) work as in the molar mass calculator. A leading number is a coefficient:13CO2means 13 CO₂, so write carbon-13 as^13CO2.
Sources
- L. R. Thorne, “An innovative approach to balancing chemical-reaction equations: a simplified matrix-inversion technique for determining the matrix null space”, Chem. Educator 15, 304–308 (2010), arXiv:1110.4321.
- W. R. Smith and R. W. Missen, Chemical Reaction Equilibrium Analysis: Theory and Algorithms (Wiley, 1982) — the formula-matrix description of reactions.
- OpenStax, Chemistry 2e (CC BY 4.0), §4.1 Writing and Balancing Chemical Equations and §4.3 Reaction Stoichiometry.
- IUPAC CIAAW, Standard Atomic Weights 2024 (for the mass check).
Limitations
- Balancing is purely algebraic: it does not know whether a reaction really happens, which products form or what the reaction conditions are.
- Organic abbreviations (Me, Et, Ph) are not expanded — write the full formulas.
- For equations that combine several independent reactions, the coefficients shown are one valid choice among many; the real proportions depend on the chemistry.
- Up to 600 characters per equation.
Privacy
Everything happens in your browser. What you enter or open here is not uploaded or stored by MySmartCoPilot.
Frequently asked questions
How do I balance a chemical equation?
Find coefficients so that every element has the same number of atoms on both sides (and, for ions, the same total charge). This page does it exactly by linear algebra: Fe + O₂ → Fe₂O₃ becomes 4Fe + 3O₂ → 2Fe₂O₃, with 4 Fe and 6 O on each side.
Can it balance redox and ionic equations?
Yes. Write charges such as MnO4- or Fe3+, include H⁺/OH⁻ and H₂O as the medium requires, and add e- for half-reactions. The charge is balanced as an extra equation: MnO₄⁻ + 5Fe²⁺ + 8H⁺ → Mn²⁺ + 5Fe³⁺ + 4H₂O has +17 on each side.
Why does it say my equation cannot be balanced?
Because no set of positive coefficients makes every element match: a substance is missing or a formula is wrong. Na + Cl₂ → KCl fails because sodium appears only on the left and potassium only on the right; H₂O → H₂O₂ fails because the hydrogen-to-oxygen ratio differs and nothing else can make up for it.
Why does it say there are several solutions?
The substances can form more than one independent reaction, so infinitely many coefficient sets balance. H₂ + O₂ → H₂O + H₂O₂ works as 3H₂ + 2O₂ → 2H₂O + H₂O₂ (shown), but also as 5H₂ + 3O₂ → 4H₂O + H₂O₂ and so on. Type your own coefficients to check them.
Does it keep the coefficients I typed?
It checks them first: you are told whether they balanced, and if they were not the smallest whole numbers (such as 4H₂ + 2O₂ → 4H₂O or H₂ + ½O₂ → H₂O). The answer always uses the smallest whole numbers, except for equations with several solutions, where balanced coefficients you typed are kept.
How do I write the balanced equation in LaTeX?
Use Copy LaTeX: it gives mhchem syntax such as \ce{2H2 + O2 -> 2H2O}, which renders with \usepackage[version=4]{mhchem}.