# How do I balance equations?

Balances a chemical equation, including ionic equations with charges, by finding the smallest whole-number coefficients that make every element and the charge match on both sides.

- Page: https://www.acalculator.org/chemistry/chemical-equation-balancer
- JSON spec: https://www.acalculator.org/chemistry/chemical-equation-balancer.json
- Version: 77795ac77570

## Default answer

Example with the default inputs (Chemical equation C2H6 + O2 = CO2 + H2O): The balanced equation is 2C₂H₆ + 7O₂ → 4CO₂ + 6H₂O.

## Inputs

| Key | Label | Description |
| --- | --- | --- |
| eq | Chemical equation | The unbalanced equation: formulas joined by +, with = or → between the reactants and the products. |

## Outputs

| Key | Label | Description |
| --- | --- | --- |
| balanced | Balanced equation | The equation with the smallest whole-number coefficients (a coefficient of 1 is not written). |
| coefficients | Coefficients | The coefficients in the order the formulas are written, left side first. |
| check | Atom count | For each element, and the charge if any, the total on the left and on the right. |

## Method

For each element (and the charge), Σ coefficient × atoms on the left = Σ coefficient × atoms on the right; the coefficients are the smallest positive whole-number solution of these equations, found by exact row reduction.

## Assumptions

- The equation must balance in exactly one way (one free direction), with every coefficient above 0.
- Coefficients typed in front of formulas are ignored; the calculator finds its own.
- Charges count as one more quantity to balance, so ionic and redox equations work. Electrons can be written as e or e^-.
- Formulas follow the same rules as the molar mass calculator: brackets, hydrate dots, subscripts, and phase labels such as (aq), which are shown but not counted.

## Worked examples

1. eq = C2H6 + O2 = CO2 + H2O gives balanced = 2C₂H₆ + 7O₂ → 4CO₂ + 6H₂O, coefficients = 2, 7, 4, 6, check = C: 4 = 4; H: 12 = 12; O: 14 = 14. Source: OpenStax, Chemistry 2e, §4.1 Writing and Balancing Chemical Equations (balance by atom counts), https://openstax.org/books/chemistry-2e/pages/4-1-writing-and-balancing-chemical-equations.
2. eq = N2 + O2 → N2O5 gives balanced = 2N₂ + 5O₂ → 2N₂O₅, coefficients = 2, 5, 2. Source: OpenStax, Chemistry 2e, §4.1, Example 4.1 (2N₂ + 5O₂ ⟶ 2N₂O₅), https://openstax.org/books/chemistry-2e/pages/4-1-writing-and-balancing-chemical-equations.
3. eq = H2O -> H2 + O2 gives balanced = 2H₂O → 2H₂ + O₂, coefficients = 2, 2, 1. Source: OpenStax, Chemistry 2e, §4.1 (the decomposition of water, 2H₂O ⟶ 2H₂ + O₂), https://openstax.org/books/chemistry-2e/pages/4-1-writing-and-balancing-chemical-equations.
4. eq = Ca(OH)2 + H3PO4 = Ca3(PO4)2 + H2O gives balanced = 3Ca(OH)₂ + 2H₃PO₄ → Ca₃(PO₄)₂ + 6H₂O, coefficients = 3, 2, 1, 6.
5. eq = MnO4^- + Fe^2+ + H^+ = Mn^2+ + Fe^3+ + H2O gives balanced = MnO₄⁻ + 5Fe²⁺ + 8H⁺ → Mn²⁺ + 5Fe³⁺ + 4H₂O, coefficients = 1, 5, 8, 1, 5, 4, check = Mn: 1 = 1; O: 4 = 4; Fe: 5 = 5; H: 8 = 8; charge: +17 = +17. Source: OpenStax, Chemistry 2e, §17.1 Review of Redox Chemistry (balancing redox equations by half-reactions), https://openstax.org/books/chemistry-2e/pages/17-1-review-of-redox-chemistry.
6. eq = KMnO4 + HCl = KCl + MnCl2 + H2O + Cl2 gives balanced = 2KMnO₄ + 16HCl → 2KCl + 2MnCl₂ + 8H₂O + 5Cl₂, coefficients = 2, 16, 2, 2, 8, 5.

## FAQ

### How do I balance a chemical equation?

Put a number (a coefficient) in front of each formula so that every element has the same number of atoms on both sides. For ethane burning, C2H6 + O2 → CO2 + H2O, the smallest whole numbers are 2C2H6 + 7O2 → 4CO2 + 6H2O: 4 carbon, 12 hydrogen and 14 oxygen atoms on each side.

### How does the balancer find the coefficients?

Each element gives one equation: coefficient × atoms added up on the left = the same on the right. The balancer solves these equations exactly by row reduction and scales the answer to the smallest whole numbers. It does not guess, so the answer is always checked.

### Can it balance ionic and redox equations?

Yes. Write charges with a caret, such as Fe^2+, MnO4^- or H^+. The total charge then has to match too: MnO4^- + Fe^2+ + H^+ = Mn^2+ + Fe^3+ + H2O balances to MnO4⁻ + 5Fe²⁺ + 8H⁺ → Mn²⁺ + 5Fe³⁺ + 4H₂O, with a charge of +17 on each side.

### How do I type the equation?

Join formulas with +, and put =, →, -> or ⇌ between the two sides. Element symbols start with a capital letter. Brackets like Ca(OH)2, hydrates like CuSO4·5H2O (or CuSO4*5H2O), and phase labels like (aq) or (g) are fine. Numbers you type in front of formulas are ignored.

### Why does it say the equation cannot be balanced?

Usually a formula is wrong, or an element is only on one side, as in H2 + O2 = H2O2 + N2. If no whole numbers make the atoms match, check the formulas and which side each one is on.

### Why does it say there is more than one way to balance it?

The equation combines reactions that can run in any mix, so many sets of coefficients work, for example H2 + O2 + N2 = H2O + NH3. Balance each reaction on its own, such as 2H2 + O2 → 2H2O and N2 + 3H2 → 2NH3.

## Sources

- OpenStax, Chemistry 2e, §4.1 Writing and Balancing Chemical Equations (Example 4.1, 2N₂ + 5O₂ ⟶ 2N₂O₅; 2C₂H₆ + 7O₂ ⟶ 6H₂O + 4CO₂). https://openstax.org/books/chemistry-2e/pages/4-1-writing-and-balancing-chemical-equations
- OpenStax, Chemistry 2e, §17.1 Review of Redox Chemistry (balancing redox equations, charge and atoms). https://openstax.org/books/chemistry-2e/pages/17-1-review-of-redox-chemistry
- Blakley, G. R. (1982). Chemical equation balancing: A general method which is quick, simple, and has unexpected applications. Journal of Chemical Education 59(9), 728. https://doi.org/10.1021/ed059p728
