What the page decides for you
When two reactants are mixed in amounts that do not match the balanced equation, one of them is used up first and the other is left over. The reactant that runs out sets the ceiling on how much product can form. Finding it by hand means converting each amount into the same kind of comparison, and that is where mistakes creep in. This page does the comparison from moles and coefficients and reports three results: the theoretical amount of product, the amount of the first reactant that remains, and the amount of the second that remains. At least one remainder is zero, and both are zero when the mixture is exactly in proportion. The page works in moles only, so convert any masses first.
The rule behind the extent of reaction
A balanced equation tells you how many moles of each species take part in one repeat of the reaction. If the first reactant has coefficient 2 and you have 4 mol, that supply covers 4 / 2 = 2 repeats. If the second has coefficient 1 and you have 3 mol, it covers 3 repeats. The smaller number wins, because the reaction cannot go beyond the supply of the scarcer reactant. The page calls this smaller number the extent. The product amount is extent times the product coefficient, and each remainder is the starting amount minus extent times that reactant's coefficient. In compact form, extent = min(a / aCoef, b / bCoef), and product = extent × pCoef.
Reading the default numbers
The defaults describe 4 mol of the first reactant with coefficient 2, 3 mol of the second with coefficient 1, and a product coefficient of 3. The first reactant supports 2 repeats and the second supports 3, so the extent is 2. The theoretical product is 2 × 3 = 6 mol. The first reactant is consumed entirely, leaving 0 mol, while the second loses 2 mol and leaves 3 − 2 = 1 mol. Notice that the reactant present in the larger number of moles is not the limiting one here. The first reactant has more moles than the second does, yet it is the one that runs out, because its coefficient is twice as large. Comparing raw moles without dividing by coefficients gives the wrong answer in cases like this.
Ammonia from nitrogen and hydrogen
In N2 + 3 H2 → 2 NH3, put nitrogen first with coefficient 1 and hydrogen second with coefficient 3, with 2.0 mol of nitrogen and 5.0 mol of hydrogen. Nitrogen supports 2.0 repeats, and hydrogen supports 5.0 / 3, or 1.6667. Hydrogen limits the reaction. With a product coefficient of 2, the theoretical ammonia is 3.3333 mol. Hydrogen is fully used, and nitrogen leaves 2.0 − 1.6667 = 0.3333 mol. This is the situation a chemist sees when a gas mixture is hydrogen-poor compared with the 1 : 3 ratio. Mass-based thinking would have pointed the wrong way, since nitrogen is the heavier gas and 2.0 mol of it weighs about 56 g, far more than the 10 g of 5.0 mol of hydrogen.
Water from hydrogen and oxygen, and a perfect match
For 2 H2 + O2 → 2 H2O, take 6 mol of hydrogen and 2 mol of oxygen. Hydrogen covers 6 / 2 = 3 repeats and oxygen covers 2 / 1 = 2 repeats, so oxygen limits. Theoretical water is 2 × 2 = 4 mol, hydrogen leaves 6 − 4 = 2 mol, and oxygen leaves nothing. For a stoichiometric mixture, try 0.5 mol of magnesium and 0.25 mol of oxygen in 2 Mg + O2 → 2 MgO. Both quotients equal 0.25, so both remainders are zero and 0.5 mol of magnesium oxide forms. The page reports that case without picking a winner, which is correct, because neither reactant is in excess.
Getting from grams to moles first
The inputs are amounts of substance in moles, not masses. To use a mass, divide it by the molar mass of that substance in g/mol. Magnesium has a molar mass of about 24.3 g/mol, so 12.15 g is about 0.5 mol. Oxygen gas, O2, has a molar mass of about 32.0 g/mol, so 8.0 g is about 0.25 mol. Use the molar mass of the formula as written in the equation, which for gases such as O2, N2 and H2 means the diatomic molecule. Hydrates need the water included. Once both reactants are in moles, enter them with their coefficients. If you need the final answer as a mass, multiply the product moles by the molar mass of the product afterward.
Coefficients must come from a balanced equation
The calculator trusts the coefficients you give it and has no way to check whether the equation balances. An unbalanced equation produces a limiting reagent that looks plausible and is wrong. Balance the equation first and confirm that every element has the same count on both sides. Only the ratios matter for the extent, so 2 : 1 and 4 : 2 give the same limiting reactant, but the product coefficient must be scaled consistently with them. Doubling both reactant coefficients and the product coefficient doubles the extent denominators, which halves the extent and keeps the product amount unchanged.
Theoretical product versus what you collect
The product figure assumes the limiting reactant reacts completely and nothing is lost to side reactions, incomplete conversion or handling. Real syntheses rarely reach it. Comparing the amount you actually isolate with this theoretical figure gives the percent yield, which has its own page on this site. The calculator also treats the reaction as going to completion, so it says nothing about equilibrium. For a reversible reaction, some of the supposedly limiting reactant remains at equilibrium, and the real remainders differ from the ones shown here. The result is a stoichiometric bound, and it is useful for planning how much of each reagent to weigh out.
Reactions with more than two reagents
Only two reactants are handled, and complete reaction of the limiting one is assumed. Reactions with three or more reagents need the same comparison applied to each reactant in turn, with the smallest quotient controlling. Coefficients must be positive. The page does not look at purity, concentration, temperature, pressure, reaction rate or equilibrium position, and it carries out no reaction-hazard assessment. Whether a particular mixture is safe to combine is a separate question for the safety data sheets and for the person supervising the work. The method follows the reaction-yield treatment in OpenStax Chemistry 2e. Because the theoretical product depends on both reactants, run the page again whenever you change either starting amount.