Chemical file formats compared: MOL, SDF, MOL2, CDX, SMILES and InChI
What each format keeps, what it drops, and how to convert safely
Matic Broz, PhD17 min

TL;DR
- SMILES and InChI are one-line notations without coordinates; MOL, SDF, MOL2, PDB and PDBQT are connection tables or coordinate files; CDX, CDXML and KET are drawing documents.
- Use SMILES for tables and models, InChIKey for database lookup, SDF for libraries and 3D ligands, PDBQT for AutoDock Vina, and CDXML to keep a ChemDraw drawing editable.
- PDB and PDBQT store no bond orders, so a ligand that passes through them has its double bonds and aromaticity guessed on the way back.
- Standard InChI normalizes charge and tautomer states: neutral alanine and its zwitterion get the same InChI, and an InChIKey cannot be turned back into a structure.
- Converting SMILES or InChI to SDF generates a new conformer; it does not recover the geometry of the file the string came from.
L-alanine has six heavy atoms, and every common chemical file format records them differently. As SMILES it is 15 characters on one line. As a 3D SDF it becomes 13 atoms with hydrogens and coordinates. As a PDB file it is six HETATM lines with no bond orders, so the carboxyl double bond survives only by convention. As a standard InChI, the neutral acid and the zwitterion that exists in water become the same string.
None of these files is wrong. Each was designed for a different job: registering a compound, docking it, drawing it for a paper or storing a library with its data. The trouble starts when a file is converted through a format that drops what the next step needs.
SketchIQ, the free chemical structure drawer by ProteinIQ, reads and writes most of the formats below, and the converters linked throughout handle the rest, from MOL to SMILES to SMILES to PDBQT.
What each format stores
Chemical formats fall into three families. Line notations (SMILES, InChI) write the molecular graph as text, without coordinates. Connection tables and coordinate files (MOL, SDF, MOL2, PDB, PDBQT) list atoms with positions, and most of them list bonds. Drawing documents (CDX, CDXML, KET) store a page or canvas: structures plus arrows, text and layout.
| Format | Coordinates | Bond orders | Charges | Stereochemistry | Per file |
|---|---|---|---|---|---|
| SMILES | None | Yes, with aromatic lowercase atoms | Formal, in brackets such as [NH3+] | @ and @@ for centres, / and \ for double bonds | One per line |
| InChI and InChIKey | None | Yes, in the InChI; the key is a hash | Charge and proton layers, normalized | Absolute or none in standard InChI | One per string |
| MOL V2000 | 2D or 3D | Yes | Formal | Wedge and hash bond flags; no AND or OR groups | One, up to 999 atoms and 999 bonds |
| MOL V3000 | 2D or 3D | Yes | Formal | Bond configurations plus enhanced stereo groups | One, no atom limit |
| SDF | 2D or 3D | Yes | Formal; partial only as a data field | As MOL V2000 or V3000 | Many, each with named data fields |
| MOL2 | Usually 3D | Yes, plus amide and aromatic types | Partial; formal only implied by atom types | From coordinates only | Many |
| PDB | 3D | No; CONECT lists bonded atoms only | Formal, in a two-character column | From coordinates only | Many residues or models |
| PDBQT | 3D | No bond records | Partial, per atom | From coordinates only | One ligand in, several poses out |
| CDX and CDXML | 2D page positions | Yes | Formal | Wedges and hashes as drawn | A whole document of structures, arrows and text |
| KET | 2D canvas positions | Yes | Formal | Wedges and hashes, plus enhanced stereo labels | Everything on the Ketcher canvas |
The table explains most conversion problems before they happen. Any path through a row with "No" under bond orders, or "None" under coordinates, forces the next program to guess or generate what is missing.
SMILES and InChI: one line, no coordinates
SMILES, introduced by David Weininger in 1988, writes atoms as element symbols, bonds as characters and rings as matching digits.[2] It is short enough for a spreadsheet cell, which is why compound tables, machine learning datasets and most screening tools take it as input. The SMILES notation guide covers the syntax.
The catch is that a molecule has many valid SMILES, and "canonical" only means canonical within one toolkit. PubChem writes L-alanine as C[C@@H](C(=O)O)N.[4] RDKit, which SketchIQ and the ProteinIQ converters use, writes the same molecule as C[C@H](N)C(=O)O. Both are correct, and the stereo symbol flips only because the neighbours are listed in a different order. Comparing SMILES from two sources as strings will call them different compounds.
InChI was built to solve that. It is an IUPAC identifier computed by one reference algorithm, so every program that uses it writes the same string, organized in layers for formula, connectivity, hydrogens, charge and stereochemistry.[3] L-alanine is InChI=1S/C3H7NO2/c1-2(4)3(5)6/h2H,4H2,1H3,(H,5,6)/t2-/m0/s1, and SMILES to InChI and InChI to SMILES convert in each direction.
What standard InChI normalizes away
Standard InChI is deliberately forgiving about some chemistry. Tautomers get the same standard InChI, so 2-pyridone and 2-hydroxypyridine share one string.[3] Protonation is normalized too: we ran the zwitterion C[C@H]([NH3+])C(=O)[O-] through RDKit's InChI writer and got exactly the InChI of neutral alanine. Standard InChI also accepts only absolute stereochemistry or none, so a racemate drawn with relative stereo loses that distinction.[3]
That makes InChI good for asking "is this the same compound?" and poor for storing the form you intend to dock. Converting the InChI back gives you one representative structure, which may not be the tautomer or charge state you started with.
The InChIKey is a 27-character hash of the InChI, made for search engines and database indexes.[3] L-alanine's is QNAYBMKLOCPYGJ-REOHCLBHSA-N. A hash cannot be reversed: to get a structure from a key, you have to look it up in a database such as PubChem, which is what SketchIQ's search box does when you paste one. The identifiers guide compares InChIKey, SMILES and CAS numbers for lookup.
MOL and SDF: the connection table
A MOL file, or molfile, is MDL's connection table: a counts line, one line per atom with its coordinates, one line per bond with its order and stereo flag, and M END.[1] Here is L-alanine as a 2D V2000 molfile written by RDKit:
L-alanine
RDKit 2D
6 5 0 0 0 0 0 0 0 0999 V2000
1.5000 1.2990 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
0.7500 0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-0.7500 -0.0000 0.0000 C 0 0 0 0 0 0 0 0 0 0 0 0
-1.5000 1.2990 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
-1.5000 -1.2990 0.0000 O 0 0 0 0 0 0 0 0 0 0 0 0
1.5000 -1.2990 0.0000 N 0 0 0 0 0 0 0 0 0 0 0 0
2 1 1 6
2 3 1 0
3 4 2 0
3 5 1 0
2 6 1 0
M ENDEvery z coordinate is zero because this is a drawing, not a conformer. The stereochemistry lives in the first bond line: the 6 in its fourth column marks the bond from the chiral carbon to the methyl as a hashed bond, and a program reading the file works out S from that flag and the 2D layout. The bond line 3 4 2 is the carboxyl double bond.
V2000 vs V3000
V2000, the layout above, uses fixed-width columns, which caps a molecule at 999 atoms and 999 bonds.[1] V3000 writes each atom and bond as a tagged M V30 line, removes the limit and adds enhanced stereochemistry: groups that mark centres as racemic (AND) or relative (OR) rather than absolute.[1] In V3000 the same hashed bond reads M V30 1 1 2 1 CFG=3.
Most small-molecule software reads both. Choose V3000 when a structure is large, such as a peptide or polymer, or when its stereochemistry is racemic or relative. SketchIQ removes MOL V2000 and SDF V2000 from its export menu while AND or OR groups are drawn, because V2000 has no way to store them. The stereochemistry guide explains how those wedges and labels are drawn.
SDF: many molecules and their data
An SDF is a series of molfiles, each optionally followed by named data fields such as an ID or a measured IC50, and closed by a line of four dollar signs.[1] That makes it the standard format for compound libraries and database downloads, and the usual output of docking programs that write one record per pose. The SDF file guide walks through a full PubChem record line by line.
MOL2, PDB and PDBQT: formats built around 3D
MOL2 comes from Tripos's SYBYL modelling software. Each atom carries 3D coordinates, a SYBYL atom type such as C.ar or N.am, and a partial charge.[5] Those types suit force-field setup, but MOL2 has no formal-charge field, so a reader has to infer charges from types such as N.4, and toolkits do not always infer them the same way. MOL2 to SMILES and SMILES to MOL2 cover the common round trip.
PDB was made for proteins and nucleic acids, and it stores a ligand as HETATM lines with element, coordinates and residue name. Bonds go in CONECT records, which list bonded atom numbers and nothing else; the format has no bond-order field.[6] Here is the 3D alanine conformer written as PDB by RDKit:
COMPND L-alanine
HETATM 1 C1 UNL 1 -0.475 1.237 0.281 1.00 0.00 C
HETATM 2 C2 UNL 1 -0.087 -0.002 -0.514 1.00 0.00 C
HETATM 3 C3 UNL 1 0.980 -0.784 0.255 1.00 0.00 C
HETATM 4 O1 UNL 1 0.791 -1.708 1.033 1.00 0.00 O
HETATM 5 O2 UNL 1 2.228 -0.322 0.037 1.00 0.00 O
HETATM 6 N1 UNL 1 -1.266 -0.857 -0.757 1.00 0.00 N
CONECT 1 2
CONECT 2 3 6
CONECT 3 4 4 5
ENDRDKit lists atom 4 twice in atom 3's CONECT line to mark the double bond, a convention some programs read and others ignore. Hydrogens were dropped on the way out, so nothing in the file says that atom 5 is an OH rather than an O⁻.
A program reading the file back has to perceive bond orders and protonation from geometry, which is why the AutoDock Vina documentation advises against preparing ligands from PDB files.[8] For viewing a ligand next to a protein, though, PDB is fine, and SDF to PDB writes one.
PDBQT is AutoDock's PDB variant. It adds a partial charge and an AutoDock atom type to every atom, keeps only polar hydrogens, and encodes rotatable bonds as a torsion tree of ROOT and BRANCH blocks.[7] It stores no bonds at all. It is the input AutoDock Vina needs, and the wrong format to keep a ligand in, because chemistry has to be reconstructed on the way back.
CDX, CDXML and KET: drawing documents
CDX is ChemDraw's native binary format, and CDXML is its XML encoding; ChemDraw converts between them with no loss of information.[9] A CDX document is a nested set of objects (atoms, bonds, fragments, arrows and text), each with properties such as position, colour, bond order and arrow type.[9] Reaction conditions, coloured highlights and journal-style layout all survive in it, and none of them in a molfile.
The cost is portability. Cheminformatics toolkits treat CDX and CDXML as drawings to extract structures from, and the extraction is incomplete: the Open Babel build on ProteinIQ reads CDX but refuses CDXML. Keep CDXML as the editable source of a figure, and export SMILES or SDF for anything a program will compute on. A ChemDraw file from a colleague can still be opened without ChemDraw.
KET is the native JSON format of Ketcher, EPAM's open-source structure editor, which SketchIQ is built on.[10] A KET file has a root object whose nodes point to molecules, each listing atoms with locations and bonds with types, alongside arrows, text and pluses. It is the only format that holds everything on a Ketcher canvas, which makes it the right save format for unfinished SketchIQ work and an awkward one for other software.
Two related MDL formats handle reactions: RXN holds one reaction step, and RDF a whole scheme with one record per step.
Which format to use
Most choices follow from what the next program needs. If it computes on the graph, give it a line notation. If it needs geometry, give it 3D coordinates in a format that also keeps bond orders. If a person will edit the drawing, keep the drawing document.
| Task | Use | Why |
|---|---|---|
| Compound table, spreadsheet, machine learning dataset | SMILES | One line per molecule; every toolkit reads it |
| Deduplicate a library or look a compound up in a database | InChIKey, with the InChI or SMILES alongside | One algorithm, so equal structures give equal keys |
| Send one structure with its drawing and stereochemistry | MOL (V3000 for enhanced stereo or more than 999 atoms) | Keeps bond orders, charges, wedges and coordinates |
| Store a library with properties, or a set of docked poses | SDF | Many records, each with named data fields |
| Dock with AutoDock Vina | PDBQT, prepared from a 3D SDF | Vina needs AutoDock types and a torsion tree |
| Force-field setup in tools that expect SYBYL types | MOL2 | Carries atom types and partial charges |
| Show a ligand beside a protein in a viewer | PDB or SDF | Viewers place both by their coordinates |
| Keep a figure or reaction scheme editable | CDXML, or KET within SketchIQ | Stores arrows, text, colours and layout |
A safe habit is to keep two files for anything important: an SDF or MOL with the exact structure you mean, and a SMILES or InChIKey for tables and lookups. Everything else can be regenerated from those.
Converting between formats
A converter can only copy what the source file holds. Four conversions lose or invent information, and they account for most broken ligands.
Line notation to coordinates generates a structure rather than recovering one. SMILES to SDF builds a fresh 3D conformer with RDKit, which is what docking needs, but it is not the crystal pose or the docked pose that a SMILES may have been taken from. The same holds for InChI, with the added step that you get InChI's normalized tautomer and charge state.
Coordinates without bond orders to chemistry forces a guess. Going from PDB or PDBQT to SDF or SMILES means perceiving double bonds and aromaticity from bond lengths, and a slightly distorted ligand can come back as the wrong tautomer. PDB to SDF and PDB to MOL2 do that perception; PDBQT to SDF avoids it for files written by Meeko, which records the ligand's SMILES in the PDBQT so the export can rebuild the molecule.[8]
Any format to a single charge state fixes protonation as written. A neutral SDF stays neutral when converted to PDBQT, even when the ligand is mostly ionized at pH 7.4. Dimorphite-DL enumerates the charge states expected over a pH range before you build 3D structures.
Drawing documents to connection tables keep the structures and drop the rest. Exporting MOL or SMILES from a CDXML scheme loses arrows, conditions, text and colours, and a molfile cannot hold a reaction at all, which is why SketchIQ offers RXN and RDF instead of MOL while a reaction is drawn.
| From | To | Tool | What to check |
|---|---|---|---|
| MOL | SMILES | MOL to SMILES | Coordinates and header text are dropped |
| SDF | SMILES | SDF to SMILES | One SMILES per record; data fields are dropped |
| MOL2 | SMILES | MOL2 to SMILES | Formal charges are inferred from atom types |
| SMILES | SDF, MOL2 or PDB | SMILES to SDF, SMILES to MOL2, SMILES to PDB | Coordinates are a new conformer |
| SMILES or SDF | PDBQT | SMILES to PDBQT, SDF to PDBQT | Protonation state is kept as given |
| PDBQT | SDF | PDBQT to SDF | Needs Meeko's SMILES remarks |
| PDB | SDF or MOL2 | PDB to SDF, PDB to MOL2 | Bond orders are perceived from geometry |
| SMILES and InChI | InChI and SMILES | SMILES to InChI, InChI to SMILES | Standard InChI normalizes tautomers and charges |
| CDX, CDXML, KET, CML, RXN | SMILES, MOL, SDF, InChI, CDXML | SketchIQ | One structure or scheme at a time |
When a file will not convert at all, because of a valence error, an odd charge or two molecules in one record, Ligand fixer repairs it and writes a clean SDF.
Converting formats in SketchIQ
SketchIQ is the quickest route when you have one structure and a format you cannot open. Its upload button reads MOL, SDF, CDXML, CDX, SMILES, InChI, CML, KET and RXN files, and its search box takes a SMILES, InChI or InChIKey directly. The Export menu then writes SMILES, Extended SMILES (CXSMILES), MOL and SDF in V2000 or V3000, InChI, KET, RXN, RDF, CDXML, CDX, SVG and PNG, and copies the InChIKey.
Two behaviours matter for conversion. An SDF or SMILES file with several structures opens the first one and tells you how many the file holds, so use SDF to SMILES or Open Babel for whole libraries. A 3D file, such as a docked pose, opens as a flat 2D drawing with its hydrogens folded into their atoms, which is right for a figure and wrong if you meant to keep the pose.
When the molecule is ready, Use this molecule in sends it straight to AutoDock Vina, the route the drawing-to-docking guide follows step by step. The same menu hands it to Boltz-2 for co-folding with a protein, to ADMET-AI and eToxPred, and to the descriptor calculator.
Frequently asked questions
What is the difference between a MOL file and an SDF file?
A MOL file holds one molecule and ends at M END. An SDF holds any number of molecules, each a molfile followed by optional named data fields and a line of four dollar signs.[1] A one-molecule SDF without data is a MOL file plus that final line, so most programs read either.
How do I convert SDF to SMILES?
Read each record with a cheminformatics toolkit and write it as SMILES. SDF to SMILES does this online with RDKit and returns one canonical SMILES per record plus a combined table for multi-record files. With Open Babel the command is obabel input.sdf -O output.smi. Coordinates and data fields do not carry over.
Can I convert an InChIKey back to a structure?
Not directly. An InChIKey is a hash of the InChI, and a hash cannot be reversed.[3] Look the key up in PubChem or another database that stores the full structure. Pasting the key into SketchIQ's search box does that lookup and draws the compound when PubChem has it.
Which file format keeps stereochemistry?
SMILES, InChI, MOL, SDF, CDXML and KET all record it explicitly. MOL V3000, Extended SMILES and KET also keep racemic and relative stereo groups, which V2000 and standard InChI cannot. MOL2, PDB and PDBQT store no stereo flags; stereochemistry there exists only in the 3D coordinates, so it survives as long as the geometry does.
What is the best file format for docking?
Keep ligands as 3D SDF with the protonation state you intend, then convert to whatever the docking program needs. AutoDock Vina needs PDBQT, which SDF to PDBQT prepares; GNINA and DiffDock read SDF directly. Avoid PDB as a ligand source because it stores no bond orders.[8]
Is CDXML the same as CDX?
They hold the same information. CDX is ChemDraw's binary format and CDXML is its XML encoding, and ChemDraw converts between them without loss.[9] CDXML is easier for other software to read because it is text.


