represents a chemical species with ni atoms of the element elemi.


returns the chemical formula corresponding to the given input.

ChemicalFormula[,qual1val1,qual2val2 |>]

represents a species whose qualifiers quali have values vali.


  • Possible forms for elemi include:
  • Entity["Element",]a chemical element
    "Fe","C",an atomic symbol
  • Possible forms for quali include:
  • "NetCharge"net charge
    "Phase"phase of matter, e.g. "Solid", "Liquid", "Gas" or "Aqueous"
  • Possible forms for chem include:
  • "FeSO4","CH4",a formula string
    Molecule[]a molecule
    Entity["Chemical",]a chemical entity
    BioSequence[]a biomolecular sequence
  • ChemicalFormula[]["prop"] will return the value for the specified property.
  • Possible values for "prop" include:
  • "ElementCounts"an association of "Element" count
    "FormulaDisplay"a display version of the formula, e.g. CH4
    "FormulaString"a string version of the formula, e.g. "CH4"
    "HillFormula"ChemicalFormula object following the Hill system
    "HillFormulaString"formula string following the Hill system
    "MolecularMass"molecular mass


open allclose all

Basic Examples  (4)

Create a chemical formula from an association of element counts:

Create a chemical formula object from a string:

Find its molecular mass:

Convert a formula to a Hill formula:

Find isomers of heptane in the Wolfram Knowledgebase:

Applications  (2)

Find entities with a given formula:

Visualize the result in 2D:

Search an external database for isomers:

Wolfram Research (13), ChemicalFormula, Wolfram Language function,


Wolfram Research (13), ChemicalFormula, Wolfram Language function,


Wolfram Language. 13. "ChemicalFormula." Wolfram Language & System Documentation Center. Wolfram Research.


Wolfram Language. (13). ChemicalFormula. Wolfram Language & System Documentation Center. Retrieved from


@misc{reference.wolfram_2021_chemicalformula, author="Wolfram Research", title="{ChemicalFormula}", year="13", howpublished="\url{}", note=[Accessed: 24-January-2022 ]}


@online{reference.wolfram_2021_chemicalformula, organization={Wolfram Research}, title={ChemicalFormula}, year={13}, url={}, note=[Accessed: 24-January-2022 ]}