Chemistry
The chemical structure editor draws molecules for electronic lab notebooks, compound registration and LIMS. Draw with the mouse, a pen or the keyboard: atoms of any element, single, double, triple and wedged bonds, chains, rings, charges and groups such as OMe or Boc. The formula, the average weight and the exact mass follow every change, and a drawing that breaks the rules of valence is marked where it goes wrong.
It reads and writes SMILES, molfiles (V2000 and V3000) and SD files, gives one canonical SMILES per structure however it was drawn, labels stereocentres R or S and double bonds E or Z, and lays a rough drawing out again without losing its stereochemistry. An SD file opens as records to step through and to search for a substructure; a reaction arrow turns a drawing into a reaction.
Try it with your own molfiles and SD files in confidence: they are opened by your browser, on your device. Nothing is uploaded, no copy reaches us or anyone else, and nothing is kept once you close this tab.
Draw, check and register a structure
A made-up registration form for a reference sample of (S)-ibuprofen, drawn by hand and a little untidy. The chemistry is real; the registry number, project, notebook and chemist are invented. Fill in the form from the drawing, then load a mistyped version and see the check find it.
- Registry number
- KX-004127 (pending)
- Project
- Larkspur - reference standards
- Notebook
- ELN-2026-0318, page 42
- Submitted by
- R. Ashworth, 24 October 2026
- Formula
- -
- Weight
- -
- Canonical SMILES
- -
- Stereochemistry
- -
// Node 18 or later, from the Gold package: check a batch of submissions and register the new ones.
import { readFileSync, writeFileSync } from 'node:fs';
import { readSdf, writeSdf, writeSmiles, perceiveStereo, molecularFormula, molecularWeight, valenceProblems } from './dist/node/bmx-chem-editor.mjs';
const known = new Set(readFileSync('registry/canonical.smi', 'utf8').split('\n').filter(Boolean));
let next = Number(readFileSync('registry/next-id.txt', 'utf8'));
const registered = [];
for (const { mol, data, problems } of readSdf(readFileSync('submissions/batch-17.sdf', 'utf8'))) {
const issues = [...problems, ...valenceProblems(mol)];
if (issues.length) { console.log(`${mol.name}: held back - ${issues.map(p => p.message).join(' ')}`); continue; }
const smiles = writeSmiles(perceiveStereo(mol), { canonical: true });
if (known.has(smiles)) { console.log(`${mol.name}: already registered`); continue; }
known.add(smiles);
const id = `KX-${String(next++).padStart(6, '0')}`;
registered.push({ ...mol, properties: { ...data, REG_ID: id, FORMULA: molecularFormula(mol).text, MW: molecularWeight(mol).toFixed(2), SMILES: smiles } });
}
writeFileSync('out/registered.sdf', writeSdf(registered));
writeFileSync('registry/next-id.txt', String(next));
Searching a compound list
An SD file of twelve well-known small molecules, built in this page, with made-up sample numbers, freezer places and amounts. Search it for a benzene ring or a carboxylic acid, step through the matches, or open the reaction that makes aspirin. Type your own SMARTS in the Search view.
Get the code
<script src="/assets/bmx-components.min.js"></script> <bmx-chem-editor id="ch-lib" label="Compound list" style="inline-size: 100%; --bmx-chem-editor-height: 22rem"></bmx-chem-editor>