LabCanvas
Free account · save your work, full figure editorSign up free

Chemical equation balancer

Type an unbalanced equation such as Fe + O2 -> Fe2O3 and the balancer returns the smallest whole-number coefficients, here 4Fe + 3O₂ → 2Fe₂O₃, with a table showing that every element (and the charge) is the same on both sides. It handles brackets, hydrates (CuSO4·5H2O), ions (Fe3+, SO4^2-) and electrons (e-) for redox half-equations, solves the balance exactly with fractions rather than trial and error, and tells you when an equation cannot be balanced or has no unique balance. The result is typeset with mhchem and can be copied as text or LaTeX \ce{…}, or downloaded as PNG or SVG.

What it does
Balances a chemical equation, including ions, electrons and hydrates, with the smallest whole-number coefficients and checks every element and the charge.
Formula
Find the nullspace of the element (and charge) matrix A: A·ν = 0, reactant columns +, product columns −, solved exactly with fractions and scaled to coprime integers.
Example
KMnO4 + HCl = KCl + MnCl2 + H2O + Cl2 balances to 2KMnO₄ + 16HCl → 2KCl + 2MnCl₂ + 8H₂O + 5Cl₂ (K 2 = 2, Mn 2 = 2, O 8 = 8, H 16 = 16, Cl 16 = 16).

Last updated

FreeNo sign-upRuns in your browserLab calculators

Loading Chemical equation balancer…

At a glance

Chemical equation balancer at a glance
InputAn equation with formulas, brackets, hydrates, charges and electrons
MethodNullspace of the element/charge matrix, exact fractions (Gauss–Jordan)
OutputSmallest whole-number coefficients, atom and charge check, mass balance
ReportsNo balance, no unique balance, zero or wrong-side species
ExportUnicode text, ASCII, LaTeX \ce{}, PNG (600 dpi) and SVG
Runs inYour web browser; nothing is uploaded
PriceFree, no account needed

What it does

How to use the chemical equation balancer

  1. Type the equationWrite reactants, an arrow (->, → or =) and products, separated by +. Coefficients you type are ignored.
  2. Check the readingThe typeset equation shows how each formula and charge was read; write charges with ^ (SO4^2-) if a reading is not what you meant.
  3. Copy or downloadCopy the balanced equation as text or LaTeX, or download it as PNG or SVG; the table below confirms every element and the charge balance.

How it works

Balancing an equation means finding positive whole numbers νj so that every element, and the total charge, is the same on both sides. Write one row per element (and one for charge) and one column per species, with the atom counts of reactants positive and of products negative. The coefficients are then a vector in the nullspace of this matrix:

A⋅ν=0,with νj>0 whole numbers

The tool reduces A to reduced row echelon form by Gauss–Jordan elimination using exact fractions (arbitrary-precision integers), the matrix method described by Blakley (1982). If the nullspace has dimension 1, its basis vector, multiplied by the least common multiple of the denominators and divided by the greatest common divisor, gives the smallest whole-number coefficients. If its dimension is 0, no balance exists (usually an element appears on one side only, or a formula is wrong). If it is 2 or more, the equation combines independent reactions and has infinitely many balances (for example HA2+OA2⟶HA2O+HA2OA2); the tool says so rather than picking one. A zero coefficient means that species cannot take part, and a negative one that it belongs on the other side.

By hand for Fe+OA2⟶FeA2OA3: Fe: a=2c; O: 2b=3c. Take c=2: a=4, b=3, so 4Fe+3OA2⟶2FeA2OA3. Redox reactions need the charge row too: for MnOA4A−+FeA2++HA+ ⟶MnA2++FeA3++HA2O the charge balance −1+2b+c=2+3b forces b=5.

Reading formulas. Element symbols are case-sensitive. A charge goes at the end: Fe3+ and Fe^3+ both mean FeA3+. For a polyatomic ion, a single trailing digit is a subscript (NH4+ is NHA4A+, MnO4- is MnOA4A−), and when two or more digits come before the sign the last is the charge (SO42- is SOA4A2−); writing ^ (SO4^2-) is never ambiguous. The equation is typeset with the mhchem package for MathJax.

Sources: Blakley GR. Chemical equation balancing: a general method which is quick, simple, and has unexpected applications. J Chem Educ 1982;59:728–734. Atomic weights: Prohaska T et al. Standard atomic weights of the elements 2021 (IUPAC Technical Report). Pure Appl Chem 2022;94:573–600, doi:10.1515/pac-2019-0603.

Worked example: KMnO₄ + HCl, and more balanced equations

Potassium permanganate and hydrochloric acid. Type KMnO4 + HCl = KCl + MnCl2 + H2O + Cl2. The element matrix has five rows (K, Mn, O, H, Cl) and six columns, so its nullspace has dimension 1, and the balancer returns

2KMnOA4+16HCl⟶2KCl+2MnClA2+8HA2O+5ClA2

Atom check
ElementReactantsProducts
K22
Mn22
O88
H1616
Cl1616

Mass balance per mole of reaction:

reactants: 2×158.032+16×36.458=899.393 gproducts: 2×74.548+2×125.838+8×18.015+5×70.900=899.393 g

Other results from the tool

Equations and their balances
You typeBalanced
Fe + O2 -> Fe2O34Fe+3OA2⟶2FeA2OA3
C3H8 + O2 -> CO2 + H2OCA3HA8+5OA2⟶3COA2+4HA2O
Cu + HNO3 -> Cu(NO3)2 + NO + H2O3Cu+8HNOA3⟶3Cu(NOA3)A2+2NO+4HA2O
MnO4- + Fe2+ + H+ -> Mn2+ + Fe3+ + H2OMnOA4A−+5FeA2++8HA+⟶MnA2++5FeA3++4HA2O
Cr2O7^2- + H+ + e- -> Cr3+ + H2OCrA2OA7A2−+14HA++6eA−⟶2CrA3++7HA2O
CuSO4·5H2O -> CuSO4 + H2OCuSOA4⋅5HA2O⟶CuSOA4+5HA2O
Ca3(PO4)2 + H2SO4 -> CaSO4 + H3PO4CaA3(POA4)A2+3HA2SOA4⟶3CaSOA4+2HA3POA4
K4[Fe(CN)6] + KMnO4 + H2SO4 = KHSO4 + Fe2(SO4)3 + MnSO4 + HNO3 + CO2 + H2O10KA4[Fe(CN)A6]+122KMnOA4+299HA2SOA4⟶162KHSOA4+5FeA2(SOA4)A3+122MnSOA4+60HNOA3+60COA2+188HA2O
H2 + O2 -> H2O + H2O2No unique balance (two independent reactions)

The LaTeX for the first example is \ce{2 KMnO4 + 16 HCl -> 2 KCl + 2 MnCl2 + 8 H2O + 5 Cl2}; paste it into the LaTeX tool to change its colour or size.

Frequently asked questions

How do I balance a chemical equation?

Count each element on both sides and choose coefficients so the counts match, starting with the element that appears in the fewest species and leaving H and O (or a free element such as OA2) until last. The balancer does this exactly: it writes one equation per element and solves them all at once.

How do I balance a redox equation with electrons?

Type the ions with their charges and add e- for electrons, for example Cr2O7^2- + H+ + e- -> Cr3+ + H2O. Charge is balanced as an extra row alongside the elements, which gives CrA2OA7A2−+14HA++6eA−⟶2CrA3++7HA2O. For a full ionic redox equation, include HA+ and HA2O (acidic) or OHA− and HA2O (basic).

How do I type charges such as Fe3+ or SO4 2-?

Put the charge at the end: Fe3+ or Fe^3+, SO4^2-, MnO4-, NH4+. A charge after a space (SO4 2-) also works. The ^ form is never ambiguous; without it, a single trailing digit of a polyatomic ion is read as a subscript.

Why does it say there is no unique balance?

Some equations combine two or more independent reactions, so infinitely many coefficient sets balance them; HA2+OA2⟶HA2O+HA2OA2 is the classic case. Chemistry decides the ratio, not arithmetic, so split it into separate reactions.

Why can my equation not be balanced?

Usually a formula is wrong or an element appears on one side only (a missing product such as HA2O or a gas). The tool names the element, or tells you which species would need a coefficient of 0 or would have to move to the other side.

How do I write a hydrate such as copper sulfate pentahydrate?

Use a middle dot, an asterisk or a full stop before the water: CuSO4·5H2O, CuSO4*5H2O or CuSO4.5H2O.

Can I get the balanced equation in LaTeX?

Yes. Copy LaTeX \ce{} gives mhchem code such as \ce{4 Fe + 3 O2 -> 2 Fe2O3}, which works in LaTeX with \usepackage[version=4]{mhchem} and in MathJax. You can also download the typeset equation as SVG or a 600 dpi PNG.

Are the coefficients I type used?

No. Any leading numbers are ignored and the balancer finds the smallest whole-number coefficients itself.

Draw the reaction

Sketch the structures of reactants and products in the LabCanvas chemistry editor and put the balanced equation beside them in a figure.

Open the structure editor