Molar Ratio Calculator
The coefficients of a balanced equation are the molar ratio — there is nowhere else it comes from.
The formula
nullspace of the element-by-species matrix, in exact rationals
Balancing is linear algebra
Write one row per element and one column per species, with the products carrying a minus sign. Any vector that the matrix sends to zero is a set of coefficients that conserves every element at once. Balancing an equation by inspection is doing this arithmetic in your head, which is why it gets hard the moment a reaction has more than four or five species.
Why exact fractions
The elimination here is done in rational arithmetic rather than decimals. The answer is always a set of small whole numbers, and a floating-point result of 1.9999999999999998 cannot be rounded to 2 with any confidence once the numbers get larger. Working in fractions means the coefficients come out exactly and the check at the bottom of the page is a real check rather than a tolerance.
When there is more than one answer
Occasionally the nullspace has two or more dimensions. That is not a failure of the method: it means the equation as written is really two independent reactions sharing a line, and any mixture of them balances. The page reports that instead of picking one.
Balanced first, always
Every quantity on this page depends on a balanced equation. The coefficients set the molar ratio, the ratio sets the theoretical yield, and the yield is what the percentage is measured against. An unbalanced equation does not give a slightly wrong answer — it gives an answer to a different question.