chem-wasm-lens — ChemDoodle JSON (CJSON) I/O  [ feature demo ]  [ SMILES SVG ]

Round-trip conversion: SMILES → CJSON → SVG  |  Compatible with ChemDoodle Web Components

1. SMILES → ChemDoodle JSON

Presets:

ChemDoodle JSON

Edit the JSON above and click Render to visualise custom CJSON.

SVG Preview

Render to see structure

CJSON format reference

{
  "m": [                          // array of molecules
    {
      "a": [                      // atoms
        { "x": 0.0, "y": 0.0, "l": "C" },         // x, y coords + element label
        { "x": 1.5, "y": 0.0, "l": "O", "c": -1 } // "c": formal charge (optional)
      ],
      "b": [                      // bonds
        { "b": 0, "e": 1, "o": 1 }  // begin index, end index, order (1/2/3)
      ]
    }
  ]
}
from_cjson_string(s) parses CJSON  |  to_cjson_string() serialises to CJSON  |  Bond order 1.5 (aromatic) is read as 2 (Kekulized)