Chemical Equation Balancer

Balance a chemical reaction and get its smallest whole-number coefficients.

Supports bracketed groups, user coefficients, and unicode subscripts.

Updated October 1, 2026
Frank Zhao - Creator
CreatorFrank Zhao

Loading calculator…

Introduction

A chemical equation is only meaningful once the same number of atoms of every element appears on both sides — otherwise you have written a reaction that destroys or invents matter. This balancer takes the two halves of a reaction and returns the smallest whole-number coefficients that make every element balance.

It is built for students checking a homework answer, teachers preparing worked examples, and anyone who needs a trustworthy coefficient set without doing the algebra by hand. Every coefficient it reports is an exact integer: the solver works in rational arithmetic rather than floating point, so a difficult equation such as the permanganate reaction comes out with the same digits every time.

The atom-count row printed under the result is not decoration. It lets you confirm the answer yourself in one glance instead of trusting the tool.

Quick Start Guide

1

Type the reactants

Put what you start with into Left-hand side, joining each substance with +. Hydrogen burning in oxygen starts as H2 + O2.

2

Type the products

Enter what forms into Right-hand side, again separated by +. For the same reaction that is simply H2O.

3

Read the balanced equation

The result fills in with the smallest whole-number coefficients, and the atom-count row underneath lets you confirm every element matches.

A worked example

Starting from the unbalanced reaction, the whole balance resolves in one step:

H2+O2\mathrm{H_2} + \mathrm{O_2}→\rightarrowH2O\mathrm{H_2O}→\rightarrow2 H2+O2=2 H2O2\,\mathrm{H_2} + \mathrm{O_2} = 2\,\mathrm{H_2O}

The atom-count row reads H: 4, O: 2: four hydrogen atoms and two oxygen atoms on each side, so nothing was created or destroyed.

What the coefficients mean

The numbers in front of each formula are a ratio, not amounts. Here the equation says hydrogen and oxygen always combine in the mole ratio 2:1:22:1:2. To turn that ratio into grams, convert each coefficient to moles with the mole calculator, then look up each substance with the molar mass calculator.

How the Balancer Works

Balancing is a linear-algebra problem, not an arithmetic one. The solver counts the atoms in every formula, then searches for the combination of coefficients that leaves every element untouched.

Step 1 — Count atoms into a matrix

Every element becomes a row and every species becomes a column. Reactants count positive, products count negative:

aij=± νi(j)a_{ij} = \pm\,\nu_i^{(j)}

where νi(j)\nu_i^{(j)} is the number of atoms of element ii inside species jj. Bracketed groups such as Fe(OH)₃ are expanded first, so the iron row counts three oxygen atoms and three hydrogen atoms per formula unit.

Step 2 — Solve the homogeneous system

The coefficients must satisfy the matrix equation with a zero right-hand side. Any non-zero vector in the solution space is a valid answer:

A x\mathbf{A}\,\mathbf{x}==0\mathbf{0},x∈ker⁡(A), x≠0, \qquad \mathbf{x} \in \ker(\mathbf{A}),\ \mathbf{x} \neq \mathbf{0}

Step 3 — Reduce to smallest integers

The solution space is closed under scaling, so the solver can return fractions such as 12\tfrac{1}{2} or 32\tfrac{3}{2}. It multiplies through by the least common multiple of the denominators, then divides by the greatest common divisor, leaving the smallest whole-number ratio:

xint=x⋅lcm  /  gcd⁡ ⁣(xint)\mathbf{x}_{\mathrm{int}} = \mathbf{x} \cdot \mathrm{lcm} \;\big/\; \gcd\!\left(\mathbf{x}_{\mathrm{int}}\right)

A coefficient of exactly 1 is left unwritten, which is why Fe + CuSO₄ = FeSO₄ + Cu needs no numbers at all. Every arithmetic step is exact, so no coefficient is ever a rounded approximation.

Worked Examples

Combustion of methane

Gas stoves burn methane completely. Left side CH4 + O2, right side CO2 + H2O:

CH4+2 O2=CO2+2 H2O\mathrm{CH_4} + 2\,\mathrm{O_2} = \mathrm{CO_2} + 2\,\mathrm{H_2O}

Atom counts read C: 1, H: 4, O: 4. Because the coefficients are also the mole ratio, an engine running on methane needs roughly 17.4 volumes of air per volume of fuel — the air-fuel ratio calculator turns that ratio into a mass figure.

Precipitation of barium sulfate

Mixing barium chloride with sodium sulfate drops an insoluble solid. Left side BaCl2 + Na2SO4, right side BaSO4 + NaCl:

BaCl2+Na2SO4=BaSO4+2 NaCl\mathrm{BaCl_2} + \mathrm{Na_2SO_4} = \mathrm{BaSO_4} + 2\,\mathrm{NaCl}

Worth pausing on: the coefficient lands on NaCl, the formula that looked simplest. Both chlorides must match their cations — two Na and one Ba mean one sulfate but two chloride pairs. Atom counts read Ba: 1, Cl: 2, Na: 2, S: 1, O: 4.

Redox with bracketed groups

Permanganate oxidising hydrochloric acid releases chlorine gas. Left side KMnO4 + HCl, right side KCl + MnCl2 + H2O + Cl2:

2 KMnO4+16 HCl=2 KCl+2 MnCl2+8 H2O+5 Cl22\,\mathrm{KMnO_4} + 16\,\mathrm{HCl} = 2\,\mathrm{KCl} + 2\,\mathrm{MnCl_2} + 8\,\mathrm{H_2O} + 5\,\mathrm{Cl_2}

Six species and four elements — out of reach for balancing by inspection, but the solver still returns the textbook coefficients. The atom row reads K: 2, Mn: 2, O: 8, H: 16, Cl: 16, which you can check by hand: two chloride ions give 2, two MnCl₂ give 4, and five Cl₂ molecules give 10, for a total of 16.

Common Mistakes to Avoid

Change coefficients, never subscripts

Writing H2O2 to “fix” an oxygen count does not balance the equation — it renames the substance. Subscripts define which molecule you have; only the coefficient in front says how many of it there are. If the tool reports mismatching elements, the usual cause is a formula you typed from memory rather than the one your course actually specifies.

Capitalisation is part of the symbol

Co is cobalt, while CO is carbon monoxide; HO is not water. Entering h2o or ch4 produces an invalid-element message rather than a wrong answer, which is the safer failure.

A coefficient you typed may be normalised away

Entering 2H2 + O2 against 2H2O returns H2 + O2 = H2O. Your coefficient is absorbed into its species and the answer is reduced to the canonical smallest ratio. This is correct chemistry — 2H2 + O2 = 2H2O and H2 + O2 = H2O describe the same reaction, and only the reduced form is considered a balanced equation.

Species on both sides may disappear

If a substance appears on both sides it can be cancelled. Entering H2 + O2 against H2O + O2 returns 2H2 + O2 = 2H2O, with the trailing O2 dropping out because its balanced coefficient works out to zero.

Frequently Asked Questions

Why are some coefficients missing?

A coefficient of exactly 1 is conventional to omit, so NaOH + HCl = NaCl + H2O carries no numbers at all. The ratio is still 1:1:1:1 — nothing has been lost.

What does “cannot balance on their own” mean?

It means the species you listed admit no non-zero coefficient set. For example H2O2 against H2O has no solution as written, because the extra oxygen has nowhere to go. The real reaction needs O2 on the product side, which gives 2H2O2 = 2H2O + O2. The message usually points at an incomplete equation rather than a problem with the balancer.

Does it balance ionic and half-reaction equations?

No. It counts atoms only and does not track charge or electrons, so equations containing ions need the half-reaction method first: split into oxidation and reduction halves, balance each with electrons, then recombine. Once the electrons cancel, the skeleton that comes out of this tool is the same skeleton you would balance by hand.

Can I use it to check an answer I already have?

Yes, and it is a good habit. Type your coefficients in as leading numbers on both sides. If the equation is balanced the tool returns it unchanged; if it is not, the atom-count row will show which element disagrees.

Limitations

What this tool does not do

Charge and electrons are ignored. Only atoms are counted, so ionic and net-ionic equations need the half-reaction method — split into oxidation and reduction halves, balance each with electrons, then recombine — before they can be balanced here.

Hydrates and charges are not accepted. The middle dot in CuSO4·5H2O and charge notation like SO4^2- fall outside the accepted characters and will be flagged as invalid. Enter the individual species instead.

It needs the actual species. The balancer balances equations you supply. It does not predict what the products will be, and it will not repair a reaction that cannot chemically occur.

One direction only. Balancing is not reversible, so there is no way to work backwards from a product to deduce which reactants produced it.

This is an academic aid for checking stoichiometry. It does not assess whether a reaction actually takes place, what its equilibrium constant is, or whether it is safe to carry out.

Chemical Equation Balancer - Balance Reactions Online