AnyTool
Your files never leave your device. All processing happens locally in your browser.

How do I balance a chemical equation?

Type the unbalanced reaction into AnyTool Chemistry Equation Balancer, for example H2 + O2 → H2O, and it returns 2 H₂ + O₂ → 2 H₂O instantly. It parses every species into atom counts — handling parentheses, brackets and hydrates like CuSO₄·5H₂O — builds the element-conservation matrix, and solves for its null space using exact rational (BigInt fraction) arithmetic, then scales to the smallest whole-number coefficients by dividing out their greatest common divisor. Because the math is exact rather than floating point, the balance is always correct, and a per-element table proves the reactant atoms equal the product atoms.

  • Write species with + and the two sides with →, -> or =
  • Parses (), [] and hydrate dots (CuSO₄·5H₂O); multi-letter elements
  • Exact rational null-space solve → smallest positive integer coefficients
  • Per-element atom-conservation table proves it balances
  • 100% in your browser — no upload, no signup, works offline

What is

Chemical Equation Balancer

A chemical equation balancer finds the whole-number coefficients that put the same number of each kind of atom on both sides of a reaction, satisfying conservation of mass. Mathematically this is the null space of the equation’s element-composition matrix: each column is a species, each row an element (reactants positive, products negative), and a balancing coefficient set is any non-trivial vector the matrix sends to zero, scaled to the smallest positive integers.

Calculators

Related terms

Conservation of massStoichiometryNull spaceGaussian eliminationCoefficient

Frequently Asked Questions

It turns the reaction into a matrix of atom counts and solves for the null space, then scales the result to the smallest whole numbers.

Each species becomes a column and each element a row of a matrix, with reactant counts positive and product counts negative. Balancing means finding a non-zero coefficient vector that the matrix maps to zero — its null space. AnyTool does this with exact rational (BigInt fraction) Gauss-Jordan elimination, so there is no floating-point error, then multiplies through by the lowest common multiple of the denominators and divides by the greatest common divisor to get the smallest positive integer coefficients. A per-element table confirms reactant atoms equal product atoms.

Yes. It parses nested parentheses and brackets like Fe2(SO4)3 and K4[Fe(CN)6], plus hydrate dots such as CuSO4·5H2O.

The formula parser handles multi-letter element symbols, nested parentheses and square brackets, and hydrate notation written with a centre dot or asterisk — so CuSO4·5H2O, Ca(OH)2 and Fe2(SO4)3 are all read correctly. A leading number on a hydrate part (the 5 in 5H2O) and optional ionic charges (e.g. Fe3+, SO4^2-) are also understood. Anything it cannot parse is reported as an error rather than balanced incorrectly.

No. You supply both reactants and products; it only finds the coefficients that conserve atoms. It does not predict products or oxidation states.

AnyTool balances by conservation of atoms (and ionic charge when you write it); it does not predict what a reaction produces, assign oxidation numbers, or judge whether a reaction is real or spontaneous. If you give it both sides it makes the atoms balance with exact integer coefficients. If a system has more than one independent balanced reaction it tells you instead of guessing, and a genuinely impossible equation is reported as unbalanceable.

Yes, it is free with no signup and runs entirely in your browser, so the equations you enter are never uploaded.

The balancer is completely free with no account or limits, and all parsing and matrix algebra run on a small, unit-tested engine in your browser — nothing is sent to a server and the page works offline after first load. Because it uses exact rational arithmetic, the coefficients are the correct smallest whole numbers, not rounded approximations.

Detailed Explanation

Methodology

How the Chemistry Equation Balancer Balances

AnyTool Chemistry Equation Balancer treats balancing as a linear-algebra problem solved entirely in the browser. It parses each species into a map of element → atom count, then builds the element-composition matrix: one column per species, one row per element (plus a charge row if any species is charged), with reactant counts positive and product counts negative. A valid coefficient set is a non-trivial vector in the null space of this matrix. The engine finds it with exact rational Gauss-Jordan elimination using BigInt fractions — never floating point — then multiplies through by the lowest common multiple of the denominators and divides by the greatest common divisor to give the smallest positive integer coefficients. Because the arithmetic is exact, the answer is always the correct textbook balance, and a per-element table verifies that reactant atoms equal product atoms.

  • Element-composition matrix: species as columns, elements as rows
  • Reactants positive, products negative; optional charge row
  • Balancing = null space of the matrix (non-trivial solution)
  • Exact rational (BigInt fraction) Gauss-Jordan — no float error
  • Scaled to smallest positive integers via LCM then GCD
How It Works

Formula Parsing, Checks and Examples

The formula parser handles multi-letter element symbols (Na, Cl), nested parentheses and square brackets such as Fe2(SO4)3 and K4[Fe(CN)6], hydrate notation written with a centre dot or asterisk (CuSO4·5H2O), leading hydrate multipliers, and optional ionic charges like Fe3+ or SO4^2-. Equations may be split with ->, →, or =. One-click examples cover combustion, neutralization, a redox reaction, and a hydrate. Every balanced result is shown with Unicode subscripts, the integer coefficient list, a coefficient chip per species, and a conservation table proving each element balances, so the answer can be trusted and learned from rather than merely copied.

  • Parses (), [], nested groups and hydrate dots
  • Multi-letter elements and optional ionic charges
  • Examples: combustion, neutralization, redox, hydrate
  • Output uses Unicode subscripts and a coefficient list
  • Per-element conservation table accompanies every balance
Limitations

What It Does Not Do

The tool balances by conservation of atoms (and ionic charge only when charges are written explicitly); it does not predict the products of a reaction, assign oxidation states, identify reaction types, or judge whether a reaction is real, spontaneous or feasible — the user supplies both sides. If an equation’s matrix has a null space of dimension greater than one it contains several independent balanced reactions, so the tool reports that instead of arbitrarily choosing one, and a system with only the trivial all-zero solution is reported as impossible to balance. Ionic half-reactions balance only when charges are supplied; the tool does not infer them.

  • Does not predict products or assign oxidation states
  • Does not judge if a reaction is real or spontaneous
  • Charge balancing only when charges are written explicitly
  • Multiple independent reactions reported, not guessed
  • Truly impossible equations flagged as unbalanceable
Privacy & Security

Privacy and Offline Use

All parsing and matrix algebra run in the browser as pure functions, so the equations you enter are never sent to a server, there is no account or tracking, and the page keeps working offline after first load. The equation lives only in the page and resets on reload.

Equation balancing: in-browser (AnyTool) vs typical online balancers
CapabilityAnyToolTypical online balancers
Where it runs100% in your browser, offline-capableOften server-side
ArithmeticExact rational (BigInt) — never roundedOften floating point
Formula parsing(), [], hydrates and chargesVaries; hydrates often unsupported
VerificationPer-element conservation tableUsually just the equation
Edge casesImpossible & multi-reaction systems flaggedMay show a wrong or partial result
PrivacyNothing uploaded, no accountMay log inputs

AnyTool solves the null space of the element-composition matrix with exact rational arithmetic locally and uploads nothing.