Back to tools
COSMolKit 0.2.11 / Rust / WASMSMILES to SVG
Generate publication-ready 2D molecular structures entirely in your browser.
Preview
14 atoms / 15 bondsFrom SMILES to a scalable molecular drawing
COSMolKit parses the SMILES, generates 2D coordinates, and renders the molecular structure as SVG on this device. The resulting vector graphic can be copied or downloaded without uploading the molecule to a server.
PYTHON BACKEND
COSMolKit Python 0.2.11Build with the same COSMolKit core
The browser tool and Python package share the same Rust molecular graph, 2D coordinate generation, and SVG renderer.
INSTALL
pip install cosmolkit==0.2.11Python 3.9+ / Rust-native wheel
generate_svg.py
from pathlib import Path
from cosmolkit import Molecule
smiles = "Cn1c(=O)c2c(ncn2C)n(C)c1=O"
mol = Molecule.from_smiles(smiles).with_2d_coordinates()
svg = mol.to_svg(width=720, height=480)
Path("molecule.svg").write_text(svg, encoding="utf-8")