A chemical name is a string of words. A structure is a graph of atoms and bonds. Turning one into the other is not always a dictionary lookup, and it is not a single algorithm either. Systematic IUPAC names can be parsed by rules. Trivial names and trade names usually cannot — they have to be looked up.
That distinction explains a result that surprises people the first time they see it: aspirin and 2-acetoxybenzoic acid produce different SMILES strings, but the same InChI and the same InChIKey.
Two kinds of name
Systematic names are built from rules: a parent hydride, locants, suffixes, prefixes, and, when needed, a stereo descriptor. 2-chloro-4-nitrobenzoic acid and (2R)-2-hydroxypropanoic acid are names of this kind. A parser that implements the rules can read them without having seen that exact molecule before.
Trivial and trade names are labels. aspirin is a common name, not an IUPAC name. Tylenol is a brand. Nothing in those words encodes a carboxylic acid, an ester, or an acetanilide. They resolve only if some catalogue already maps the label to a structure.
OPSIN (Open Parser for Systematic IUPAC Nomenclature), from the University of Cambridge, is the usual open rule-based parser. When a name is outside its grammar, a curated index such as PubChem can still succeed.
Worked examples
The results below were resolved through SeqChem's name-to-structure API. The source value is what the API reported: opsin for a rule-based parse, pubchem for a catalogue fallback.
A substitutive name
Input: 2-chloro-4-nitrobenzoic acid
| Field | Value |
|---|---|
| SMILES | ClC1=C(C(=O)O)C=CC(=C1)[N+](=O)[O-] |
| InChIKey | QAYNSPOKTRVZRC-UHFFFAOYSA-N |
| Source | opsin |
The locants and the nitro and carboxylic acid suffixes are enough. No catalogue entry is required.
A stereodescriptor
Input: (2R)-2-hydroxypropanoic acid
| Field | Value |
|---|---|
| SMILES | O[C@@H](C(=O)O)C |
| InChI | InChI=1S/C3H6O3/c1-2(4)3(5)6/h2,4H,1H3,(H,5,6)/t2-/m1/s1 |
| InChIKey | JVTAAEKCZFNVCJ-UWTATZPHSA-N |
| Source | opsin |
The SMILES carries an @@ stereo marker. The InChI keeps the stereo in the /t and /m layers, so the InChIKey is not the non-stereo form of the same skeleton. If you drop the (2R) descriptor, you are asking for a different identifier.
The same molecule under two names
2-acetoxybenzoic acid parses as a systematic name:
SMILES: C(C)(=O)OC1=C(C(=O)O)C=CC=C1
InChIKey: BSYNRYMUTXBXSQ-UHFFFAOYSA-N
source: opsin
aspirin is not systematic. OPSIN does not accept it; PubChem does:
SMILES: CC(=O)OC1=CC=CC=C1C(=O)O
InChIKey: BSYNRYMUTXBXSQ-UHFFFAOYSA-N
formula: C9H8O4
PubChem CID: 2244
source: pubchem
The two SMILES are written differently — one starts at the acetyl group, the other at the methyl carbon — but they describe the same structure. The InChI strings are identical, which is why the InChIKey matches. If you are deduplicating compounds, compare InChI or InChIKey, not the raw SMILES. That is also why InChIKey exists; the SMILES vs InChI vs InChIKey guide covers the same point in more detail.
A trade name
Tylenol also needs a catalogue:
SMILES: CC(=O)NC1=CC=C(C=C1)O
InChIKey: RZVAJINKPMORJF-UHFFFAOYSA-N
formula: C8H9NO2
PubChem CID: 1983
source: pubchem
This is paracetamol (acetaminophen). The brand name does not encode the phenol or the amide; the lookup does.
Short retained names
quinoline and ethanol both parse in OPSIN, giving N1=CC=CC2=CC=CC=C12 and C(C)O respectively. A short parent hydride is still in the grammar, even when nobody would bother to call it a “full IUPAC name” in everyday use.
When a name does not resolve
A miss is not an HTTP error on this API. You get ok: true with resolved: false and a message. Two real cases:
-
asdfghjkl— the whole token is uninterpretable. -
2-acetoxybenzoic acidd— a one-letter typo; the message points at the strayd.
Badly formed locants fail in the same way. Biochemical names for enzymes, proteins or polymers usually have no single small-molecule structure, so a parser should not invent one.
A resolved SMILES is only as good as the parse. If the name was ambiguous or the SMILES is wrong, the 2D drawing will be wrong too. Check the structure against the name before you trust it downstream.
Calling it from a script
curl -sS https://api.seqandchem.com/api/v1/iupac \
-H 'Content-Type: application/json' \
-d '{"name":"2-chloro-4-nitrobenzoic acid"}'
A successful body includes resolved, source, smiles, inchi and inchikey. PubChem hits may also include formula, mw and cid. The name field is required and is limited to 300 characters.
The same examples can be pasted, one name per line, into the name-to-structure tool (up to 20 names per run). From there, the SMILES can go into the format converter or the 3D viewer.
Resolve a systematic, trivial or trade name with the free IUPAC name-to-structure tool.
Top comments (0)