SMILES to InChI Converter
Draw any SMILES in 2D and 3D and get its InChI, InChIKey, Molfile and molecular weight.
Chemistry tutorial · SMILES notation
SMILES writes a molecule as one line of text. Atoms are element symbols, bonds are - = #, branches go in parentheses and rings close with matching digits. Hydrogens are added by valence, so ethanol is simply CCO.
SMILES rules · easy to hard
Each rule builds on the one before. Every example was checked in PubChem.
Rule 1 · Atoms
B C N O P S F Cl Br I are written bare; hydrogens are added by valence.
CCO ethanol
C | methane |
O | water |
CCC | propane |
Rule 2 · Bonds
A single bond is implied between neighbours; = is double, # is triple.
C#C ethyne
C=C | ethene |
O=C=O | carbon dioxide |
C#N | hydrogen cyanide |
Rule 3 · Branches
A branch goes in parentheses right after the atom it hangs from.
CC(C)C isobutane
CC(=O)O | acetic acid |
ClC(Cl)Cl | chloroform |
CCN(CC)CC | triethylamine |
Rule 4 · Rings
Break one ring bond; mark both ends with the same digit (%10 above 9).
C1CCCCC1 cyclohexane
C1CC1 | cyclopropane |
C%10CCCCC%10 | cyclohexane |
Rule 5 · Aromatic
Lower-case atoms are aromatic; an aromatic N–H is written [nH].
c1ccccc1 benzene
C1=CC=CC=C1 | benzene (Kekulé) |
c1ccc2ccccc2c1 | naphthalene |
c1cc[nH]c1 | pyrrole |
Rule 6 · Charges + isotopes
Brackets hold the H count, charge and mass number; a dot separates ions.
[NH4+] ammonium
[Na+].[Cl-] | sodium chloride |
CC(=O)[O-] | acetate ion |
[2H]O[2H] | heavy water |
Rule 7 · Stereo
/ and \ set double-bond geometry; @ and @@ set a stereocentre.
C/C=C\C (Z)-but-2-ene
C/C=C/C | (E)-but-2-ene |
C[C@@H](C(=O)O)N | L-alanine |
C[C@H](C(=O)O)N | D-alanine |
Try it
Paste any string from this guide into ChemAI’s SMILES converter.
2D + 3D | structure |
InChI · InChIKey | Molfile |
Free | no sign-in |
Worked example · aspirin
Aspirin is 2-acetyloxybenzoic acid, C9H8O4. Start at one end, walk along the bonds, and the string grows one group at a time.
CCC(=O)CC(=O)OC1CC(=O)OC1=CC=CC=C1CC(=O)OC1=CC=CC=C1C(=O)OC9H8O4 · 180.16 g/mol · PubChem CID 2244Rule summary
Keep this open while you write. Examples link to the converter.
| Symbol | Feature | Example |
|---|---|---|
| C N O … | Organic-subset atom | CCO |
| [ ] | Other atom, charge, isotope, H | [Na+] |
| - = # | Single, double, triple bond | C#N |
| ( ) | Branch | CC(C)C |
| 1 … %10 | Ring closure | C1CCCCC1 |
| c n o s | Aromatic atom | c1ccccc1 |
| [nH] | Aromatic N–H | c1cc[nH]c1 |
| . | Not bonded (salts) | [Na+].[Cl-] |
| / \ | Double-bond geometry | C/C=C\C |
| @ @@ | Stereocentre | N[C@@H](C)C(=O)O |
Common mistakes
Wrong case
CL vs ClSymbols keep their case: Cl is chlorine, CL is not a symbol. Lower-case c means an aromatic carbon and only works inside an aromatic ring.
CCL not a valid symbolCCl chloromethaneMissing [nH]
c1ccnc1 vs c1cc[nH]c1In five-membered aromatic rings, write the H on nitrogen. Some tools guess it, others (RDKit, used by the converter) reject the string.
c1ccnc1 tools disagreec1cc[nH]c1 pyrroleOpen rings
C1CCCCC vs C1CCCCC1Every ring digit needs a partner and every ( needs a ). The converter rejects these and says which one is open.
C1CCCCC ring 1 never closedC1CCCCC1 cyclohexaneBracket hydrogens
[C] vs [CH4]Nothing is added inside brackets: [C] is a bare carbon atom with no hydrogens. Write every H, or leave the brackets off.
[C] bare carbon atom[CH4] or C methaneFAQ
Simplified Molecular Input Line Entry System. David Weininger introduced it in 1988; today it is maintained as the open OpenSMILES specification.
SMILES is short and easy to edit, but one molecule has many valid strings. InChI is an IUPAC standard with one string per molecule; its hashed InChIKey is used for searching.
Paste the string into a SMILES converter such as ChemAI’s. It draws the 2D structure and a 3D model in your browser, and gives the InChI, InChIKey, Molfile and molecular weight.
The single string a program chooses for a molecule, so the same molecule always gives the same text in that program. Different programs use different rules, so canonical SMILES from RDKit and from PubChem may differ.
c1ccccc1 (aromatic form) or C1=CC=CC=C1 (Kekulé form). Both describe benzene, PubChem CID 241.
Usually not. Hydrogens on organic-subset atoms are added from valence. They are written only inside brackets ([NH4+]), for isotopes ([2H]) or when needed for stereochemistry ([C@@H]).
Sources