User Rating 0.0
Total Usage 0 times
Drop MOL / SDF file here or click to browse Supports V2000 MOL and multi-record SDF files (max 10 MB)
Is this tool helpful?

Your feedback helps us improve.

About

MDL CTFile (Connection Table File) is the de facto interchange format for 2D and 3D chemical structures, codified by Accelrys (now Dassault Systèmes) in the V2000 and V3000 specifications. The atom block encodes Cartesian coordinates (x, y, z) with element symbols, formal charges, and mass differences, while the bond block encodes connectivity with bond order (1 - 3) and stereo flags. Misinterpreting fixed-width column offsets or ignoring implicit hydrogen counts produces incorrect topology, which cascades into wrong 3D geometry, broken atom-atom mapping, and invalid reaction animations. This tool parses V2000 MOL and SDF files column-by-column per the Accelrys specification, validates atom/bond counts against the counts line, and generates well-formed X3D XML with CPK-colored Sphere nodes for atoms and oriented Cylinder nodes for bonds. The tool approximates bond geometry assuming rigid-body placement; it does not perform energy minimization or conformer optimization.

mdl ctfile x3d converter mol file sdf file chemical structure 3d molecule v2000 cpk coloring

Formulas

The V2000 counts line occupies line 4 of a MOL file (0-indexed line 3). Atom count is extracted from columns 0 - 2 and bond count from columns 3 - 5 (right-justified, 3-character fields). Each atom line provides Cartesian coordinates in Ångströms:

x = parseFloat(cols 0 - 9), y = parseFloat(cols 10 - 19), z = parseFloat(cols 20 - 29)

For X3D bond cylinders, the converter computes the midpoint, length, and rotation between two atom positions A and B:

midpoint = A + B2
L = (xB xA)2 + (yB yA)2 + (zB zA)2

The rotation axis is the cross product of the Y-axis unit vector j = (0, 1, 0) and the bond direction unit vector d:

axis = j × d, θ = acos(j d)

Where L is the Euclidean bond length in Ångströms, θ is the rotation angle in radians, and axis is the normalized rotation vector for the X3D rotation attribute formatted as "ax ay az angle".

Reference Data

ElementSymbolCPK ColorHexVan der Waals Radius (Å)Sphere Scale FactorAtomic Number
HydrogenHWhite#FFFFFF1.200.251
CarbonCDark Grey#5555551.700.406
NitrogenNBlue#3050F81.550.387
OxygenORed#FF0D0D1.520.378
FluorineFGreen#90E0501.470.359
PhosphorusPOrange#FF80001.800.4215
SulfurSYellow#FFFF301.800.4216
ChlorineClGreen#1FF01F1.750.4117
BromineBrDark Red#A629291.850.4335
IodineIViolet#9400941.980.4553
IronFeOrange#E066332.000.4626
CalciumCaDark Green#3DFF002.310.5020
SodiumNaPurple#AB5CF22.270.4911
MagnesiumMgGreen#8AFF001.730.4112
ZincZnSlate#7D80B01.390.3530
CopperCuSalmon#C880331.400.3529
SiliconSiGold#F0C8A02.100.4714
BoronBSalmon#FFB5B51.920.445
Unknown*Pink#FF14931.500.36 -

Frequently Asked Questions

The converter supports V2000 MOL files and multi-record SDF files. V3000 (extended) format uses a different line-based syntax with "M V30" prefixes and is not currently parsed. If you have V3000 files, convert them to V2000 using Open Babel or RDKit before uploading.
X3D Cylinder geometry defaults along the Y-axis. The converter computes the cross product of the Y-axis unit vector and the bond direction vector to find the rotation axis, then uses the arc-cosine of their dot product for the rotation angle. For bonds nearly parallel to the Y-axis (cross product magnitude < 0.0001), the rotation is set to zero or 180° to avoid numerical instability.
MOL files with 2D coordinates store all z-values as 0.0000, which is correct for planar depictions. Some files have placeholder coordinates when only connectivity (no geometry) was stored. The converter renders whatever coordinates are present. For proper 3D output, ensure your MOL file contains 3D-optimized coordinates (check the dimensionality flag on the counts line, column 20-21).
SDF files use the $$$$ delimiter between records. The converter splits on this delimiter and processes each record as a separate MOL block. Each molecule generates its own X3D Scene node within a single X3D document. You can also select a specific molecule index from the dropdown that appears after parsing.
The converter uses the standard Corey-Pauling-Koltun (CPK) color convention: Carbon is dark grey (#555555), Oxygen is red (#FF0D0D), Nitrogen is blue (#3050F8), Sulfur is yellow (#FFFF30), Hydrogen is white (#FFFFFF). Unrecognized elements default to pink (#FF1493). The reference table above lists all supported elements with their hex codes and Van der Waals radii.
The output conforms to the X3D 3.3 profile Immersive. It includes the XML declaration, DOCTYPE reference, and proper namespace. However, it uses a simplified scene graph without NavigationInfo or Viewpoint nodes. Most X3D viewers (view3dscene, Instant Reality, X3DOM in browsers) will render it correctly. For strict schema validation, you may need to add a Viewpoint node manually.