# D2 vs PlantUML > PlantUML scores 66.9 (B) on agent readiness against D2's 65.3 (B), and leads in 3 of 7 scored categories. Both do diagram as code. Category scores, facts, verdicts and agent notes side by side. - Canonical: https://www.anchorterminal.com/compare/d2-vs-plantuml - Markdown: https://www.anchorterminal.com/compare/d2-vs-plantuml.md (~2,050 tokens) - Slim: https://www.anchorterminal.com/compare/d2-vs-plantuml.min.md (~430 tokens, same facts, less prose, for token-sensitive contexts) - JSON: https://www.anchorterminal.com/compare/d2-vs-plantuml.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 PlantUML scores 66.9 (B) on agent readiness against D2's 65.3 (B), and leads in 3 of 7 scored categories. Both do diagram as code. - D2: grade B, 65.3/100, rank #295 of 842. Markdown https://www.anchorterminal.com/tools/d2.md · JSON https://www.anchorterminal.com/api/v1/tools/d2.json - PlantUML: grade B, 66.9/100, rank #251 of 842. Markdown https://www.anchorterminal.com/tools/plantuml.md · JSON https://www.anchorterminal.com/api/v1/tools/plantuml.json ## 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. 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 ### PlantUML (B) Good for: Agents that write sequence, class, state, component, deployment, Gantt or C4 diagrams as text and render them locally or in CI. Ahead on: - Reliability, 83 against 68 Watch for: The default security profile is LEGACY, which gives diagram text full access to local files and URLs through `!include`. The docs say it will be removed, with no date ## Score by category | Category | Weight | D2 | PlantUML | Edge | | --- | --- | --- | --- | --- | | Reliability | 16% (20 this run) | 68 | 83 | PlantUML +15 | | 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 | 78 | even | | Security & auth | 14% (17.5 this run) | 48 | 50 | PlantUML +2 | | Payments & pricing | 10% (12.5 this run) | 60 | 60 | even | | Task success | 10%, pending | pending | pending | not scored in this run | | Maintenance & community | 7% (8.8 this run) | 74 | 73 | D2 +1 | | Transparency & trust | 7% (8.8 this run) | 69 | 73 | PlantUML +4 | | Negative events | ≤15 | 0 | -2 | | | **Total** | | **65.3 · B** | **66.9 · B** | | ## Facts side by side | Fact | D2 | PlantUML | | --- | --- | --- | | Kind | SDK + MCP | SDK + MCP | | Vendor | D2 project (The Hack Foundation) | PlantUML project (Arnaud Roques) | | Hosted endpoint | no (local only) | no (local only) | | Transports | | | | Auth | None | None | | Pricing | Free | Free | | x402 | no | no | | Licence | MPL-2.0 | GPL-3.0-or-later | | Read-only variant documented | no | no | | llms.txt | no | no | | Last release | 2026-09-07 | 2026-09-05 | | Terms last updated | no document linked | no document linked | | Privacy policy last updated | no document linked | no document linked | | Customer content may train models | | | | Terms restrict automated access | | | | Terms restrict benchmarking | | | | Terms or service can change without notice | | | | Arbitration or class-action waiver | | | | Popularity | 26k stars, 22k npm/wk | 13k stars, 207 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. **PlantUML.** One Java command reads diagram text from stdin and writes PNG, SVG, PDF or ASCII with no account, and CI passed on the last eight pushes. The default security profile lets diagram text read any local file and fetch any URL, and the documentation still lists chronology diagrams that release 1.2026.2 switched off. ## 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 ### PlantUML 1. Set `PLANTUML_SECURITY_PROFILE` to `SANDBOX` or `ALLOWLIST` before rendering text from an untrusted source. The default profile lets `!include` read local files and fetch URLs 2. Run `java -jar plantuml.jar --check-syntax` with `-stdrpt` first and read the exit status. Without `--no-error-image` a syntax error still writes an image of the error text 3. Pass `-pipe` with `--svg`, `--txt` or `--utxt` to work without files. `--txt` output suits a text-only model 4. Start the local server as `-picoweb:8080:127.0.0.1`. Without the bind address it listens on every interface 5. Use `npx -y @plantuml/mcp-js` when no Java runtime is present. It renders SVG only, so use the jar for PNG or PDF ## Questions ### Which is better for AI agents, D2 or PlantUML? PlantUML scores 66.9 (B) on agent readiness against D2's 65.3 (B), and leads in 3 of 7 scored categories. ### Are D2 and PlantUML open source? Yes. D2 is open source (MPL-2.0). PlantUML is open source (GPL-3.0-or-later). ## For agents - This comparison as JSON: https://www.anchorterminal.com/compare/d2-vs-plantuml.json, and with the fewest tokens: https://www.anchorterminal.com/compare/d2-vs-plantuml.min.md - Over MCP at https://www.anchorterminal.com/mcp (no key): `compare_tools {"a": "d2", "b": "plantuml"}`. From a terminal: `anchor compare d2 plantuml` - Each listing in full: https://www.anchorterminal.com/api/v1/tools/d2.json and https://www.anchorterminal.com/api/v1/tools/plantuml.json ## Other comparisons with D2 or PlantUML - [Cloudviz API vs D2](https://www.anchorterminal.com/compare/cloudviz-vs-d2.md) - [Cloudviz API vs PlantUML](https://www.anchorterminal.com/compare/cloudviz-vs-plantuml.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 PlantUML](https://www.anchorterminal.com/compare/diagrams-so-vs-plantuml.md) - [draw.io + MCP vs PlantUML](https://www.anchorterminal.com/compare/drawio-vs-plantuml.md) - [Eraser API + MCP vs PlantUML](https://www.anchorterminal.com/compare/eraser-vs-plantuml.md) - [Lucid API + MCP vs PlantUML](https://www.anchorterminal.com/compare/lucid-vs-plantuml.md) - [Mermaid Chart MCP vs PlantUML](https://www.anchorterminal.com/compare/mermaid-chart-vs-plantuml.md) - [Mural MCP vs PlantUML](https://www.anchorterminal.com/compare/mural-mcp-vs-plantuml.md) - [PlantUML vs Whimsical MCP](https://www.anchorterminal.com/compare/plantuml-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 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 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) - [PlantUML vs Structurizr + MCP](https://www.anchorterminal.com/compare/plantuml-vs-structurizr.md) - [PlantUML vs tldraw SDK + MCP](https://www.anchorterminal.com/compare/plantuml-vs-tldraw.md)