MolDraw › Chemistry tools › SMILES Validator and Canonicalizer
SMILES Validator and Canonicalizer
In short: Check a SMILES string for errors with their exact position, and get its canonical, non-isomeric and Kekulé SMILES, formula and molecular weight. Paste a list to find duplicates. It is free, works in your web browser and needs no download.
Errors found: unclosed or unmatched brackets and parentheses, unclosed ring numbers, ring bonds on the same atom, two bond symbols in a row, unknown elements, lowercase aromatic atoms outside a ring, rings that cannot be kekulized, and atoms with too many bonds.
What the checks mean
| Error | Example | Fix |
|---|---|---|
| Unclosed ring | C1CCCCC | Every ring number appears twice: C1CCCCC1 |
| Unclosed or unmatched parenthesis | CC(=O, CC)O | Each ( needs one ): CC(=O)O |
| Unclosed bracket | C[NH3+ | C[NH3+] |
| Element not allowed outside brackets | C[Fe]C is fine, CFeC is not | Only B, C, N, O, P, S, F, Cl, Br, I may be written without brackets |
| Bad valence | CC(C)(C)(C)(C)C | Carbon has at most 4 bonds; N 3 (4 as N⁺); O 2 |
| Pentavalent nitrogen | O=N(=O)c1ccccc1 | Write nitro as [N+](=O)[O-] |
| Cannot kekulize | c1cccc1, c1ccnc1 | Check the ring; pyrrole is c1cc[nH]c1 |
| Aromatic atom outside a ring | cc | Use uppercase for chain atoms: C=C |
Canonical, isomeric and Kekulé SMILES
Aspirin can be written CC(=O)Oc1ccccc1C(=O)O or OC(=O)C1=CC=CC=C1OC(C)=O. Both give the same canonical SMILES here, which is how the duplicate finder knows they are one molecule. Isomeric SMILES keep @/@@, / \ and isotopes; non-isomeric SMILES drop them. Kekulé SMILES write aromatic rings with alternating double bonds.
Duplicates are compared with OpenChemLib's canonical ID code at three levels: identical (stereo, isotopes and charges included), same apart from stereo or isotopes, and same largest part after removing counter-ions or solvent and neutralising charges (so sodium acetate, acetate and acetic acid match at this level).
How to validate SMILES
- Paste one SMILES, or a list with one per line. A name after a space is kept as a label.
- Press Validate. Errors are listed with their character position and highlighted in the string.
- For a valid SMILES, copy the canonical, non-isomeric or Kekulé form, and read the formula and molecular weight.
- With a list, look at the Duplicates section and press Download results CSV to keep the table.
Limitations
- Canonical SMILES are toolkit-specific. The form here (OpenChemLib) is stable for this tool, but it will not match RDKit, Open Babel or PubChem character for character. Compare canonical SMILES from the same program only.
- Tautomers are not merged: the duplicate finder treats 2-hydroxypyridine and 2-pyridone as different molecules.
- The valence check covers B, C, N, O, P, S, F, Cl, Br, I, Si, Se and H. Metals and other elements are accepted as written.
- Stereo is checked for syntax, not for chemical sense. A stereocentre without @/@@ is reported as a warning, not an error.
- SMARTS, reaction SMILES (with >) and CXSMILES extensions are not supported.
Want to see the structure? Turn the SMILES into a publication-quality picture, or draw it in the free MolDraw editor.
SMILES to imageFrequently asked questions
How do I check if a SMILES string is valid?
Paste it and press Validate. The tool checks brackets, branches, ring-closure numbers, bond symbols, element symbols, lowercase aromatic atoms and valences, and shows the position of each problem. A valid SMILES also gets a formula and molecular weight.
What is a canonical SMILES?
One molecule can be written as many SMILES. A canonical SMILES is the single form a program produces for that molecule whatever order the atoms were typed in, so two inputs are the same molecule when their canonical SMILES match. Each toolkit has its own canonical form; this tool uses OpenChemLib.
What is the difference between isomeric and non-isomeric SMILES?
Isomeric SMILES keep stereochemistry (@, @@, / and \) and isotopes such as [13C] or [2H]. Non-isomeric SMILES drop both, so L- and D-alanine give the same non-isomeric SMILES.
What is the Kekulé form of a SMILES?
Aromatic SMILES write ring atoms in lowercase, as in c1ccccc1. The Kekulé form writes alternating single and double bonds with uppercase atoms, as in C1=CC=CC=C1. Both describe benzene.
Why does my SMILES say it cannot be kekulized?
The lowercase atoms cannot be given alternating double bonds. The usual causes are a five-membered ring with a pyrrole-type nitrogen written as n instead of [nH], or a ring with an odd number of aromatic carbons.
Last updated: