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.0.12 npm package on 2026-09-11: the WebAssembly binary is 3.84 MB raw / 1.40 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.0.12/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>

Where this fits

If you're evaluating options for in-browser molecular analysis — sometimes searched as a "lightweight RDKit.js alternative" — chematic is a reasonable fit when you want a small, local-first WASM module with no C++ toolchain in the build. RDKit's own WASM build (RDKit.js) is far more feature-complete and long-validated; choose based on which feature set and validation history you need. See the validation and RDKit guide.