Chemical Equation Balancer
Enter a complete neutral-formula equation to find its smallest whole-number coefficient ratio and verify every atom—without uploading the equation.
Balance coefficients without changing formulas
A balanced chemical equation has the same number of atoms of each element on the reactant and product sides. Only the coefficients before complete formulas change. Subscripts stay fixed because they define the compounds. For Fe + O2 = Fe2O3, the smallest whole-number ratio is 4:3:2, giving 4 Fe + 3 O2 → 2 Fe2O3. The atom receipt confirms four Fe atoms and six O atoms on each side.
This calculator parses each formula into exact integer atom counts. It builds one conservation equation per element, performs rational row reduction with integer fractions, scales the one-dimensional solution to whole numbers, and divides by the common factor. It then performs a separate exact recount before displaying the result. No floating-point rounding is used to choose coefficients.
How grouped formulas are counted
Parentheses multiply everything inside the group. In Ca(OH)2, the group multiplier gives two O atoms and two H atoms. The equation Ca(OH)2 + H3PO4 = Ca3(PO4)2 + H2O balances as 3 Ca(OH)2 + 2 H3PO4 → Ca3(PO4)2 + 6 H2O. The receipt checks Ca 3=3, H 12=12, P 2=2, and O 14=14.
Why an equation can have multiple coefficient families
For H2 + O2 = H2O + H2O2, label the four coefficients a, b, c, and d. Hydrogen gives 2a = 2c + 2d, while oxygen gives 2b = c + 2d. Those two independent equations constrain four coefficients, so the matrix has rank 2 and nullity 2. Atom counts alone do not determine one smallest ratio. The tool reports that ambiguity and deliberately withholds a fabricated balanced answer.
Supported formula grammar and limits
Enter one equation with + between formulas and one =, ->, or → between sides. Each formula may contain official element symbols, ASCII subscripts from 1 to 999, and nonempty parenthesized groups nested up to three levels. The equation is limited to 300 characters, 16 formulas, 20 elements, and 30 atoms or groups per formula. Aggregate atoms for one element in one formula are limited to 1,000,000; a result coefficient is limited to 1,000,000,000.
Enter formulas without existing leading coefficients. This neutral-formula version does not support named compounds, ionic charges, electrons, redox half-reactions, hydrate dots, square brackets, isotope labels, catalysts, or state labels such as (aq). It does not predict products or classify a reaction. An exact atom balance is a mathematical conservation check—not evidence that the reaction occurs, is safe, or proceeds under particular conditions.
Private, local calculation
The parser, periodic-table symbol list, exact solver, copy text, and text-file export load with the page and run locally in your browser. Equations and results are not put into the URL, saved to browser storage, or sent to a calculation service. After the page assets load, a new supported equation can be balanced and exported while offline. Each worker run is capped at two seconds. The exact-number matrix and positivity-feasibility workspaces are checked against a 32 MiB representation budget; this is not a measurement or hard cap on the browser runtime's own overhead.
Frequently asked questions
Why can't this equation be balanced?
A complete equation needs every element on both sides and a strictly positive coefficient for every formula. A typo, missing product, unsupported notation, or a coefficient system with no all-positive solution can prevent a result. The calculator identifies the first useful reason it finds; it does not decide whether a real reaction can occur.
Why does the calculator say there are multiple solutions?
Atom conservation can sometimes leave two or more free coefficient choices. In that case there is no single smallest ratio determined by the equation as entered. The result shows the species variables, conservation equations, matrix rank, and nullity instead of selecting an arbitrary answer.
Can I change a subscript to make an equation balance?
No. A subscript is part of a compound's formula, so changing it changes the substance. Balancing changes only the whole-number coefficients placed before complete formulas. This tool preserves every accepted subscript.
Are ions, charges, hydrates, or state labels supported?
Not in this version. It accepts complete neutral formulas with element symbols, ASCII subscripts, and parentheses up to three levels. Ionic charges, electrons, half-reactions, hydrate dots, square brackets, catalysts, and labels such as (aq) are rejected with a specific message.