Turn a SMILES string into an IUPAC name, with the reasoning shown step by step.
What you give it. A valid SMILES string for an organic molecule, for example CCO (ethanol), CC(=O)O (acetic acid), C=CC (propene), or OC(=O)C/C=C\C (a trans-butenoic acid). Halides, O and N heteroatoms, rings, and stereochemical markers (@/@@ and /) are recognized.
How it works.
- Parse the SMILES into a molecular graph — atoms, bonds (single/double/triple/aromatic), branches, ring closures.
- Detect functional groups by IUPAC seniority: carboxylic acid > ester > amide > nitrile > aldehyde > ketone > alcohol > amine > alkene/alkyne > alkane. Halides and ethers become prefixes.
- Find the longest carbon chain that contains the senior group (tie-breakers: most multiple bonds, then most substituents).
- Number the chain from the end giving the senior group the lowest locant (IUPAC "lowest set of locants" rule).
- Assemble the name: locants + prefixes (alphabetical) + parent stem + suffix.
- Stereochemistry:
@/@@ tetrahedral centers get R/S hints; directional /` double bonds get E/Z hints.
Teaching notes. Each result explains why the parent chain was chosen, why the numbering direction was picked, and lists any ambiguity. This is the part most "black-box" namers skip.
Limitations. This is a teaching-grade namer, not a cheminformatics engine. It handles acyclic and monocyclic skeletons with the common functional groups. Fused/polycyclic rings, spiro systems, peptides, organometallics, and full isotopic/stereochemical detail may be reported as "out of scope" — the structural breakdown is still shown so you can name the pieces by hand. For exhaustive coverage, use OPSIN or ChemDraw.