Cheminformatics in the browser

chematic compiles to WebAssembly, so molecule parsing, descriptor calculation, fingerprints, 2D depiction, and similarity search can run directly in a browser tab — no server round trip, no data leaving the page. It's a practical option wherever you want a lightweight, local-first chemistry toolkit in JavaScript or TypeScript, from a one-off analysis widget to a full offline compound explorer.

What runs client-side

  • SMILES / SMARTS parsing and canonicalization
  • Molecular descriptors (molecular weight, LogP, TPSA, H-bond donor/acceptor counts, and more)
  • Fingerprints (ECFP, MACCS, and others) and Tanimoto/Dice similarity search
  • 2D structure depiction, rendered as SVG
  • Substructure search via SMARTS matching

Everything above is local computation — nothing is sent to a server. The one exception in the whole project is the AI-agent tool name_to_smiles, which is part of the separate MCP server (see AI agents), not the browser/WASM build.

Bundle size

Measured directly from the published @kent-tokyo/chematic@1.1.7 npm package on 2026-10-18: the WebAssembly binary is 6.91 MB raw / 2.50 MB gzipped. This is a snapshot of one release, not a permanent spec — it will change as the library grows. The default build includes 2D depiction (via resvg/rustybuzz), which is most of that size; see the docs for feature-gated builds if you don't need it.

Install

npm install @kent-tokyo/chematic

Pure Rust by default: The optional native-inchi feature vendors the IUPAC InChI C reference implementation for bit-exact standard InChI output. It is opt-in and isolated to the chematic-inchi crate. See Validation for the full maturity breakdown of what's stable, partial, or experimental.

CDN — no build step

The published npm package works directly from a CDN, with no bundler — verified live against jsDelivr (and mirrored on unpkg) before publishing this page. Always pin an exact version in production — an unpinned @latest URL can change behavior under you on a future release.

<script type="module">
  import init, { parse_smiles } from "https://cdn.jsdelivr.net/npm/@kent-tokyo/chematic@1.1.7/chematic_wasm.js";

  await init();
  const mol = parse_smiles("CC(=O)Oc1ccccc1C(=O)O"); // aspirin
  console.log(mol.molecular_weight().toFixed(2)); // 180.16
  mol.free();
</script>

Why browser teams choose chematic

Choose chematic when a molecular feature belongs in the browser rather than behind an API. Its WebAssembly package keeps parsing, calculation, search, and depiction alongside your interface, with no chemistry server to operate for those tasks. The same engine is also available to Python and Rust code, which lets a browser proof of concept grow into another product surface without swapping chemistry implementations. See the validation recordfor the published browser-package checks and feature boundaries.