Chemical Equation Balancer
Balance any chemical equation using linear algebra. Enter the unbalanced reaction, click Balance, and get the correct stoichiometric coefficients with an element-by-element conservation check. No signup, runs entirely in your browser.
⏱ 9 min read · Complete guide below
How to Use the Chemical Equation Balancer
- 1Type the unbalanced equation using + between compounds and
->or=between reactants and products. - 2Write formulas in standard notation — subscripts as plain numbers (H2O), polyatomic groups in parentheses (Ca(OH)2).
- 3Click Balance. The tool returns whole-number coefficients and an element-by-element conservation table.
- 4Confirm every row of the table reads “Yes” — that means each element is conserved on both sides.
Worked Example: Combustion of Glucose
Enter C6H12O6 + O2 -> CO2 + H2O — cellular respiration and sugar combustion. Balancing carbon first: 6 carbons on the left fix 6 CO₂ on the right. The 12 hydrogens fix 6 H₂O. Now count oxygen on the product side: 6 CO₂ contribute 12 O and 6 H₂O contribute 6 O, for 18 total. Glucose already supplies 6 of those, so O₂ must provide the remaining 12, meaning a coefficient of 6. The balanced result is C₆H₁₂O₆ + 6 O₂ → 6 CO₂ + 6 H₂O.
Doing it by hand shows why the tool uses linear algebra rather than guesswork: each element is one equation and each compound's coefficient is one unknown, so balancing is really solving a small system with the constraint that every atom is conserved. For simple reactions the inspection method above works, but for something like Fe2(SO4)3 + KOH → Fe(OH)3 + K2SO4 the matrix approach finds the answer instantly where trial-and-error stalls. That is exactly what happens under the hood when you click Balance.
Why Chemical Equations Must Be Balanced
Balancing is not a formality — it is a direct consequence of the law of conservation of mass, which says atoms are neither created nor destroyed in a chemical reaction, only rearranged. Whatever atoms enter as reactants must leave as products, so the count of every element has to match on both sides. The coefficients you add express the real ratios in which substances react: the balanced glucose combustion tells a chemist that one molecule of glucose needs exactly six molecules of oxygen and produces six of carbon dioxide and six of water. Those ratios are the foundation of stoichiometry, letting you calculate how much reactant you need or how much product you will get — which is why an unbalanced equation is essentially useless for any quantitative work.
How to Balance Equations by Hand
For simpler reactions, the inspection method is a good skill to build. Start by balancing the element that appears in the fewest compounds, and leave pure elements like O₂ or H₂ until last, since adjusting their coefficient does not disturb anything else. Balance metals first, then non-metals, then hydrogen, and finally oxygen — a common ordering that avoids going in circles. Treat polyatomic ions such as sulfate (SO₄) as a single unit when they appear unchanged on both sides. If you end up with a fraction, multiply the whole equation through to clear it. This tool automates all of that with linear algebra, but knowing the manual approach helps you understand and sanity-check the answers it produces.
Types of Reactions You Can Balance
The balancer handles the full range of reaction types you meet in chemistry. Synthesisreactions combine simple substances into a compound; decomposition breaks a compound apart; single and double replacement reactions swap partners; and combustionreactions burn a fuel in oxygen to give carbon dioxide and water. Because it parses standard notation with parentheses and multi-letter symbols, it copes equally well with inorganic salts like Fe₂(SO₄)₃ and organic molecules like C₆H₁₂O₆. The element-conservation table it prints alongside the answer lets you confirm at a glance that every atom is accounted for, whatever the reaction type.
Chemistry Tips
Combustion reactions
For hydrocarbon combustion, enter the fuel + O2 on the left and CO2 + H2O on the right. The balancer handles the fractional coefficients and scales to whole numbers automatically.
Parentheses in formulas
Write polyatomic ions with parentheses: Ca(OH)2, (NH4)2SO4, Fe2(SO4)3. The parser correctly distributes the subscript multiplier across all atoms in the group.
Check your work
The element conservation table shows the atom count on each side after balancing. Every row should show "Yes". If any row shows "No", the input equation may have a typo.
Use example reactions
Click any example button below the input field to load a common reaction. Try modifying it to explore how the coefficients change.
The Linear Algebra Behind Balancing
Balancing an equation by inspection works for simple reactions, but it can turn into frustrating trial-and-error for complex ones. The reason a computer can do it instantly is that balancing is, at heart, a linear algebra problem. Each compound gets an unknown coefficient, and each chemical element gives you one equation stating that the number of its atoms must be equal on both sides. A reaction with four compounds and three elements is simply a system of three equations in four unknowns.
The tool builds a matrix in which every row is an element and every column is a compound, filled with how many atoms of that element each compound contains (positive for reactants, negative for products). It then finds the null space of that matrix — the set of coefficient combinations that make every element balance to zero — using Gaussian elimination, and scales the answer to the smallest whole numbers. This is why the method never gets stuck the way guessing can: as long as the reaction is chemically valid, the mathematics guarantees a solution and finds it directly. It also explains the occasional “cannot balance” message, which usually means an element appears on only one side, making the system unsolvable.
From Balanced Equation to Real Quantities
A balanced equation is not the end goal — it is the tool that unlocks stoichiometry, the quantitative heart of chemistry. The coefficients are mole ratios: they tell you the exact proportions in which substances react and form. In the balanced glucose combustion, C₂H₁₂O₂ + 6 O₂ → 6 CO₂ + 6 H₂O, the 1-to-6 ratio means one mole of glucose reacts with six moles of oxygen — and from that single fact a chemist can calculate how many grams of oxygen are needed to burn a given mass of sugar, or how much carbon dioxide will result.
This is where balancing earns its importance in the lab and in industry. Working out a limiting reagent (which reactant runs out first and therefore caps the yield), predicting a theoretical yield, and scaling a recipe up from a test tube to a factory all depend on those mole ratios. Without a correctly balanced equation the ratios are wrong, and every calculation built on them is wrong too — which is why balancing is the first step of essentially every quantitative chemistry problem.
Common Mistakes When Balancing
A few errors trip up students repeatedly, and knowing them helps you sanity-check any result. The single most important rule is that you may only change coefficients, never subscripts. Altering a subscript changes the substance itself — turning water (H₂O) into hydrogen peroxide (H₂O₂) — so balancing must be done entirely with the numbers in front of formulas, not inside them. A related slip is forgetting to apply a coefficient to every atom in a compound: the 2 in 2 H₂O means four hydrogen atoms and two oxygen atoms, not two of each.
Other frequent mistakes include leaving the answer with a common factor (a balanced equation should use the smallest whole-number ratio, so 2, 1, 2 rather than 4, 2, 4), and mishandling parentheses, where a subscript outside the bracket multiplies everything inside — Ca(OH)₂ has two oxygen and two hydrogen atoms. Finally, remember that this atom-conservation approach handles standard molecular equations, but balancing net-ionic redox reactions also requires conserving electrical charge, which is a separate half-reaction technique. Understanding these pitfalls means you can confidently verify the tool's output against the element-conservation table it prints, and learn the underlying skill rather than just copying an answer.
Frequently Asked Questions
How does the balancer work?
The tool parses each compound into element counts, builds a matrix where rows represent elements and columns represent compounds, then uses Gaussian elimination to find the null space — the set of coefficients that satisfies conservation of each element. The result is scaled to the smallest whole-number ratio.
What format should I enter equations in?
Use + to separate compounds and -> or = to separate reactants from products. Example: H2 + O2 -> H2O. You can also use the → arrow symbol. Coefficients are not needed — the balancer adds them.
Does it support parentheses in formulas?
Yes. Compounds like Ca(OH)2, Fe2(SO4)3, and C6H12O6 are all parsed correctly. Multi-character element symbols like Ca, Mg, and Fe are also supported.
Why does it say "cannot balance"?
This usually means the equation is not chemically valid — elements appear on one side but not the other, or the equation is physically impossible. Check that the same elements appear on both sides of the reaction.
Can it handle organic chemistry reactions?
Yes. Combustion reactions like C6H12O6 + O2 -> CO2 + H2O balance correctly. Complex organic reactions work as long as the formula can be parsed from standard chemical notation.
Is my data stored?
No. All balancing runs locally in your browser using JavaScript. Nothing is sent to any server.
Why do chemical equations need to be balanced at all?
Because of the law of conservation of mass: atoms are not created or destroyed in a reaction, only rearranged, so the number of each element must be equal on both sides. The coefficients also reveal the exact ratios in which substances react, which is the basis of stoichiometry — the calculations that tell you how much reactant you need and how much product you will get. An unbalanced equation cannot be used for any quantitative chemistry.
What is the best order to balance elements by hand?
A reliable approach is to balance metals first, then other non-metals, then hydrogen, and finally oxygen, saving pure elements like O₂ or H₂ for last because changing their coefficient does not affect any other compound. Balance the element that appears in the fewest formulas first, and treat unchanged polyatomic ions like sulfate as a single unit. If you finish with a fraction, multiply the whole equation to clear it to whole numbers.
Are the coefficients always the smallest whole numbers?
Yes. The balancer scales its solution to the smallest set of whole-number coefficients, which is the standard convention for a balanced equation. This is why you will never see a common factor across all the coefficients in the result — for example it returns 2, 1, 2 rather than 4, 2, 4. Reporting the lowest whole-number ratio makes the reaction's stoichiometry clearest.
Can it balance redox or ionic equations with charges?
This tool balances by conserving atoms of each element, which correctly handles molecular equations including combustion, synthesis, decomposition, and replacement reactions. Balancing net ionic redox equations also requires conserving electrical charge and often adding H⁺, OH⁻, or water via the half-reaction method, which is a separate technique. For standard molecular equations written with neutral compounds, the balancer works directly.