Chemical equation balancer
Enter the formulas on both sides of a reaction. The calculator returns the smallest positive whole-number coefficients and shows the atom count for every element.
Current scope: the calculator accepts neutral chemical formulas only. It does not balance ionic charges or electron half-reactions. Do not use it for redox equations written with ions and electrons.
Free chemistry calculator
Balance a chemical equation
Enter the reactants and products. The calculator finds the smallest positive whole-number coefficients and checks each element.
Balanced equation
2H2 + O2 → 2H2O
Coefficients by substance
- 2
H2Reactant - 1
O2Reactant - 2
H2OProduct
Element conservation check
| Element | Reactant atoms | Product atoms | Conserved |
|---|---|---|---|
| H | 4 | 4 | Yes |
| O | 2 | 2 | Yes |
How the equation was balanced
- Counted H, O across 3 substances.
- Solved the element-conservation equations with exact rational arithmetic, so no coefficient depends on floating-point rounding.
- Reduced the solution to the smallest positive whole-number ratio: 2 : 1 : 2.
Quick input guide
| Input part | What to enter | Example |
|---|---|---|
| Reactants and products | Chemical formulas separated by + | H2 + O2 |
| Reaction arrow | ->, =, =>, <=>, <->, →, ↔, or ⇌ | H2 + O2 -> H2O |
| Existing coefficients | Optional positive integers | 2H2 + O2 -> 2H2O |
| Physical states | Optional (s), (l), (g), or (aq) | H2(g) + O2(g) -> H2O(l) |
The tool accepts grouped formulas such as Ca(OH)2 and Al2(SO4)3. If you need the mass of one formula rather than a reaction ratio, use the molar mass calculator.
What balancing changes
Balancing changes the coefficient in front of a formula. It never changes a subscript inside the formula.
- A coefficient multiplies the entire formula.
2H2Ocontains 4 H atoms and 2 O atoms. - A subscript belongs to the compound. Changing
H2OtoH2O2changes water into hydrogen peroxide. - The final coefficients form a ratio.
4 : 2 : 4is balanced, but2 : 1 : 2is the smallest equivalent whole-number ratio.
This distinction matters in stoichiometry. The coefficients give mole ratios between substances, while subscripts describe the composition of each substance.
Worked example 1: forming water
Start with:
H2 + O2 -> H2O
One oxygen molecule has 2 O atoms, so place 2 before water. That produces 4 H atoms on the product side, which requires 2 hydrogen molecules.
2H2 + O2 -> 2H2O
| Element | Reactant atoms | Product atoms |
|---|---|---|
| H | 2 × 2 = 4 | 2 × 2 = 4 |
| O | 1 × 2 = 2 | 2 × 1 = 2 |
The smallest coefficient ratio is 2 : 1 : 2.
Worked example 2: aluminum and sulfuric acid
Consider a formula with parentheses:
Al + H2SO4 -> Al2(SO4)3 + H2
The product contains three sulfate groups, so use 3 before H2SO4. That gives 6 H atoms and therefore 3 molecules of H2. The product also contains 2 Al atoms.
2Al + 3H2SO4 -> Al2(SO4)3 + 3H2
The totals on each side are Al = 2, H = 6, S = 3, and O = 12. The parentheses do not create a new element. They multiply the atoms inside the group.
How the calculator finds the coefficients
The calculator builds one conservation equation per element. Reactant counts have a positive sign and product counts have a negative sign. It solves the resulting homogeneous system with exact rational arithmetic, then converts the solution to positive integers and divides out their greatest common divisor.
Exact arithmetic avoids a subtle failure mode in equation balancers. A floating-point solver can return values close to a ratio, such as 1.9999999998, and rounding can break conservation. This calculator keeps the ratio exact before it displays the result.
Common balancing mistakes
- Do not edit subscripts to make atom counts match. Add coefficients in front of formulas.
- Multiply every atom inside parentheses. In
Al2(SO4)3, the formula contains 3 S atoms and 12 O atoms. - Reduce all coefficients by their common divisor.
4H2 + 2O2 -> 4H2Oshould be written as2H2 + O2 -> 2H2O. - Check that every element appears on both sides. A missing element usually means a formula or product is incomplete.
- Remove duplicate terms and spectator species before solving. The same neutral formula on both sides can make the intended reaction ambiguous.
- Do not enter ionic charge signs or electrons. This version checks atoms, not net charge.
For concentration work after you have a balanced reaction, open the dilution calculator. The chemistry tools hub lists the current calculators and their limits.
FAQ
How do I balance a chemical equation?
Count each element on both sides, add coefficients before formulas, and adjust the coefficients until every element has the same atom total. Finally, divide all coefficients by their greatest common divisor.
Can this calculator handle parentheses in chemical formulas?
Yes. It parses grouped formulas such as Ca(OH)2 and Al2(SO4)3 and applies the number after a closing parenthesis to every atom in that group.
Can I change a subscript when balancing an equation?
No. Changing a subscript changes the substance. Only change coefficients placed before complete formulas.
Does the calculator balance ionic and redox equations?
No. The current version supports neutral formulas and conserves atoms. It does not parse ionic charges or electrons, so it cannot verify charge balance in ionic or electron half-reactions.
Why does the result use the smallest whole-number coefficients?
Multiplying every coefficient by the same integer produces an equivalent ratio. Chemical equations conventionally use the smallest positive whole-number ratio, so the calculator divides out the common factor.