# Chemical equation balancer

> Balance chemical equations exactly, including ions, electrons, redox half-equations and hydrates. Atom check table, LaTeX \ce{} and PNG/SVG. Free.

URL: https://www.labcanvas.com/tools/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.

## Quick answer

- **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).

Free, in the browser, no account needed. Updated 2026-10-19.

## Features

- Exact balancing: the element/charge matrix is solved with whole-number fractions (BigInt), so large equations never round
- Ions and electrons: Fe3+, Fe^3+, SO4^2-, MnO4-, e- for redox and half-equations; charge is balanced as an extra row
- Brackets ( ) [ ] { }, hydrates and adducts (CuSO4·5H2O, CuSO4*5H2O), states (aq), (s), (l), (g)
- Tells you when an equation cannot be balanced, which species would get a coefficient of 0 or belong on the other side, and when there is no unique balance
- Atom and charge check table, plus molar masses and the mass balance (CIAAW 2021 atomic weights)
- Typeset with MathJax mhchem; copy as Unicode text, plain ASCII or LaTeX \ce{…}; download PNG (600 dpi) or SVG

## How to use it

1. **Type the equation**: Write reactants, an arrow (->, → or =) and products, separated by +. Coefficients you type are ignored.
2. **Check the reading**: The 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 download**: Copy the balanced equation as text or LaTeX, or download it as PNG or SVG; the table below confirms every element and the charge balance.

## At a glance

| | |
| --- | --- |
| Input | An equation with formulas, brackets, hydrates, charges and electrons |
| Method | Nullspace of the element/charge matrix, exact fractions (Gauss–Jordan) |
| Output | Smallest whole-number coefficients, atom and charge check, mass balance |
| Reports | No balance, no unique balance, zero or wrong-side species |
| Export | Unicode text, ASCII, LaTeX \ce{}, PNG (600 dpi) and SVG |

## How it works

Balancing an equation means finding positive whole numbers \(\nu_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 \cdot \nu = 0, \quad \text{with } \nu_j \gt 0 \text{ 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 \(\ce{H2 + O2 -> H2O + H2O2}\)); 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 \(\ce{Fe + O2 -> Fe2O3}\): Fe: \(a = 2c\); O: \(2b = 3c\). Take \(c = 2\): \(a = 4\), \(b = 3\), so \(\ce{4Fe + 3O2 -> 2Fe2O3}\). Redox reactions need the charge row too: for \(\ce{MnO4^- + Fe^2+ + H+}\) \(\ce{-> Mn^2+ + Fe^3+ + H2O}\) 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 \(\ce{Fe^3+}\). For a polyatomic ion, a single trailing digit is a subscript (NH4+ is \(\ce{NH4+}\), MnO4- is \(\ce{MnO4-}\)), and when two or more digits come before the sign the last is the charge (SO42- is \(\ce{SO4^2-}\)); 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](https://doi.org/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

$$\begin{aligned} &\ce{2KMnO4 + 16HCl -> 2KCl} \\ &\quad \ce{{} + 2MnCl2 + 8H2O + 5Cl2} \end{aligned}$$

| Element | Reactants | Products |
| --- | --- | --- |
| K | 2 | 2 |
| Mn | 2 | 2 |
| O | 8 | 8 |
| H | 16 | 16 |
| Cl | 16 | 16 |

Mass balance per mole of reaction:

$$\begin{aligned} \text{reactants: } &2 \times 158.032 + 16 \times 36.458 \\ &= 899.393\ \mathrm{g} \\ \text{products: } &2 \times 74.548 + 2 \times 125.838 \\ &+ 8 \times 18.015 + 5 \times 70.900 \\ &= 899.393\ \mathrm{g} \end{aligned}$$

**Other results from the tool**

| You type | Balanced |
| --- | --- |
| Fe + O2 -> Fe2O3 | \(\ce{4Fe + 3O2 -> 2Fe2O3}\) |
| C3H8 + O2 -> CO2 + H2O | \(\ce{C3H8 + 5O2 -> 3CO2 + 4H2O}\) |
| Cu + HNO3 -> Cu(NO3)2 + NO + H2O | \(\ce{3Cu + 8HNO3 -> 3Cu(NO3)2 + 2NO + 4H2O}\) |
| MnO4- + Fe2+ + H+ -> Mn2+ + Fe3+ + H2O | \(\ce{MnO4^- + 5Fe^2+ + 8H+ -> Mn^2+ + 5Fe^3+ + 4H2O}\) |
| Cr2O7^2- + H+ + e- -> Cr3+ + H2O | \(\ce{Cr2O7^2- + 14H+ + 6e- -> 2Cr^3+ + 7H2O}\) |
| CuSO4·5H2O -> CuSO4 + H2O | \(\ce{CuSO4*5H2O -> CuSO4 + 5H2O}\) |
| Ca3(PO4)2 + H2SO4 -> CaSO4 + H3PO4 | \(\ce{Ca3(PO4)2 + 3H2SO4 -> 3CaSO4 + 2H3PO4}\) |
| K4[Fe(CN)6] + KMnO4 + H2SO4 = KHSO4 + Fe2(SO4)3 + MnSO4 + HNO3 + CO2 + H2O | \(\ce{10K4[Fe(CN)6] + 122KMnO4 + 299H2SO4 -> 162KHSO4 + 5Fe2(SO4)3 + 122MnSO4 + 60HNO3 + 60CO2 + 188H2O}\) |
| H2 + O2 -> H2O + H2O2 | No 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.

## 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 \(\ce{O2}\)) 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 \(\ce{Cr2O7^2- + 14H+ + 6e- -> 2Cr^3+ + 7H2O}\). For a full ionic redox equation, include \(\ce{H+}\) and \(\ce{H2O}\) (acidic) or \(\ce{OH-}\) and \(\ce{H2O}\) (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; \(\ce{H2 + O2 -> H2O + H2O2}\) 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 \(\ce{H2O}\) 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.
