How to use the balance chemical equations calculator
- Enter the unbalanced equation in the input box. Use
->or→for the arrow,+between species. The parser accepts Unicode arrows such as ⟶ as well. - Charges are written with a caret:
Fe^3+,SO4^2-,H^+. The charge symbol must be at the end of the species. - Parentheses for polyatomic groups work normally:
Ca(OH)2,NH4^+,PO4^3-. Nested parentheses such asFe(CN)6or(NH4)2SO4are supported; hydrates written with a dot (CuSO4.5H2O), phases and bracket notation are rejected. - The balanced equation appears instantly below the input. Coefficients of 1 are omitted following standard chemical notation. You can copy the result for reports or further calculations.
How the balancer works
The calculator treats each element and the overall charge as a linear conservation law. For the reaction a H2 + b O2 -> c H2O, hydrogen gives 2a = 2c and oxygen gives 2b = c. This homogeneous system M x = 0 is solved over the rational numbers using Gaussian elimination to reduced row echelon form. The nullspace basis vector is scaled to the smallest positive integers. For the water example the matrix is:
H: [2, 0, -2]O: [0, 2, -1]
The nullspace yields (2, 1, 2) which gives 2H2 + O2 -> 2H2O. Because the arithmetic uses exact fractions, rounding errors never occur, even for large or complex systems.
Common balanced equations reference
Quick lookup table for frequently encountered reactions:
| Reaction | Balanced equation |
|---|---|
| Hydrogen + oxygen (water) | 2H2 + O2 -> 2H2O |
| Methane combustion | CH4 + 2O2 -> CO2 + 2H2O |
| Iron + oxygen (rust) | 4Fe + 3O2 -> 2Fe2O3 |
| Ammonia synthesis (Haber process) | N2 + 3H2 -> 2NH3 |
| Aluminum + hydrochloric acid | 2Al + 6H^+ -> 2Al^3+ + 3H2 |
| Calcium hydroxide + phosphoric acid | 3Ca(OH)2 + 2H3PO4 -> Ca3(PO4)2 + 6H2O |
| Potassium permanganate + iron(II) in acid | MnO4^- + 5Fe^2+ + 8H^+ -> Mn^2+ + 5Fe^3+ + 4H2O |
Practical use cases
- Stoichiometry problems: Convert between moles of reactants and products using the balanced coefficients. The coefficients are the mole ratios needed for limiting reagent and yield calculations.
- Lab preparation: Know exact molar ratios before mixing chemicals. This prevents waste and ensures safety when scaling reactions.
- Education: Students can check homework instantly and see the linear algebra behind balancing chemical equations. The tool shows that balancing is a systematic mathematical process, not guesswork.
- Redox reactions: The charge row ensures electron balance automatically. Include
H^+,OH^-, andH2Oas species for acidic or basic half-reactions. - Environmental and industrial chemistry: Balance combustion, scrubber, and wastewater treatment reactions for process design.
Common mistakes to avoid
- Forgetting diatomic elements: write
O2,N2,H2,Cl2, notOorN. - Omitting charges on ions:
Fe^3+notFe3+;SO4^2-notSO4^2. - Misplacing parentheses:
Ca(OH)2is correct;CaOH2means one calcium, one oxygen, two hydrogens. - Using several arrows or none: the equation needs exactly one arrow (
->,→,⟶,=or=>). - Writing phases like
(s),(aq),(g): omit them; the balancer only works with formulas and charges. - Entering incomplete equations: both sides of the arrow must have at least one species.
Background and theory
Balancing chemical equations is equivalent to finding the kernel of the element-species matrix. The method dates to the 19th century but became systematic with linear algebra. This tool uses exact rational arithmetic (fractions) so rounding errors never occur. The algorithm handles any number of elements and species, including charged ions, because charge is treated as an extra conservation law. The nullspace dimension corresponds to the number of independent ways to balance; for typical textbook reactions it is one, giving a unique balancing up to a scalar multiple. When the nullspace dimension is greater than one (for example when several independent reactions are mixed into one line), the tool returns an error instead of guessing, because the coefficients would not be unique.
Worked examples
| Example | Input | Result |
|---|---|---|
| Water formation | Chemical equation: H2 + O2 -> H2O | 2H2 + O2 -> 2H2O |
| Iron rust | Chemical equation: Fe + O2 -> Fe2O3 | 4Fe + 3O2 -> 2Fe2O3 |
| Combustion of ethane | Chemical equation: C2H6 + O2 -> CO2 + H2O | 2C2H6 + 7O2 -> 4CO2 + 6H2O |
| Redox with charges | Chemical equation: Al + H^+ -> Al^3+ + H2 | 2Al + 6H^+ -> 2Al^3+ + 3H2 |
| Polyatomic ions | Chemical equation: Ca(OH)2 + H3PO4 -> Ca3(PO4)2 + H2O | 3Ca(OH)2 + 2H3PO4 -> Ca3(PO4)2 + 6H2O |
FAQ
Can I balance redox reactions in acidic or basic solution?
Yes. Include H^+, OH^-, and H2O as species. The charge row balances electrons automatically, so free electrons (e^-) do not need to be written and are not supported as a species. For basic solutions, use OH^- and H2O; for acidic, use H^+ and H2O.
What if the equation has multiple valid balancing sets?
The nullspace dimension will be greater than one. The tool then reports an error rather than picking one arbitrarily. Split the equation into separate reactions and balance each one.
Does it support organic molecules with long formulas?
Yes, any valid formula with parentheses and numbers is parsed. Very large subscripts (over 1000) are rejected. For example, C6H12O6 + O2 -> CO2 + H2O balances to C6H12O6 + 6O2 -> 6CO2 + 6H2O.
Why are coefficients of 1 not shown?
Standard chemical notation omits the coefficient 1. The output follows that convention for readability.
Can I use Unicode arrows like ⟶?
The parser accepts ->, →, and ⟶. Use whichever you prefer; they are treated identically.
Is the calculation done on a server?
No. All parsing and linear algebra run in your browser using pure JavaScript. Nothing is uploaded.
How do I cite this balance chemical equations tool?
You can reference it as “Balance Chemical Equations Calculator, xerobit.dev”.
What happens if I enter an equation that cannot be balanced?
The tool will show an error. This occurs when the equation is syntactically invalid, when atoms or charge cannot be conserved (e.g., creating or destroying elements), or when the system has no non-trivial solution.