# D2 vs Excalidraw > D2 scores 65.3 (B) to Excalidraw's 54.5 (C) for diagrams as code. Prices, MCP, x402, uptime and agent notes side by side. - Canonical: https://www.anchorterminal.com/compare/d2-vs-excalidraw - Markdown: https://www.anchorterminal.com/compare/d2-vs-excalidraw.md (~2,400 tokens) - Slim: https://www.anchorterminal.com/compare/d2-vs-excalidraw.min.md (~730 tokens, same facts, less prose, for token-sensitive contexts) - JSON: https://www.anchorterminal.com/compare/d2-vs-excalidraw.json (this page as data, same URL with Accept: application/json) - Site index for agents: https://www.anchorterminal.com/llms.txt (full text: https://www.anchorterminal.com/llms-full.txt) - API: https://www.anchorterminal.com/api/v1/index.json - Updated: 2026-10-09 D2 scores 65.3 (B) on agent readiness against Excalidraw's 54.5 (C), and leads in 5 of 7 scored categories. Excalidraw leads on security & auth. Both do diagrams as code. - D2: grade B, 65.3/100, rank #322 of 950. Markdown https://www.anchorterminal.com/tools/d2.md · JSON https://www.anchorterminal.com/api/v1/tools/d2.json - Excalidraw: grade C, 54.5/100, rank #683 of 950. Markdown https://www.anchorterminal.com/tools/excalidraw.md · JSON https://www.anchorterminal.com/api/v1/tools/excalidraw.json - Best diagramming APIs and diagram-as-code for AI agents: https://www.anchorterminal.com/best/diagramming/index.md - All 99 diagrams comparisons: https://www.anchorterminal.com/compare/diagramming/index.md ## Which one, for what ### D2 (B) Good for: Agents that need to produce or edit architecture, sequence, grid, SQL table or class diagrams as reviewable text and render them locally. Ahead on: - Reliability, 68 against 50 - Agent ergonomics, 78 against 58 - Payments & pricing, 60 against 35 - Maintenance & community, 74 against 44 - Transparency & trust, 69 against 63 Also in its favour: - No key needed to call it Watch for: No 1.0 release. The maintainer lists a stable 1.0 with a formal grammar as a goal, and 0.8.2 changed Dagre and ELK layout output ### Excalidraw (C) Good for: Teams already on Excalidraw+ that want agents to create and edit hand-drawn diagrams, slides and wireframes in a shared workspace, and one-off sketches through the free MCP App. Ahead on: - Security & auth, 73 against 48 Also in its favour: - A hosted endpoint, with nothing to install Watch for: The API and MCP server are in public beta. The docs say endpoints, tool names and schemas may change and to expect breaking changes ## Score by category | Category | Weight | D2 | Excalidraw | Edge | | --- | --- | --- | --- | --- | | Reliability | 16% (20 this run) | 68 | 50 | D2 +18 | | Performance | 10%, pending | pending | pending | not scored in this run | | Schema & documentation | 13% (16.2 this run) | 65 | 65 | even | | Agent ergonomics | 13% (16.2 this run) | 78 | 58 | D2 +20 | | Security & auth | 14% (17.5 this run) | 48 | 73 | Excalidraw +25 | | Payments & pricing | 10% (12.5 this run) | 60 | 35 | D2 +25 | | Task success | 10%, pending | pending | pending | not scored in this run | | Maintenance & community | 7% (8.8 this run) | 74 | 44 | D2 +30 | | Transparency & trust | 7% (8.8 this run) | 69 | 63 | D2 +6 | | Negative events | ≤15 | 0 | -2 | | | **Total** | | **65.3 · B** | **54.5 · C** | | ## Facts side by side | Fact | D2 | Excalidraw | | --- | --- | --- | | Kind | SDK + MCP | HTTP API | | Vendor | D2 project (The Hack Foundation) | Excalidraw s.r.o. | | Hosted endpoint | no (local only) | `https://api.excalidraw.com/api/v1/mcp` | | Transports | | HTTP, Streamable HTTP | | Auth | None | API key | | Pricing | Free | Freemium | | x402 | no | no | | Licence | MPL-2.0 | Excalidraw+ is a proprietary service under Excalidraw's terms of use. The editor and the MCP App on GitHub are MIT | | Tools exposed | none | 37 | | Read-only variant documented | no | no | | llms.txt | no | yes | | Last release | 2026-09-07 | 2026-09-01 | | Terms last updated | no document linked | no date given | | Privacy policy last updated | no document linked | 2021-04-29 | | Customer content may train models | | not found in the text | | Terms restrict automated access | | yes | | Terms restrict benchmarking | | not found in the text | | Terms or service can change without notice | | yes | | Arbitration or class-action waiver | | yes | | Popularity | 26k stars, 22k npm/wk | 134k stars, 676k npm/wk | ## Verdicts **D2.** A single local command turns text into a diagram in six formats with no account, key or network call, and CI passes on the default branch. The language is at 0.9.0 with no stable release, its company sponsor has shut down, and one maintainer with limited time wrote every commit since July. **Excalidraw.** Excalidraw+ keys carry read or full permission, route restrictions and an expiry, and the MCP server shows a key only the tools its routes allow. The API and MCP server are in public beta with breaking changes expected, sit behind the $6 Plus plan, and have no published OpenAPI file, SDK or idempotency keys. ## Before you call either ### D2 1. Check the exit status of `d2`, never the output file. The man page says a partial render can be written when an error occurs 2. Run `d2 validate file.d2` before rendering, and `d2 fmt` to normalise the source 3. Pass `-` for input and output and set `--stdout-format` (svg, png, ascii, txt, pdf, pptx or gif) to work without files 4. Use `--stdout-format ascii` when the reader is a text-only model 5. Pass `--bundle=false` or review image URLs and imports before rendering D2 text from an untrusted source. Release 0.9.0 fetches remote images when bundling ### Excalidraw 1. Send `Authorization: Bearer ` to https://api.excalidraw.com/api/v1. For MCP, use `POST /api/v1/mcp` only. The server is stateless and answers 405 to other methods 2. Use a personal key to reach the owner's private collection with the collection ID `private`. A workspace admin must enable personal keys first 3. Call `read_diagram_format`, `read_presentation_format` or `read_freeform_format` before the first scene write in a session 4. Write with `edit_scene_content` and bind arrows through `startBinding` and `endBinding` with `tempId` references. `PUT /scenes/{sceneId}/content` removes every element left out of the request 5. Stay under 600 requests a minute per IP and wait until `X-RateLimit-Reset` after a 429 ## Questions ### Which is better for AI agents, D2 or Excalidraw? D2 scores 65.3 (B) on agent readiness against Excalidraw's 54.5 (C), and leads in 5 of 7 scored categories. Excalidraw leads on security & auth. ### Can an agent call D2 and Excalidraw without installing anything? No hosted endpoint is listed for D2. Excalidraw has a hosted endpoint at https://api.excalidraw.com/api/v1/mcp. ### Are D2 and Excalidraw open source? Yes. D2 is open source (MPL-2.0). Excalidraw is open source (Excalidraw+ is a proprietary service under Excalidraw's terms of use. The editor and the MCP App on GitHub are MIT). ## For agents - This comparison as JSON: https://www.anchorterminal.com/compare/d2-vs-excalidraw.json, and with the fewest tokens: https://www.anchorterminal.com/compare/d2-vs-excalidraw.min.md - Over MCP at https://www.anchorterminal.com/mcp (no key): `compare_tools {"a": "d2", "b": "excalidraw"}`. From a terminal: `anchor compare d2 excalidraw` - Each listing in full: https://www.anchorterminal.com/api/v1/tools/d2.json and https://www.anchorterminal.com/api/v1/tools/excalidraw.json ## Other comparisons with D2 or Excalidraw - [Cloudviz API vs D2](https://www.anchorterminal.com/compare/cloudviz-vs-d2.md) - [Cloudviz API vs Excalidraw](https://www.anchorterminal.com/compare/cloudviz-vs-excalidraw.md) - [D2 vs Diagrams.so API + MCP](https://www.anchorterminal.com/compare/d2-vs-diagrams-so.md) - [D2 vs Mural MCP](https://www.anchorterminal.com/compare/d2-vs-mural-mcp.md) - [D2 vs Whimsical MCP](https://www.anchorterminal.com/compare/d2-vs-whimsical.md) - [Diagrams.so API + MCP vs Excalidraw](https://www.anchorterminal.com/compare/diagrams-so-vs-excalidraw.md) - [draw.io + MCP vs Excalidraw](https://www.anchorterminal.com/compare/drawio-vs-excalidraw.md) - [Eraser API + MCP vs Excalidraw](https://www.anchorterminal.com/compare/eraser-vs-excalidraw.md) - [Excalidraw vs Kroki](https://www.anchorterminal.com/compare/excalidraw-vs-kroki.md) - [Excalidraw vs Lucid API + MCP](https://www.anchorterminal.com/compare/excalidraw-vs-lucid.md) - [Excalidraw vs Mermaid Chart MCP](https://www.anchorterminal.com/compare/excalidraw-vs-mermaid-chart.md) - [Excalidraw vs Mural MCP](https://www.anchorterminal.com/compare/excalidraw-vs-mural-mcp.md) - [Excalidraw vs PlantUML](https://www.anchorterminal.com/compare/excalidraw-vs-plantuml.md) - [Excalidraw vs Structurizr + MCP](https://www.anchorterminal.com/compare/excalidraw-vs-structurizr.md) - [Excalidraw vs tldraw SDK + MCP](https://www.anchorterminal.com/compare/excalidraw-vs-tldraw.md) - [Excalidraw vs Whimsical MCP](https://www.anchorterminal.com/compare/excalidraw-vs-whimsical.md) - [D2 vs draw.io + MCP](https://www.anchorterminal.com/compare/d2-vs-drawio.md) - [D2 vs Eraser API + MCP](https://www.anchorterminal.com/compare/d2-vs-eraser.md) - [D2 vs Kroki](https://www.anchorterminal.com/compare/d2-vs-kroki.md) - [D2 vs Lucid API + MCP](https://www.anchorterminal.com/compare/d2-vs-lucid.md) - [D2 vs Mermaid Chart MCP](https://www.anchorterminal.com/compare/d2-vs-mermaid-chart.md) - [D2 vs PlantUML](https://www.anchorterminal.com/compare/d2-vs-plantuml.md) - [D2 vs Structurizr + MCP](https://www.anchorterminal.com/compare/d2-vs-structurizr.md) - [D2 vs tldraw SDK + MCP](https://www.anchorterminal.com/compare/d2-vs-tldraw.md)