Equation Balancer
Type an unbalanced reaction and watch the coefficients solve themselves.
IntermediateWeb appEducation10–20hAI-buildable 4/5no setup
Parse a chemical equation, build the matrix of element counts, and solve for the smallest whole-number coefficients. It's linear algebra with a satisfying answer, wrapped in a parser that has to cope with subscripts, parentheses and charges.
UI
Logic
Useful
Hosting · Free forever
Deploys free on GitHub Pages, Cloudflare Pages or Vercel Hobby.
Deploy it and share a link.
Core features · 6
- Enter an unbalanced equation in plain text
- Formulas parse including subscripts and nested parentheses
- Coefficients solve to the smallest whole numbers
- The balanced equation renders with proper subscript formatting
- Impossible equations are reported rather than returning nonsense
- The element-count matrix can be shown as working
The interesting part
- Parsing nested formula groups correctly
- Solving the null space and scaling to integers
- Detecting an unbalanceable equation rather than looping
Once it works
- Add ionic equations with charge balancing
- Add molar mass calculation for each species
- Add a step-by-step explanation of the solve
Suggested stack
reacttypescripttailwind