Wolfram Language Paclet Repository

Community-contributed installable additions to the Wolfram Language

Primary Navigation

    • Cloud & Deployment
    • Core Language & Structure
    • Data Manipulation & Analysis
    • Engineering Data & Computation
    • External Interfaces & Connections
    • Financial Data & Computation
    • Geographic Data & Computation
    • Geometry
    • Graphs & Networks
    • Higher Mathematical Computation
    • Images
    • Knowledge Representation & Natural Language
    • Machine Learning
    • Notebook Documents & Presentation
    • Scientific and Medical Data & Computation
    • Social, Cultural & Linguistic Data
    • Strings & Text
    • Symbolic & Numeric Computation
    • System Operation & Setup
    • Time-Related Computation
    • User Interface Construction
    • Visualization & Graphics
    • Random Paclet
    • Alphabetical List
  • Using Paclets
    • Get Started
    • Download Definition Notebook
  • Learn More about Wolfram Language

ChemistryFunctions

Guides

  • Wolfram Chemistry Functions

Symbols

  • AtomSelector3D
  • AtomSelector
  • BohrModelPlot
  • ChemicalFormulaQ
  • ChemicalReactionQ
  • ConstitutionalIsomersQ
  • DiastereomersQ
  • EmbeddedMoleculeQ
  • EmpiricalFormula
  • EmptyMoleculeQ
  • EnantiomersQ
  • EpimersQ
  • FormatMoleculesAsGraphics
  • HydrocarbonQ
  • ImportComputationalChemistryData
  • IonCounts
  • MoleculeDelete
  • MoleculeGridPlot3D
  • MoleculeGridPlot
  • MoleculeJoin
  • MoleculeManipulate3D
  • MoleculeManipulate
  • MoleculeMirrorPlot3D
  • MoleculePatternQ
  • MoleculePlotOptions
  • MoleculeScaffold
  • MoleculeSubstructureMatches
  • PatternReactionQ
  • PeriodicTablePlot
  • RandomMolecule
  • RingMoleculeQ
  • RingPattern
  • SmilesPlot
  • StereoisomersQ
WolframChemistry`ChemistryFunctions`
ChemicalFormulaQ
​
ChemicalFormulaQ
[f]
returns
True
if f is a valid
ChemicalFormula
object and
False
otherwise.
​
Details and Options

Examples  
(3)
Basic Examples  
(2)
A string is not a valid ChemicalFormula object:
In[1]:=
ChemicalFormulaQ
["CH3"]
Out[1]=
False
In[2]:=
ChemicalFormulaQ

C
H
3

Out[2]=
True
​
When given invalid input,
ChemicalFormula
will return unevaluated, as is common in Wolfram Language functions:
In[1]:=
form1=ChemicalFormula["X^n"]
Out[1]=
ChemicalFormula[X^n]
In[2]:=
form2=ChemicalFormula["C6H5CH[CH(CH3)N(CH3)2]OH"]
Out[2]=
C
6
H
5
CH(CH(C
H
3
)N
(C
H
3
)
2
)OH
Both the valid and invalid formula have the head
ChemicalFormula
:
In[3]:=
MatchQ[#,_ChemicalFormula]&/@{form1,form2}
Out[3]=
{True,True}
Use a PatternTest to differentiate valid from invalid chemical formulas:
In[4]:=
MatchQ#,_?
ChemicalFormulaQ
&/@{form1,form2}
Out[4]=
{False,True}
Applications  
(1)

SeeAlso
ChemicalFormula
 
▪
MoleculeQ
 
▪
ChemicalReactionQ
RelatedGuides
▪
Wolfram Chemistry Functions
""

© 2025 Wolfram. All rights reserved.

  • Legal & Privacy Policy
  • Contact Us
  • WolframAlpha.com
  • WolframCloud.com