SMARTS
SMARTS (SMILES Arbitrary Target Specification) is a line-notation language for describing molecular substructure patterns, developed by Daylight Chemical Information Systems as a companion to their SMILES notation. Where SMILES encodes one concrete molecule, SMARTS encodes a query graph: a pattern to be matched against candidate molecular graphs. It is the de-facto standard for substructure searching in cheminformatics, the task of finding a subgraph pattern inside a molecule graph, which underpins database filtering, functional-group detection, and reaction annotation.
Syntactically SMARTS is a superset of SMILES, so every valid SMILES string is also a valid SMARTS, but the semantics differ. In SMILES the symbol "O" denotes a specific aliphatic oxygen with implied hydrogens and zero charge; as a SMARTS it matches any aliphatic oxygen regardless of hydrogen count or charge. The language builds queries from atomic primitives (wildcard *, aromatic a versus aliphatic A, plus atomic number, degree, connectivity, explicit and total hydrogen count, ring membership and ring size, formal charge, and chirality) and bond primitives (single -, double =, triple #, aromatic :, ring @, and the any-bond wildcard ~). These primitives combine through logical operators: negation !, high- and low-precedence AND (& and ;), and OR (,), letting a single atom expression capture rich constraints.
Two features make SMARTS expressive beyond simple patterns. Recursive SMARTS, written with $(...), lets an atom's match depend on its surrounding environment, so a query can require an atom to sit in a specific neighborhood without that context being part of the returned match. Component-level grouping with parentheses distinguishes intramolecular from intermolecular matches, and the reaction syntax uses ">" separators with atom maps to describe reactant, agent, and product patterns.
In the graph-data and format-conversion landscape, SMARTS is a query dialect rather than a storage format: it is typically applied against molecules held as SMILES, Molfile, SDF, or MOL2, and closely relates to SMIRKS, which extends the reaction syntax to specify graph transformations. It is implemented by toolkits such as RDKit and Open Babel. Its strengths are a compact, chemist-readable syntax and precise control over atomic and bond environments; its limitations include subtleties in aromaticity models and default-valence assumptions that vary between implementations, potentially expensive matching for complex or deeply recursive patterns, and the general NP-hard nature of subgraph isomorphism.
Alternative Names: SMILES Arbitrary Target Specification
Read-only Tools
Frequently Asked Questions
What is a SMARTS (SMILES Arbitrary Target Specification) file?
A SMARTS (SMILES Arbitrary Target Specification) file stores a graph — its nodes, edges and attributes — in the SMARTS (SMILES Arbitrary Target Specification) format (also: SMILES Arbitrary Target Specification). See the feature table above for what it supports.
How do I open a SMARTS (SMILES Arbitrary Target Specification) file?
Open it in a graph tool that supports SMARTS (SMILES Arbitrary Target Specification), or convert it to a format your tool reads. With GraphInOut you can convert SMARTS (SMILES Arbitrary Target Specification) to GraphML, DOT, Connected JSON and more, right in your browser.
How do I convert a SMARTS (SMILES Arbitrary Target Specification) file to another format?
Use the Convert from SMARTS (SMILES Arbitrary Target Specification) link above: upload or paste your SMARTS (SMILES Arbitrary Target Specification) file (input preset to SMARTS (SMILES Arbitrary Target Specification)), choose a target format and download the result — free, no install.
