How to draw a chemical structure from SMILES

Tutorial · macOS and Windows

SMILES strings are everywhere: in papers, supplier catalogues, PubChem and your colleagues' emails. ChemPencil turns a SMILES string into a clean, properly laid-out drawing in one step, including stereochemistry, and gives you canonical SMILES back from anything you draw.

Draw a structure from a SMILES string

  1. Copy the SMILES string, for example aspirin: CC(=O)Oc1ccccc1C(=O)O.
  2. In ChemPencil choose Structure › Insert from SMILES… (⇧⌘M on Mac, Ctrl+Shift+M on Windows). The field is already filled in when the clipboard holds a SMILES string.
  3. Click OK. The structure is laid out with standard bond lengths and angles and placed in the middle of the visible canvas.
The Insert from SMILES dialog with the SMILES of aspirin typed in
Insert from SMILES with the SMILES of aspirin.

To start a fresh document instead, use Structure › New from SMILES…. You can also simply paste: text containing SMILES (or a Molfile) pasted onto the canvas with ⌘V / Ctrl+V becomes a structure.

Stereochemistry is drawn for you

Stereo marks in the SMILES become real wedges and double-bond geometry. N[C@@H](C)C(=O)O is drawn as L-alanine with a solid wedge to the amine, and C/C=C/C as trans-but-2-ene. ChemPencil reads the wedges back when it names the structure, so the (R)/(S) labels always match the drawing. See drawing wedge and hash bonds.

Copy SMILES from a drawing

  1. Draw or open the structure.
  2. On Mac choose Structure › Copy SMILES; on Windows choose Edit › Copy As › SMILES (Ctrl+Shift+C).
  3. Paste the result wherever you need it.

The SMILES is canonical: the same structure always gives the same string, however you drew it, with stereochemistry included. For L-alanine you get:

C[C@H](N)C(=O)O

When a document holds several molecules they are joined with a .. To label a structure with its SMILES on the canvas, select it, right-click it and choose Generate SMILES for Selection.

A pasted SMILES may look different from the drawing it came from: the structure is the same, but ChemPencil makes its own layout. Run Structure › Clean Up Structure or Structure › Auto-Orient to tidy it.

Try it yourself. ChemPencil runs on macOS 12 and later and on Windows 10 and 11.