# Chemical Equation Balancer

Balance chemical equations quickly with this tool.

## Instructions

Form compounds by adding elements like **H**, **He**, **Li**, etc., followed by the number of atoms of that element in each compound or no number if there is only one atom. Then group different reactants or products with the **+** symbol. Finally, to complete the equation, add the reactants, an **=** symbol, and the products. *Example*: H2 + O2 = H2O

To balance the chemical equation, simply click the `Balance` button, and the result will appear formatted in LaTeX.

## How it works

Instead of using the trial-and-error method, this tool creates a system of equations and solves it to obtain the coefficients that balance the equation.

To make it clear, let's do an example with the following chemical equation:

- First, let's assign coefficients to each molecule of the equation like this:
- Identify the elements in the chemical formula:
- Build the vector equation, one for each molecule of the equation. In the i-th position of the vector, we store the number of atoms of that element in the i-th molecule found in the previous step. For example, the first vector is [3, 8, 0], representing that the first molecule is composed of 3 carbon atoms and 8 hydrogen atoms, so it is C3H8.
- Solve one side of the equation, leaving a vector of zeros on that side:
- Break it down into a matrix representing the chemical equation multiplied by a vector of coefficients:
- Represent the system of equations as an augmented matrix:
- Reduce the augmented matrix to its reduced row-echelon form:
- As you can see, the matrix has more unknowns than equations, leaving the variable
*x*free. Parametrizing the variables in terms of_{4}*t*, we get: - To eliminate fractions, choose a value for
*t*that corresponds to the least common multiple of the denominators, in this case, 3. The coefficients become: - Substituting the coefficients into the equation from step 1, we get the solution:
## Support this website

If this page has been useful, share it with your contacts by email, social networks,... etc.