Skip to content

MOL and SDF Import

Most chemistry databases and drawing programs can save a structure as an MDL MOL file (.mol) or an SD file (.sdf). Molkit reads either one and turns it into an ordinary drawing: real atoms and bonds that you can edit, restyle and export like anything you drew yourself.

Import a MOL file

To import caffeine downloaded from PubChem as caffeine.sdf:

  1. Choose File > Import MOL/SDF….
  2. Pick the file in the file dialog. The picker accepts .mol, .sdf, .sd and .mdl files.
  3. The structure appears at the center of your view, selected, so you can drag it into place right away.

The whole import is one undo step: Ctrl+Z removes it.

If the canvas was empty, or the new structure would land outside the visible area, the view zooms to fit it. Importing onto a canvas where you are already working leaves the view alone.

Other ways in

  • Drag and drop. Drop one or more .mol, .sdf, .sd or .mdl files onto the canvas. Each structure lands where you dropped it; several files are staggered 20 px apart.
  • Paste. Copy the text of a MOL block (for example from a text editor or a database page) and press Ctrl+V on the canvas. Molkit recognises the block and imports a structure instead of creating a text box. The check is strict: the fourth line must be a counts line ending in V2000 or V3000, so ordinary prose is never mistaken for a molecule. Images and SVG on the clipboard take priority over MOL text.

What is read from the file

From the fileIn Molkit
2D coordinatesKept, then scaled so the average bond matches the document’s bond length (see Structure Settings). The y axis is flipped so the drawing is not upside down.
ElementsKept. Carbons are drawn as bare vertices; other elements get labels.
Single, double and triple bondsKept.
Aromatic bonds (type 4)Kept as aromatic bonds.
Wedge and hash stereo flags (1 and 6)Drawn as wedge and dash bonds. Other stereo flags are ignored.
ChargesRead from the atom block and from M CHG lines; M CHG wins.
IsotopesRead from M ISO lines.

Lone pairs, radicals and other property lines are not read. Add lone pairs afterwards with the lone pair tool or check the result with Validation.

V2000 and V3000 files

V2000, the common format, is read directly. A V3000 file is converted by RDKit, the chemistry engine Molkit loads from the internet at startup. If RDKit has not loaded, Molkit shows a warning that begins “This is a V3000 MOL file. V3000 import needs the chemistry engine (RDKit)” and imports nothing. Re-save the file as V2000 in the program that made it, or try again once you are online.

SD files with several structures

An SD file can hold many records separated by $$$$ lines. Molkit imports only the first record and shows “Imported the first of N structures in this SDF file.” To bring in a different record, copy its MOL block (from the header line down to M END) out of the file in a text editor and paste it onto the canvas.

When an import fails

MessageCause
”No molecule found in that MOL/SDF file.”The file is empty or has no records.
”Could not read any atoms from that MOL/SDF file.”The counts line or atom block could not be parsed.
”Could not read this V3000 MOL file (the chemistry engine could not parse it).”RDKit rejected the V3000 block.

If you import the same file twice without moving the first copy, the second copy is placed diagonally beside the first and Molkit says “Placed the imported structure beside the existing one to avoid overlap.”

For a structure written as text, use SMILES. For 3D coordinates from a computational chemistry program, use XYZ Import, which also works out the bonds.