The Best Diagram as Code Tools in 2026
Ten diagram-as-code tools compared on what a paid tier actually adds, since most of the category ships free, with prices checked on vendor pricing pages in September 2026.
The best diagram-as-code tool for most developers in 2026 is Mermaid. It's free, MIT-licensed, and rendered natively by GitHub, GitLab and Notion, with the hosted Mermaid Chart Plus tier starting at $10/user/mo billed annually. PlantUML, Graphviz and D2 are also fully free and open source, with no paid tier at all.
Pick Diagrams (mingrammer) to generate cloud architecture diagrams straight from Python, and Excalidraw or draw.io when a teammate needs to hand-edit the result. Eraser ($15/member/mo Starter) and Ilograph ($18/mo Pro) are the paid SaaS options, built for AI-assisted or multi-perspective architecture diagrams. Structurizr's hosted cloud service is being shut down with no replacement, so its only paid path now is a self-hosted server priced in GBP.
Key facts10 tools compared: Mermaid, draw.io (diagrams.net), Excalidraw, PlantUML, Graphviz, D2…
- 10 tools compared: Mermaid, draw.io (diagrams.net), Excalidraw, PlantUML, Graphviz, D2, Diagrams (mingrammer), Eraser, Structurizr, Ilograph
- draw.io (diagrams.net) (best for: Teams that want a real diagram editor with zero license cost and zero vendor lock-in): Free forever, Apache 2.0 license; no paid tier, no Enterprise SSO upsell.
- Excalidraw (best for: Teams that want a hand-drawn look for architecture sketches, not a polished formal diagram): Free, MIT license; Excalidraw+ Plus $6/mo per user, billed monthly (annual billing saves 14%).
- PlantUML (best for: Teams that need dense UML: class, sequence, state and component diagrams from a compact text syntax): Free, LGPL-3.0 license; no paid tier or hosted product.
A diagram as code tool turns a text file, or in one case a Python script, into a rendered diagram. The diagram then lives in version control next to the system it describes, updating in the same pull request.
That is the whole pitch against a drag-and-drop canvas: no drift between the doc and the architecture, and a diff you can actually review.
Toolradar data: the directory homepage lists 10,797+ tools across 401+ categories, checked 25 September 2026.
Its closest tracked category, best diagramming tools, evaluated 53 diagramming tools to build that ranking, checked September 2026.
That list leans toward whiteboard tools like Miro and Lucidchart rather than code-first ones, so open Mermaid, draw.io, Excalidraw and Eraser there for the wider catalog listing.
How we ranked: ten tools, each read on its own site or GitHub repository on 25 September 2026.
The order follows license and cost, whether a CI pipeline can render the output without a browser, and what a paid tier buys once the free path runs out.
A whiteboard-first tool like Miro or Lucidchart is a different buy than a text file your CI renders on every push.
That comparison lives in the diagram tools guide on Toolradar.
Top Picks
Based on features, real-world fit, and value for money.
| Tool | Pricing | Best for |
|---|---|---|
| Mermaid | Free, MIT license (Mermaid.js); Mermaid Chart Plus $10/user/mo, Premium $20/user/mo, both billed annually. | Teams that want a diagram GitHub, GitLab and Notion already render with no extension |
| draw.io (diagrams.net) | Free forever, Apache 2.0 license; no paid tier, no Enterprise SSO upsell. | Teams that want a real diagram editor with zero license cost and zero vendor lock-in |
| Excalidraw | Free, MIT license; Excalidraw+ Plus $6/mo per user, billed monthly (annual billing saves 14%). | Teams that want a hand-drawn look for architecture sketches, not a polished formal diagram |
| PlantUML | Free, LGPL-3.0 license; no paid tier or hosted product. | Teams that need dense UML: class, sequence, state and component diagrams from a compact text syntax |
| Graphviz | Free, Eclipse Public License 2.0; no paid tier or hosted product. | Teams that need the underlying graph-layout engine other diagram tools build on top of |
| D2 | Free, MPL-2.0 license; Terrastruct lists no paid tier for D2 today. | Teams that want a modern syntax with built-in themes, sketch mode and animated diagrams |
| Diagrams (mingrammer) | Free, MIT license; a Python library, no paid tier or hosted product. | Teams that want cloud architecture diagrams generated from a Python script, not drawn by hand |
| Eraser | Free (3 files, 3 AI diagrams); Starter $15/member/mo annual ($20 mo); Business $45/member/mo annual ($60 mo). | Teams that want AI-generated diagrams alongside Markdown docs in one collaborative workspace |
| Structurizr | Cloud service end of life, no replacement; self-hosted server from £300/mo, 1-20 users, billed annually; no USD price. | Teams already committed to the C4 model who can self-host, not new teams starting today |
| Ilograph | Free ($0/mo, 14-day diagram history); Pro from $18/mo (annual) or $22/mo (monthly); Team from $25/editor/mo (annual). | Teams that need one architecture model to generate several interactive, zoomable perspectives |
Pricing read from each vendor's own published pricing page, checked Sep 2026. Every vendor here publishes a price.
Best for: Teams that want a diagram GitHub, GitLab and Notion already render with no extension
PricingFree, MIT license (Mermaid.js); Mermaid Chart Plus $10/user/mo, Premium $20/user/mo, both billed annually.
Best for: Teams that want a real diagram editor with zero license cost and zero vendor lock-in
PricingFree forever, Apache 2.0 license; no paid tier, no Enterprise SSO upsell.
Best for: Teams that want a hand-drawn look for architecture sketches, not a polished formal diagram
PricingFree, MIT license; Excalidraw+ Plus $6/mo per user, billed monthly (annual billing saves 14%).
Best for: Teams that need dense UML: class, sequence, state and component diagrams from a compact text syntax
PricingFree, LGPL-3.0 license; no paid tier or hosted product.
Best for: Teams that need the underlying graph-layout engine other diagram tools build on top of
PricingFree, Eclipse Public License 2.0; no paid tier or hosted product.
Best for: Teams that want a modern syntax with built-in themes, sketch mode and animated diagrams
PricingFree, MPL-2.0 license; Terrastruct lists no paid tier for D2 today.
Best for: Teams that want cloud architecture diagrams generated from a Python script, not drawn by hand
PricingFree, MIT license; a Python library, no paid tier or hosted product.
Best for: Teams that want AI-generated diagrams alongside Markdown docs in one collaborative workspace
PricingFree (3 files, 3 AI diagrams); Starter $15/member/mo annual ($20 mo); Business $45/member/mo annual ($60 mo).
Best for: Teams already committed to the C4 model who can self-host, not new teams starting today
PricingCloud service end of life, no replacement; self-hosted server from £300/mo, 1-20 users, billed annually; no USD price.
Best for: Teams that need one architecture model to generate several interactive, zoomable perspectives
PricingFree ($0/mo, 14-day diagram history); Pro from $18/mo (annual) or $22/mo (monthly); Team from $25/editor/mo (annual).
What it is
Diagram as code means the diagram's source is plain text (or, for Diagrams, Python) that a renderer turns into an SVG, PNG or PDF. The source is diffable, reviewable in a pull request, and reproducible on any machine that has the renderer installed, unlike a file saved inside a proprietary canvas app.
The category splits into two camps.
General-purpose text-to-diagram languages (Mermaid, PlantUML, D2, Graphviz) draw flowcharts, sequence diagrams and graphs from a compact syntax.
Architecture-specific tools (Structurizr, Ilograph, Diagrams) model a system's structure, usually against the C4 model or a cloud provider's icon set, and generate several views from one source.
Excalidraw and draw.io sit at the edge of the category: both are canvas editors first, with a code-like layer (Mermaid-to-Excalidraw import, an XML/JSON file format) bolted on rather than built in.
Why it matters
Every tool on this list except three is free with no paid tier at all. PlantUML (LGPL-3.0), Graphviz (Eclipse Public License 2.0), D2 (MPL-2.0) and Diagrams (MIT) publish no commercial product at all.
The real decision is which syntax your team will actually keep writing, not which invoice is smaller.
Mermaid's core library is MIT-licensed and free; its maker sells the hosted Mermaid Chart on top once the free plan's 3-diagram cap gets in the way.
Devshot data: 28,000 developer readers get this brief, and the audience file updated 20 September 2026 puts the open rate at 30%.
For that audience, the tool that renders in CI without a browser usually beats one that only works inside a hosted editor. Mermaid, PlantUML, Graphviz, D2 and Diagrams all do this, via a CLI. Structurizr is the cautionary case here.
Its cloud service is end of life with no replacement, confirmed on the vendor's own docs in September 2026, so a team that built workflows around it now needs to migrate to the self-hosted server product or a local export.
Latency and lock-in are the other axis.
A CLI tool you run in a GitHub Action never depends on a vendor's uptime. A hosted SaaS like Eraser or Ilograph trades that independence for AI generation, team libraries and a shareable link.
The CI/CD tools guide and the Git clients guide cover the pipelines these diagrams usually render inside.
Key features to look for
Pricing
Seven of these ten tools are fully free with no paid tier at all. PlantUML (LGPL-3.0), Graphviz (Eclipse Public License 2.0), D2 (MPL-2.0), Diagrams (MIT), draw.io (Apache 2.0), and the core Mermaid and Excalidraw libraries (both MIT) all ship under a permissive license with no commercial edition to buy.
The decision for those seven is syntax and rendering fit, not price.
Mermaid Chart, the hosted product built on top of free Mermaid, is the cheaper of the two per-seat SaaS plans built on an open-source base.
A higher Premium tier exists for teams that need more AI credits. Excalidraw+ undercuts it further, the cheapest paid tier on the page, with a 14% discount for annual billing.
Eraser and Ilograph are the two dedicated paid SaaS products.
Both scale from a mid-teens monthly seat price on their entry paid tier toward a team plan in the twenties to forties per seat; the pricing table below has the exact figures and billing terms. Structurizr is the outlier.
Its cloud service is end of life with no replacement, and the surviving Structurizr server product publishes prices only in GBP, from £300/mo for 1-20 users billed annually, with no USD figure on its pricing page as of September 2026.
| Plan | Price | Best for |
|---|---|---|
| Mermaid (core library) | Free | MIT license, no diagram or usage limit |
| Mermaid Chart Basic | Free | 3 diagrams, limited size, limited AI credits |
| Mermaid Chart Plus | $10/user/mo billed annually | Unlimited diagrams, 300 AI credits a year |
| Mermaid Chart Premium | $20/user/mo billed annually | 2,000 AI credits a year, unlimited viewer seats |
| Mermaid Chart Enterprise | Custom quote | SSO, custom contract, dedicated CSM |
| draw.io (diagrams.net) | Free | Apache 2.0, no paid tier of any kind |
| Excalidraw (core app) | Free | MIT license, 1 infinite scene, unlimited collaborators |
| Excalidraw+ Plus | $6/mo per user | Billed monthly; annual billing saves 14% |
| PlantUML | Free | LGPL-3.0, no paid tier or hosted product |
| Graphviz | Free | Eclipse Public License 2.0, no paid tier |
| D2 | Free | MPL-2.0; Terrastruct's pricing page redirects to the D2 project site |
| Diagrams (mingrammer) | Free | MIT license, Python library, no paid tier |
| Eraser Free | $0/member/mo | 3 files, 3 AI diagrams, 7-day version history |
| Eraser Starter | $15/member/mo annual ($20 monthly) | Unlimited files, 40 AI diagrams, 90-day history |
| Eraser Business | $45/member/mo annual ($60 monthly) | 250 AI diagrams, SAML SSO, unlimited history |
| Eraser Enterprise | Custom quote | Unlimited AI diagrams, flexible deployment |
| Structurizr server, 1-20 users | £300/mo billed annually | No USD list price published; self-hosted, cloud service is end of life |
| Structurizr server, 1,001+ users | £2,400/mo billed annually | Top published server tier; contact for 251+ team pricing above 1,000 |
| Ilograph Free | $0/mo | Unlimited diagrams, 14-day history |
| Ilograph Pro | $18/mo annual ($22/mo monthly) | Custom icons, unlimited history, 20 private viewers |
| Ilograph Team | $25/editor/mo annual ($30/editor/mo monthly) | Team workspace, unlimited viewers |
| Ilograph Team+ | Custom quote | SSO via SAML 2.0, API access |
| Ilograph Desktop | $11.99/mo annual ($14.99/mo monthly) | Offline desktop app, works with local files |
The bottom line
Default to Mermaid for most day-to-day diagrams: it is free, MIT-licensed, and the only tool here GitHub, GitLab and Notion render natively.
Reach for PlantUML when a diagram needs deep UML support, and Graphviz or D2 when the layout itself, not the notation, is the hard part.
Use Diagrams when the source of truth is already Python, and Excalidraw or draw.io when a non-technical teammate needs to hand-edit the result.
Pay for Eraser or Ilograph only once a team genuinely needs AI generation or multi-perspective modeling; check Structurizr's end-of-life notice before building anything new on its cloud service. Cite this: Devshot, "Best Diagram as Code Tools in 2026", September 2026.
Frequently asked questions
Some offers on this page may be paid placements or contain affiliate links.
Get the Devshot brief
Free daily newsletter, read in 5 minutes.
Subscribe free