Excalidraw Share Links Are Just an ID and a Key

October 6, 2026 · engineering · tools

An Excalidraw share link does not contain your drawing. It contains a scene ID and a decryption key. Your drawing is encrypted on your device, uploaded as a blob nobody can read, and only someone holding the link can decrypt it. I rebuilt the entire pipeline in a Python script and uploaded a diagram without ever pressing the app's Share button.

1. What I wanted

A post was going around showing AI drawing live inside Excalidraw, sketching out explanations stroke by stroke. I asked my assistant if it could do the same. Honest answer: it can't draw inside the app. But a .excalidraw file is just JSON, a list of boxes, arrows, and text. So it wrote one by hand: a full reference diagram for Euclidean distance, 61 real editable elements, recreated from a diagram in the thread. Then it wanted a share link for it, the way you'd get from pressing Share.

2. My first guess was wrong

Share links look like excalidraw.com/#json=<stuff>. I assumed <stuff> was the drawing itself, so I compressed my scene and pasted it into the fragment. The app opened a blank canvas and stared back at me. Nothing.

Blank Excalidraw canvas after pasting scene data into the URL
What I tried first: the whole scene pasted into #json=. Blank canvas.
The Euclidean distance diagram rendered from a real share link
What actually works: a real share link. The full diagram, editable.

3. What the link actually is

The fragment is two things separated by a comma: a scene ID and a decryption key. The app fetches an encrypted blob from Excalidraw's servers and decrypts it in your browser. The server never sees your drawing. It never even sees the key, because URL fragments are never sent to servers. This is end-to-end encryption done right, and it's the default for every share link.

Anatomy of a share link: domain, fragment marker, scene ID, decryption key
Every share link has the same four parts. The key never leaves the fragment.

Here is what Excalidraw's server actually stores for my diagram. All 61 elements, the text, the arrows, the colors, reduced to this:

Hex dump of the encrypted payload stored on Excalidraw's server
4,226 bytes of noise. The readable bit at the top is just the format label. Without the key from the link, none of the rest means anything.

4. The pipeline

Diagram of the share link pipeline: scene JSON, deflate, AES-128-GCM encrypt, POST, blob stored, share link
The full pipeline, drawn as an Excalidraw diagram itself. The key is generated on your device and only ever lives in the URL fragment.

The exact recipe, pulled from a published open-source uploader instead of guessed: take the scene JSON, compress it with zlib, encrypt it with AES-128-GCM using a random 16-byte key and a random 12-byte IV, wrap it in Excalidraw's chunk format, and POST the raw bytes to json.excalidraw.com/api/v2/post/. The server hands back an ID. The link is excalidraw.com/#json=<id>,<key>, with the key in base64.

Try the actual primitive

Type anything. Your browser encrypts it with AES-128-GCM, the same algorithm guarding the diagram. Nothing leaves your device.

5. The upload

The Python version is about 30 lines. One request, 0.6 seconds, scene ID received.

key = os.urandom(16); iv = os.urandom(12)
inner = concat(b"{}", scene_bytes)
ct = AESGCM(key).encrypt(iv, zlib.compress(inner), None)
payload = concat(b'{"version":2,"compression":"pako@1",'
                 b'"encryption":"AES-GCM"}', iv, ct)
r = requests.post("https://json.excalidraw.com/api/v2/post/",
                  data=payload)
scene_id = r.json()["id"]
url = f"https://excalidraw.com/#json=scene_id,b64(key)"

6. Proof

Trust, but verify. I downloaded the blob back from their server, decrypted it, decompressed it: all 61 elements, byte for byte identical to the original. Then I opened the link in the real app. The full diagram rendered, editable, every arrow and label in place.

The live diagram

Euclidean (L2) distance: the straight-line gap. Opens editable in excalidraw.com. The .excalidraw source files are linked below.

Open it →

7. What this unlocks

Any diagram my assistant generates is now one script run away from a real editable Excalidraw link. No export, no import, no dragging files into a browser tab. It writes the JSON, runs the uploader, sends the link.

A share link is a treasure map where X marks a locked box and the key is taped to the back of the map.