Balance Your Equation
Use = or -> as the separator. Examples: H2+O2=H2O or Fe2O3+Al=Fe+Al2O3 or Ca(NO3)2=CaO+NO2+O2
Balanced Equation
Conservation of Mass Check
Element Reactants Products Match
Key Terms Explained
Stoichiometry
The branch of chemistry that calculates the quantitative relationships between reactants and products in a chemical reaction based on the balanced equation.
Reactant
A substance that enters into and is altered in the course of a chemical reaction. Reactants appear on the left side of the equation arrow.
Product
A substance formed as a result of a chemical reaction. Products appear on the right side of the equation arrow.
Coefficient
The whole number placed in front of a chemical formula in a balanced equation. It indicates how many molecules (or moles) of that substance are involved. Only coefficients may be changed when balancing.
Subscript
The small number written below and after an element symbol in a formula (e.g., the 2 in H2O). Subscripts define the exact ratio of atoms in a molecule and must never be changed to balance an equation.
Conservation of Mass
The principle that the total mass of reactants equals the total mass of products in a closed system. No atoms are created or destroyed, only rearranged. This is why equations must be balanced.
Polyatomic Ion
A charged group of two or more atoms bonded together that acts as a single unit in reactions. Examples include sulfate (SO42-), nitrate (NO3-), and ammonium (NH4+).
Yield
In a chemical equation, yield (shown by the arrow) indicates the direction of the reaction. In stoichiometry, percent yield compares actual product obtained to the theoretical maximum.
Combustion
A rapid chemical reaction between a fuel and oxygen that produces heat, light, and typically carbon dioxide and water. The combustion of methane (CH4) is a classic balancing exercise.
Mole
The SI unit for amount of substance. One mole equals 6.022 x 1023 particles (Avogadro's number). Coefficients in balanced equations represent mole ratios, not just individual molecule counts.
Common Polyatomic Ions Reference Guide

When balancing equations containing polyatomic ions, knowing their formulas and charges saves time. This cheat sheet covers the most common ions in high school chemistry.

Ion Name Formula Charge Common Example
Sulfate SO4 2- CaSO4 (gypsum), H2SO4 (sulfuric acid)
Nitrate NO3 1- Ca(NO3)2 (fertilizer), HNO3 (nitric acid)
Carbonate CO3 2- CaCO3 (limestone), Na2CO3 (soda ash)
Hydroxide OH 1- NaOH (lye), Ca(OH)2 (slaked lime)
Phosphate PO4 3- Ca3(PO4)2 (bone mineral), H3PO4 (phosphoric acid)
Ammonium NH4 1+ (NH4)2SO4 (fertilizer), NH4Cl (ammonium chloride)

The Complete Guide to Balancing Chemical Equations

Whether you are working through AP Chemistry homework or just trying to understand how atoms rearrange during a reaction, balancing equations is one of the most fundamental skills in chemistry. This guide explains why it matters, how this tool does it correctly using matrix algebra, and what to watch out for when working with complex molecules.

How to Use This Balancer

Type your unbalanced equation directly into the input field. Use a plus sign (+) between molecules on each side, and either an equals sign (=) or an arrow (->) to separate reactants from products. Write element symbols with correct capitalization: a capital letter starts a new element, so Co is cobalt while CO is carbon monoxide. Use parentheses for polyatomic groups with multipliers, like Ca(NO3)2. The tool updates in real time as you type. No buttons to press.

Select one of the preset reactions from the dropdown to see an example instantly. The balanced equation is displayed with coefficients highlighted in cyan, reactant molecules in orange, and product molecules in green. The Conservation of Mass Check table below it proves every atom balances out.

Why Trial and Error Fails for Complex Equations

Simple equations like H2 + O2 = H2O can be balanced by inspection in seconds. But equations with five or six molecules and four or five elements can take dozens of failed attempts by hand. Worse, a naive while-loop approach written in code can spin indefinitely on equations that have no solution, hanging the browser entirely. This tool avoids that problem completely by treating balancing as a system of linear equations and solving it algebraically.

The Algebraic Matrix Method (How This Tool Works)

Each molecule in the equation is assigned a coefficient variable: a, b, c, and so on. For every element that appears, the tool writes one conservation equation: atoms of that element in reactants (with their coefficients) must equal atoms of that element in products. This produces a matrix of coefficients. The tool then applies Gaussian elimination with partial pivoting to reduce the matrix to row-echelon form, finds the null space (the set of coefficient ratios that satisfy all constraints), and scales the solution to the smallest possible whole numbers by dividing by the greatest common divisor.

The result is always the lowest set of whole-number coefficients that balances the equation, computed in a deterministic, finite number of steps with no possibility of an infinite loop.

Parsing Two-Letter Elements and Parentheses

The parser handles two-letter element symbols correctly by reading capital letters as the start of a new element name and lowercase letters as continuations. So "Co" is parsed as cobalt, while "CO" is carbon followed by oxygen. For parenthetical groups like Ca(NO3)2, the parser reads inside the parentheses, records the atoms found there, then multiplies all of them by the trailing number (2 in this case). Nested parentheses are also supported for more complex organometallic compounds.

FAQ

We balance chemical equations because of the Law of Conservation of Mass: matter cannot be created or destroyed in a chemical reaction. Every atom that exists in the reactants must still exist in the products, just rearranged into new molecules. An unbalanced equation is scientifically incorrect because it implies atoms appear from nowhere or vanish. Balanced equations also let chemists calculate exact mass ratios for reactions, which is the foundation of stoichiometry used in lab work, industrial manufacturing, and pharmaceutical dosing.

Subscripts in a chemical formula define the molecule itself. Changing a subscript changes the identity of the compound. H2O (water) and H2O2 (hydrogen peroxide) are completely different substances with different properties and reactions. Altering the subscript to balance an equation would be like changing the recipe to claim you made a different dish. Only the coefficients in front of each molecule may be changed. Coefficients multiply the entire molecule, so they scale atom counts without altering what the molecule is.

The algebraic method assigns a variable (a, b, c, etc.) to the coefficient of each molecule. For each element, you write an equation stating that its atom count on the left must equal its count on the right. This produces a system of linear equations. You then solve the system using Gaussian elimination or substitution, set one variable to 1, solve for the others, and multiply through by the lowest common denominator to get the smallest whole-number coefficients. This method always works and avoids the infinite loops that trial-and-error approaches can fall into for complex equations.

The Law of Conservation of Mass, established by Antoine Lavoisier in 1789, states that the total mass of reactants in a closed chemical reaction equals the total mass of products. No mass is gained or lost; atoms are only rearranged. This is why a balanced equation must show the same number of each type of atom on both sides. Modern physics extends this slightly to include mass-energy equivalence, but for all ordinary chemical reactions the law holds with extreme precision.

When a polyatomic ion (like SO4, NO3, OH, or CO3) appears intact on both sides of an equation, you can treat the whole ion as a single unit and count it rather than counting each individual atom. For example, in Ca(OH)2 + H3PO4 = Ca3(PO4)2 + H2O, you can count PO4 groups directly. However, this shortcut only works when the ion is unchanged in both reactants and products. If the ion breaks apart during the reaction, you must count each element atom by atom. This balancer always counts atoms individually for accuracy.