ReactionBalance[rxn]
returns a version of the reaction rxn in which the stoichiometric coefficients for elements in the reactants and products are balanced.
ReactionBalance
ReactionBalance[rxn]
returns a version of the reaction rxn in which the stoichiometric coefficients for elements in the reactants and products are balanced.
Details
- rxn should be a ChemicalReaction object or a string that can be converted into a reaction.
- If the reaction cannot be balanced, a Failure object is returned.
Examples
open all close allBasic Examples (3)
ReactionBalance[ChemicalReaction[Association[ChemicalFormula[{"C" -> 8, "H" -> 10, "N" -> 4, "O" -> 2}] -> 1,
ChemicalFormula[{"O" -> 2}] -> 1] ->
Association[ChemicalFormula[{"C" -> 7, "H" -> 8, "N" -> 4, "O" -> 2}] -> 1,
ChemicalFormula[{"H" -> 2, "O" -> 1}] -> 1, ChemicalFormula[{"C" -> 1, "O" -> 2}] -> 1]]]Balance a reaction entered as a string:
ReactionBalance["FeCl2 + Na3PO4 -> Fe3(PO4)2 + NaCl"]Balance a reaction with charged species:
ReactionBalance[ChemicalReaction[
Association[ChemicalFormula[{"Cu" -> 1}, Association["Phase" -> "Aqueous", "NetCharge" -> 1]] ->
1, ChemicalFormula[{"Fe" -> 1}, Association["Phase" -> "Solid"]] -> 1] ->
Association[ChemicalFormula[{"Fe" -> 1}, Association["Phase" -> "Aqueous", "NetCharge" -> 3]] ->
1, ChemicalFormula[{"Cu" -> 1}, Association["Phase" -> "Solid"]] -> 1]]]Scope (1)
Reactions are not balanceable if some elements are missing:
ReactionBalance[ChemicalReaction[Association[ChemicalFormula[{"Fe" -> 1, "Cl" -> 2}] -> 1,
ChemicalFormula[{"Na" -> 3, "P" -> 1, "O" -> 4}] -> 1] ->
Association[ChemicalFormula[{"Fe" -> 3, {"P" -> 1, "O" -> 4} -> 2}] -> 1,
ChemicalFormula[{"K" -> 1, "Cl" -> 1}] -> 1]]]Applications (1)
Write a function to return balanced combustion reactions:
combustionReaction[mol_ ? (MoleculeFreeQ[Atom[Except["C" | "H" | "O"]]])] := ReactionBalance[ChemicalReaction[{mol, Entity["Chemical", "MolecularOxygen"]} -> {Entity["Chemical", "CarbonDioxide"], Entity["Chemical", "Water"]}]]Find the balanced reactions to combust several hydrocarbons:
combustionReaction /@ {"benzene", "cyclohexane", "anthracene"}Possible Issues (1)
If a reaction cannot be balanced uniquely, the balancing with the lowest sum of stoichiometric coefficients is returned:
ReactionBalance[ChemicalReaction[Association[ChemicalFormula[{"C" -> 1, "O" -> 1}] -> 1,
ChemicalFormula[{"C" -> 1, "O" -> 2}] -> 1, ChemicalFormula[{"H" -> 2}] -> 1] ->
Association[ChemicalFormula[{"C" -> 1, "H" -> 4}] -> 1, ChemicalFormula[{"H" -> 2, "O" -> 1}] ->
1]]]A different balancing of the same reaction:
ReactionBalancedQ[ChemicalReaction[Association[ChemicalFormula[{"C" -> 1, "O" -> 1}] -> 1,
ChemicalFormula[{"C" -> 1, "O" -> 2}] -> 2, ChemicalFormula[{"H" -> 2}] -> 11] ->
Association[ChemicalFormula[{"C" -> 1, "H" -> 4}] -> 3, ChemicalFormula[{"H" -> 2, "O" -> 1}] ->
5]]]Neat Examples (1)
Balance a complicated redox reaction:
ReactionBalance[ChemicalReaction[
Association[ChemicalFormula[{{"Cr" -> 1, {"N" -> 2, "H" -> 4, "C" -> 1, "O" -> 1} -> 6} -> 4,
{"Cr" -> 1, {"C" -> 1, "N" -> 1} -> 6} -> 3}] -> 1,
ChemicalFormula[{"K" -> 1, "Mn" -> 1, "O" -> 4}] -> 1,
ChemicalFormu ... Mn" -> 1, "S" -> 1, "O" -> 4}] -> 1, ChemicalFormula[{"C" -> 1, "O" -> 2}] ->
1, ChemicalFormula[{"K" -> 1, "N" -> 1, "O" -> 3}] -> 1,
ChemicalFormula[{"K" -> 2, "S" -> 1, "O" -> 4}] -> 1, ChemicalFormula[{"H" -> 2, "O" -> 1}] ->
1]]]Related Guides
History
Text
Wolfram Research (2021), ReactionBalance, Wolfram Language function, https://reference.wolfram.com/language/ref/ReactionBalance.html.
CMS
Wolfram Language. 2021. "ReactionBalance." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/ReactionBalance.html.
APA
Wolfram Language. (2021). ReactionBalance. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/ReactionBalance.html
BibTeX
@misc{reference.wolfram_2026_reactionbalance, author="Wolfram Research", title="{ReactionBalance}", year="2021", howpublished="\url{https://reference.wolfram.com/language/ref/ReactionBalance.html}", note=[Accessed: 12-June-2026]}
BibLaTeX
@online{reference.wolfram_2026_reactionbalance, organization={Wolfram Research}, title={ReactionBalance}, year={2021}, url={https://reference.wolfram.com/language/ref/ReactionBalance.html}, note=[Accessed: 12-June-2026]}