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 plan · Confluence/Jira Cloud $1.70/mo per user · custom-priced plans too
- Excalidraw (best for: Teams that want a hand-drawn look for architecture sketches, not a polished formal diagram): Free plan · Excalidraw+ Yearly $6/mo on the annual plan · Excalidraw+ Monthly $7/mo
- 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.
The default because the syntax renders natively in the tools developers already use, with a paid hosted editor as an optional upgrade.
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
The only tool here with no paid tier of any kind, by design, plus native Confluence, Jira, GitHub and VS Code integrations.
Free plan · Confluence/Jira Cloud $1.70/mo per user · custom-priced plans tooChecked Oct 8, 2026 on Toolradar
Teams that want a real diagram editor with zero license cost and zero vendor lock-in
A free, open-source whiteboard with a cheap $6/mo Plus tier for cloud sync and unlimited scenes.
Free plan · Excalidraw+ Yearly $6/mo on the annual plan · Excalidraw+ Monthly $7/moChecked Oct 6, 2026 on Toolradar
Teams that want a hand-drawn look for architecture sketches, not a polished formal diagram
| 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 plan · Confluence/Jira Cloud $1.70/mo per user · custom-priced plans too | Teams that want a real diagram editor with zero license cost and zero vendor lock-in |
| Excalidraw | Free plan · Excalidraw+ Yearly $6/mo on the annual plan · Excalidraw+ Monthly $7/mo | 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 plan · Business Plus $42/mo per member · Business $60/mo per member · custom-priced plans too | 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 pricing page, checked Sep 2026. 2 of 10 publish prices for some plans and quote the rest.
Mermaid
The default because the syntax renders natively in the tools developers already use, with a paid hosted editor as an optional upgrade.
- Pricing
- Free, MIT license (Mermaid.js); Mermaid Chart Plus $10/user/mo, Premium $20/user/mo, both billed annually.
Best for: Teams that want a diagram GitHub, GitLab and Notion already render with no extension
Pros
- MIT-licensed core library with 90,000+ GitHub stars, free forever with no rendering limit
- Native rendering in GitHub markdown, GitLab and Notion, so most diagrams need no separate viewer
- Mermaid Chart's Plus tier removes the free plan's 3-diagram cap and adds AI generation credits
Cons
- The free Mermaid Chart plan caps at 3 diagrams and limited diagram size, a real wall for anyone using the hosted editor daily
- Complex sequence or class diagrams get unreadable fast; PlantUML handles denser UML better
draw.io (diagrams.net)
The only tool here with no paid tier of any kind, by design, plus native Confluence, Jira, GitHub and VS Code integrations.
- Pricing
- Free plan · Confluence/Jira Cloud $1.70/mo per user · custom-priced plans tooChecked Oct 8, 2026 on Toolradar
Best for: Teams that want a real diagram editor with zero license cost and zero vendor lock-in
Pros
- Apache 2.0 licensed, with the vendor stating outright there is no Enterprise tier gating SSO
- Diagrams saved in 2005 still load today, so files never go stale against an old app version
- Confluence, Jira, Google Workspace, Microsoft 365 and VS Code integrations ship free, not gated
Cons
- Not diagram-as-code in the strict sense: the source is an XML file edited on a canvas, not a text language you'd write by hand
- No built-in CI rendering step; scripting a headless export takes extra tooling
Excalidraw
A free, open-source whiteboard with a cheap $6/mo Plus tier for cloud sync and unlimited scenes.
- Pricing
- Free plan · Excalidraw+ Yearly $6/mo on the annual plan · Excalidraw+ Monthly $7/moChecked Oct 6, 2026 on Toolradar
Best for: Teams that want a hand-drawn look for architecture sketches, not a polished formal diagram
Pros
- MIT-licensed with 132,000+ GitHub stars, and the free tier already includes unlimited collaborators
- Mermaid-to-Excalidraw import turns a text diagram into an editable sketch, bridging the two workflows
- Plus is the cheapest paid tier of any tool on this list, well under Mermaid Chart's or Eraser's entry price
Cons
- The free tier caps at 1 infinite scene; Plus is required for unlimited scenes and folders
- Hand-drawn style reads as informal for a customer-facing architecture doc
PlantUML
The deepest UML support of any tool here, free under LGPL-3.0, with no commercial version to compare against.
- Pricing
- Free, LGPL-3.0 license; no paid tier or hosted product.
Best for: Teams that need dense UML: class, sequence, state and component diagrams from a compact text syntax
Pros
- Free and open source (LGPL-3.0), with 13,000+ GitHub stars and two decades of UML syntax coverage
- Renders sequence, class, state, component, and deployment diagrams, more UML diagram types than Mermaid covers
- Runs locally via a JAR file or Docker image, so CI rendering needs no network call to a hosted server
Cons
- Syntax is denser and less forgiving than Mermaid's for a newcomer's first flowchart
- No native rendering in GitHub or GitLab; needs a plugin, proxy server, or pre-rendered image
Graphviz
The free layout engine that PlantUML, Diagrams and dozens of other tools call under the hood, usable directly via the DOT language.
- Pricing
- Free, Eclipse Public License 2.0; no paid tier or hosted product.
Best for: Teams that need the underlying graph-layout engine other diagram tools build on top of
Pros
- Free under the Eclipse Public License 2.0, with no commercial edition to weigh against it
- The DOT language it introduced is the layout engine several tools on this list (PlantUML, Diagrams) render through
- Handles large, densely connected graphs that hierarchical tools like Mermaid struggle to lay out cleanly
Cons
- DOT syntax is lower-level than Mermaid or D2; positioning and styling take more trial and error
- No native theming system; visual polish requires manual attribute tuning
D2
A newer text-to-diagram language with production-ready themes and animation, free under MPL-2.0 with no commercial tier live today.
- Pricing
- Free, MPL-2.0 license; Terrastruct lists no paid tier for D2 today.
Best for: Teams that want a modern syntax with built-in themes, sketch mode and animated diagrams
Pros
- Free under the Mozilla Public License 2.0, with 25,000+ GitHub stars on the d2lang/d2 repository
- Ships professionally designed themes and a sketch mode out of the box, ahead of Mermaid or PlantUML's default styling
- Exports to SVG, PNG, PDF, PPTX, GIF and even ASCII, and offers three interchangeable layout engines
Cons
- Terrastruct's own pricing page now redirects straight to the D2 project site, so there is no separate paid product to compare
- Smaller ecosystem and fewer native integrations than Mermaid, which GitHub and GitLab render without a plugin
Diagrams (mingrammer)
A Python library that turns infrastructure code into an AWS, Azure or GCP diagram, free under MIT with 42,000+ GitHub stars.
- Pricing
- Free, MIT license; a Python library, no paid tier or hosted product.
Best for: Teams that want cloud architecture diagrams generated from a Python script, not drawn by hand
Pros
- MIT licensed with built-in icon sets for AWS, Azure, GCP, Kubernetes and on-prem systems, no manual icon hunting
- Diagrams live as Python functions, so the same code review and version control process covers infrastructure and its diagram
- 42,000+ GitHub stars and active maintenance make it the most established Python option for this specific job
Cons
- Only outputs static PNG images; no interactive viewer or hosted sharing link
- Requires Graphviz installed as a system dependency, an extra setup step compared to a single binary
Eraser
A paid SaaS that pairs diagram-as-code with AI generation and team docs once the 3-file free cap runs out.
- Pricing
- Free plan · Business Plus $42/mo per member · Business $60/mo per member · custom-priced plans tooChecked Nov 28, 2026 on Toolradar
Best for: Teams that want AI-generated diagrams alongside Markdown docs in one collaborative workspace
Pros
- Diagram-as-code syntax plus AI generation in one workspace, with GitHub, Notion, Confluence and VS Code integrations even on Free
- Starter opens up unlimited files and 40 AI diagrams a month once the free cap gets tight
- Business adds SAML SSO and unlimited version history at $45/member/mo annually, cheaper than most competing team wikis
Cons
- The free plan caps at 3 files total, not 3 diagrams a month, so it stops being usable fast for a real project
- AI diagram count is a hard quota (40 on Starter, 250 on Business) rather than unlimited until Enterprise
Structurizr
The C4-model pioneer, but its hosted cloud service is being shut down with no replacement, leaving a GBP-priced self-hosted server as the only paid path.
- Pricing
- Cloud service end of life, no replacement; self-hosted server from £300/mo, 1-20 users, billed annually; no USD price.
Best for: Teams already committed to the C4 model who can self-host, not new teams starting today
Pros
- Defined the C4 model (context, container, component, code) that several other tools on this list, including Ilograph, support exporting to
- One DSL source generates multiple views (context, container, deployment) instead of separate files per diagram
- Structurizr Lite and the new 'local' command line workflow remain free for a single developer working offline
Cons
- The Structurizr cloud service is end of life with no replacement, confirmed on the vendor's own documentation in September 2026
- The only current paid product, Structurizr server, is priced in GBP (from £300/mo for 1-20 users, billed annually) with no USD list price published
Ilograph
An interactive, multi-perspective architecture tool, free to start, with Pro from about $18 to $22 a month depending on billing.
- Pricing
- Free ($0/mo, 14-day diagram history); Pro from $18/mo (annual) or $22/mo (monthly); Team from $25/editor/mo (annual).
Best for: Teams that need one architecture model to generate several interactive, zoomable perspectives
Pros
- One model generates multiple interactive, clickable perspectives, closer to a live system map than a static image
- The free plan has no diagram-count cap, only a 14-day history window, generous for solo use
- Ilograph Desktop ($11.99 to $14.99/mo depending on billing) offers an offline, on-premises option for teams behind a firewall
Cons
- Team pricing runs per editor per month ($25 to $30), which adds up faster than Eraser's or Mermaid Chart's per-user rate at small team sizes
- SSO is locked behind the custom-quote Team+ tier, not available at any published price
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: 33,000+ developer readers get this brief, and the audience file updated November 29, 2026 puts the open rate at 32%. 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 November 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
What is the best diagram-as-code tool in 2026?
Is Mermaid free?
Is there a free diagram-as-code tool?
Mermaid vs PlantUML: which should I use?
What happened to Structurizr's cloud service?
Can I generate a diagram from Python or another programming language?
What is the cheapest paid diagram tool here?
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