The chemical equation balancer above does not pattern-match against a list of memorised reactions. It builds the element matrix for the equation you typed, solves it exactly using rational arithmetic, and reduces the answer to the smallest set of whole-number coefficients that conserves every atom on both sides. That is the same procedure a chemist performs by hand when trial-and-error stops working, and it is why this tool handles a nine-species redox equation as comfortably as it handles the combustion of propane.
Arb Digital builds free calculators that do the actual computation rather than approximating it, because a tool that silently returns a plausible-looking wrong answer is worse than no tool at all. This page also explains what the balancer is doing, where students most often go wrong, and — importantly — the specific cases where an equation genuinely has no single correct answer and the tool will tell you so instead of inventing one.
What This Chemical Equation Balancer Does
Enter reactants on the left of an arrow and products on the right, separated by plus signs. The balancer parses each formula into a count of atoms per element, handling multi-letter symbols, nested parentheses, bracketed complex ions and hydrates written with a dot. It then constructs a matrix where each row is an element and each column is a species, with reactant entries positive and product entries negative. Conservation of mass means the coefficient vector must lie in the null space of that matrix, so solving the equation reduces to finding that null space.
The result hero shows the balanced equation with coefficients of 1 left implicit, as convention requires. The supporting grid reports how many distinct elements were balanced, the total atom count on each side after balancing — a genuine verification step, not a restatement — the classified reaction type, and the sum of all coefficients, which is a quick way to compare two candidate balancings of the same reaction. Two extra inputs let you scale the whole set by an integer and apply the balanced ratio to a real number of moles of the first reactant, which turns a balancing exercise directly into a stoichiometry answer.
Anything the parser cannot make sense of is rejected with a message naming the problem. An unknown element symbol, an unmatched bracket, a subscript of zero, a stray dot, or a lowercase first letter all produce a specific complaint rather than a silent zero. That matters more than it sounds: a balancer that treats an unrecognised symbol as no atoms at all will happily return a confident, completely wrong answer.
How to Use It
- Type the skeleton equation. Formulas only, no coefficients needed — if you include them they are stripped and recalculated. Use ->, = or a real arrow character between the two sides.
- Write formulas the normal way. Capital letter first, lowercase second for two-letter symbols, subscripts as plain digits. Co is cobalt; CO is carbon monoxide. The parser respects that distinction exactly, as it must.
- Use parentheses for polyatomic groups. Ca(OH)2, Al2(SO4)3 and K4[Fe(CN)6] all parse correctly, including nesting. Hydrates take a dot: CuSO4.5H2O.
- Read the verification line. The grid shows the atom count on each side after balancing. If those two numbers match, mass is conserved and the coefficients are right.
- Apply it to a quantity. Enter moles of the first reactant to see the balanced ratio expressed as actual amounts of every other species, then carry those into the moles to grams calculator for a mass answer.
The Formula: How Balancing Is Actually Calculated
Trial and error works for simple equations and collapses quickly for anything else. The systematic method treats balancing as linear algebra. Assign an unknown coefficient to every species: a C3H8 + b O2 → c CO2 + d H2O. Conservation of each element gives one linear equation. Carbon: 3a = c. Hydrogen: 8a = 2d. Oxygen: 2b = 2c + d. Three equations, four unknowns, so the system is homogeneous and underdetermined by exactly one degree of freedom — which is precisely what we want, because a balanced equation is only defined up to a common multiple.
Setting a = 1 and solving gives c = 3, d = 4, and b = (2 × 3 + 4) ÷ 2 = 5. So C3H8 + 5 O2 → 3 CO2 + 4 H2O. Where the solution comes out fractional, every coefficient is multiplied by the least common multiple of the denominators and then divided by the greatest common divisor of the results, which is what produces the conventional smallest-whole-number form. The LibreTexts chemistry library hosted by UC Davis sets out the same algebraic method alongside the inspection method most courses teach first.
The implementation here performs Gaussian elimination to reduced row echelon form over exact rationals held as pairs of arbitrary-precision integers, never as floating-point numbers. That distinction is not academic. Floating-point elimination on an equation with large coefficients accumulates rounding error, and the final rounding step can then produce coefficients that are off by one and do not actually balance. Exact rational arithmetic cannot drift, so a coefficient the tool reports as 299 is exactly 299. The permanganate-and-ferrocyanide equation used as one of this page's test cases produces coefficients above 100, and it comes out right for exactly this reason.
When an Equation Genuinely Has No Single Answer
This is the part most balancers get wrong, and it is worth understanding because it is not a bug in the tool — it is a real property of the equation you wrote. The null space of the element matrix has a dimension. If that dimension is one, there is exactly one balanced equation up to scaling, and the tool returns it. If the dimension is zero, no non-trivial solution exists and the equation cannot be balanced at all as written, usually because an element appears on one side and nowhere on the other.
If the dimension is two or more, the equation has infinitely many genuinely different balancings, not just multiples of one another. Consider CO + O2 → CO2 + C. Both 2 CO + O2 → 2 CO2 and 2 CO → CO2 + C conserve every atom, and so does any combination of the two. There is no defensible reason to prefer one, so the correct behaviour is to say so. This tool reports the number of independent solutions and explains that you have most likely written two separate reactions as one, or included a species that appears on both sides. A balancer that returns a single confident answer in this situation has simply picked one arbitrarily and told you nothing about it.
The same thing happens with certain redox systems where a species is both oxidised and reduced through more than one pathway. The mathematics is telling you something chemically real: the stoichiometry is not determined by mass conservation alone, and you need additional information — a specified oxidation-state change, or a decision about which half-reactions are actually occurring — to pin it down.
Reaction Types and What the Classification Means
Once coefficients are known, the tool classifies the reaction from its shape. A single product formed from two or more reactants is a synthesis or combination reaction. A single reactant breaking into multiple products is decomposition. A reaction between a hydrocarbon or other fuel and O2 producing CO2 and H2O is combustion, which is really a specialised redox reaction that gets its own name because it is so common. An element plus a compound producing a different element plus a different compound is single replacement; two compounds swapping partners is double replacement, and where those partners are an acid and a base producing water and a salt, it is neutralisation.
Classification is a structural heuristic, not a mechanistic claim. It reads the pattern of the balanced equation and nothing more. Many reactions belong to two categories at once — every combustion is also a redox reaction, and most single-replacement reactions are too — so treat the label as a useful shorthand for what the equation looks like rather than a statement about how the reaction proceeds at the molecular level.
Parsing Formulas Correctly: The Details That Break Other Tools
Formula parsing looks trivial and is not. Element symbols are one or two characters, and the second character being lowercase is the only thing that distinguishes NaCl (sodium chloride, two elements) from a hypothetical N-A-C-L string. A greedy parser that always takes two characters will read CO as cobalt and produce nonsense; a parser that always takes one will read cobalt as carbon plus oxygen. The correct rule is to take a capital letter, then absorb a following lowercase letter only if the resulting two-character symbol is a real element. The parser checks every symbol against the full list of 118 elements as published in the IUPAC periodic table of the elements, which is the authority on approved names and symbols.
Subscripts multiply only the symbol or group they immediately follow. In Ca(OH)2 the 2 multiplies the entire OH group, giving two oxygen and two hydrogen atoms; in CaOH2 it multiplies only the hydrogen. Nested parentheses multiply cumulatively, so in a formula like Fe[Fe(CN)6] the inner subscript applies before the outer bracket is expanded. Hydrate dots are their own case: the number written before the water molecule in CuSO4.5H2O is a multiplier for everything in that dot-separated section, not a subscript on the copper sulfate. The parser in this tool implements all four rules with a bracket stack, which is why the polyatomic and hydrate examples above return the correct atom counts.
Charges on ions are tolerated and ignored, because balancing by mass does not use them. If you are balancing half-reactions in acidic or basic solution, add the H+, OH- and H2O species explicitly to both sides as you would on paper, and the mass balance will then determine the coefficients. Charge balance is a separate constraint that this tool does not impose.
Where Balanced Coefficients Take You Next
Coefficients are mole ratios, and mole ratios are the bridge to every quantitative answer in stoichiometry. From C3H8 + 5 O2 → 3 CO2 + 4 H2O you know that 2 moles of propane require 10 moles of oxygen and produce 6 moles of carbon dioxide. Convert those moles to grams with the molar masses of each species — our molar mass calculator computes them from the formula, and the molar mass converter handles unit conversion, which is a different job from either calculator here.
From there, a limiting-reagent question is just a matter of dividing available moles of each reactant by its coefficient and finding the smallest quotient. Theoretical yield follows from the limiting reagent, and comparing it to what you actually obtained gives percentage yield — the percent yield calculator handles that step. If you are working with solutions rather than pure substances, the molarity calculator converts between concentration, volume and moles so the balanced ratio can be applied to volumes delivered from a burette or pipette.
Balancing also depends on knowing the formulas in the first place. If you are deriving a formula from combustion analysis or mass-percentage data rather than being given it, start with the empirical formula calculator and bring the result back here. The two tools are consecutive steps in the same workflow: one determines what the species are, the other determines how many of each take part.
Why Exact Arithmetic Matters More Than Speed
A balancer running in a browser has microseconds of work to do, so there is no performance argument for cutting corners on precision. The reason many implementations still use floating-point is simply that it is easier to write. The failure mode is subtle and therefore dangerous: for the overwhelming majority of textbook equations, floating-point elimination gives the right answer, so the bug never surfaces during casual testing. It surfaces on exactly the hard equations where you most need the tool to be right and are least able to check the answer by hand.
The verification step in the results grid exists for the same reason. Rather than asking you to trust the solver, the tool independently recounts every atom on both sides using the coefficients it produced and reports the totals. If those numbers ever disagreed, the answer would be visibly wrong. Showing the check is more useful than asserting correctness. The scientific notation converter is handy alongside this when coefficients or quantities get large enough to be awkward to read.
Arb Digital builds free tools like this one because useful pages earn attention. If you want tools, calculators or content built for your own audience, we can help.
Browse All Free Tools Talk to Arb DigitalCommon Mistakes to Avoid
- Changing subscripts instead of coefficients — turning H2O into H2O2 to balance oxygen changes the substance from water to hydrogen peroxide. Only the numbers in front may change.
- Mixing up case in symbols — CO is carbon monoxide, Co is cobalt, and NO is nitrogen monoxide while No is nobelium. The parser follows the real convention and will reject or misread a sloppy formula.
- Forgetting that diatomic elements are diatomic — hydrogen, nitrogen, oxygen, fluorine, chlorine, bromine and iodine exist as H2, N2, O2 and so on in their elemental state, not as single atoms.
- Leaving coefficients as fractions — a half-coefficient on O2 is legitimate in thermochemical equations but is not the conventional balanced form; multiply through to clear it.
- Assuming a balanced equation is a plausible one — mass conservation is a necessary condition, not a sufficient one. The arithmetic will balance a reaction that does not occur.
Related Free Tools From Arb Digital
Balancing is the first step in most stoichiometry problems. Follow it with the molar mass calculator to get masses per mole, the moles to grams calculator to convert the balanced ratio into weighable quantities, and the percent yield calculator to compare theoretical and actual output. For solution work use the molarity calculator or the solution dilution calculator, and for structural questions try the electron configuration calculator. The full free online tools hub lists everything.
Frequently Asked Questions
It builds a matrix with one row per element and one column per species, reactants positive and products negative, then finds the null space of that matrix by Gaussian elimination using exact rational arithmetic. The null-space vector is scaled to the smallest whole numbers, which are the coefficients.
Because the element matrix has a null space of dimension two or more, meaning infinitely many genuinely different balancings exist rather than multiples of a single one. That normally happens when two separate reactions have been written as one equation, or when a species appears on both sides.
Yes. Nested parentheses and square brackets are expanded with a bracket stack, so Al2(SO4)3 and K4[Fe(CN)6] parse correctly. Hydrates are written with a dot, as in CuSO4.5H2O, and the number before the water acts as a multiplier for that whole section.
The equation is rejected with a message naming the symbol it could not recognise. It is never treated as zero atoms, because doing so would silently produce a confident but incorrect set of coefficients.
No. Balancing only confirms that atoms are conserved. Whether a reaction occurs depends on thermodynamics and kinetics, which mass conservation says nothing about. A mathematically valid balance of chemically unrealistic species is still mathematically valid.
It balances by mass, not by charge. Add H+, OH- and H2O to both sides explicitly as the half-reaction method requires, and the mass balance will then fix the coefficients. Charges written on ions are tolerated but ignored.
Because any multiple of a balanced equation is also balanced, so the convention is to divide through by the greatest common divisor. That gives one canonical answer and makes two people's work on the same reaction directly comparable.
This tool is provided for educational and study use. It performs a mathematical balance of atoms and does not assess whether a reaction is feasible, and nothing here is laboratory, handling or safety guidance.