COSMolKit Tools

Loading browser workspace

Back to tools

MOL2 to SMILES converter

Convert MOL2 to SMILES locally in your browser with COSMolKit, Rust, and WebAssembly.

COSMolKit 0.3.0 / Rust / WASM
Tripos structure
.smi

Source

227 characters

Converted output

3 atoms / 2 bonds
Converted locally. No structure data is uploaded.
SUPPORTED FORMATS

Formats available in this converter

COSMolKit reads and writes the molecular graph locally. Coordinate-dependent exports use the coordinates available in the source or generated by the selected workflow.

Input formats

SMILES; MOL or SDF V2000/V3000; Tripos MOL2; PDB; PDBx/mmCIF; XYZ.

Output formats

SMILES; MOL V2000/V3000; SDF V2000/V3000; PDB; SVG depiction.

Common molecular file conversions

Convert files to SMILES: SDF to SMILES, MOL to SMILES, MOL2 to SMILES, PDB to SMILES, mmCIF to SMILES, and XYZ to SMILES.

Export from SMILES: SMILES to SDF V2000/V3000, SMILES to MOL V2000/V3000, SMILES to PDB, and SMILES to SVG.

Convert molecular structure files: MOL2 to SDF, MOL2 to PDB, SDF to MOL, SDF to PDB, PDB to SDF, mmCIF to PDB, and XYZ to SDF.

Create a 2D structure image: Render SMILES, MOL, SDF, MOL2, PDB, mmCIF, or XYZ input as a scalable SVG molecular depiction.

PYTHON BACKEND

Run the same conversion with COSMolKit

The example tracks the formats and source currently selected above.

COSMolKit Python 0.3.0
INSTALLpip install cosmolkit==0.3.0

Python 3.9+ / Rust-native wheel

convert_molecule.py
from pathlib import Path
from cosmolkit import Molecule

source = "@<TRIPOS>MOLECULE\nEthanol\n3 2 0 0 0\nSMALL\nNO_CHARGES\n\n@<TRIPOS>ATOM\n1 C1 0.0000 0.0000 0.0000 C.3 1 ETO 0.0000\n2 C2 1.5200 0.0000 0.0000 C.3 1 ETO 0.0000\n3 O1 2.1200 1.2100 0.0000 O.3 1 ETO 0.0000\n@<TRIPOS>BOND\n1 1 2 1\n2 2 3 1\n"
mol = Molecule.read_mol2_from_str(source)
output = mol.to_smiles()

Path("molecule.smi").write_text(output, encoding="utf-8")

COSMolKit Tools

Loading browser workspace