Top 10 Diagramming Tools for Developers
Hi everyone, welcome back. Today, I will be going over ten tools for drawing diagrams — architecture sketches, sequence diagrams, entity relationships, cloud topologies, and the kind of boxes-and-arrows picture you end up redrawing every time someone new joins the team.
If you are newer to this, here is the thing that makes this category click. Most people draw diagrams by opening a canvas app, dragging shapes around, and exporting a PNG. That works once. The problem shows up six months later, when the architecture has changed and the only copy of the diagram is a PNG in a Confluence page that nobody can edit, drawn by someone who left. The tools below mostly solve that by making the diagram text — a few lines in a file, next to your code, in version control, rendered to an image by a program. You change the text, you get a new picture. Code review shows the diff. Nobody has to find the original file.
That is the whole idea, and it is worth internalizing before you pick a tool: you are choosing between drawing a diagram and describing one. Both are legitimate. Describing it scales better.
1. Mermaid
The one to learn first, because GitHub renders it natively.
Put this in a fenced code block tagged mermaid in any README, issue, or pull request on GitHub or GitLab, and it draws:
|HTTPS| LB[Load Balancer]
LB –> API1[orders-api 1]
LB –> API2[orders-api 2]
API1 –> Cache[(Redis)]
API2 –> Cache
API1 –> DB[(Postgres)]
API2 –> DB
API1 –>|async| Q[[SQS]]
Q –> W[worker]
W –> DB
W –>|webhook| Ext[Payment gateway]” data-toggle-ms=”1200″ aria-label=”Copy code” data-nosnippet=”” class=”code-copy-btn absolute right-3 top-3 size-8 p-1.5 flex items-center justify-center bg-black/50 text-white rounded-md transition-colors duration-200 cursor-pointer hover:bg-black/70″>
```mermaid
graph TD
Client[Browser] -->|HTTPS| LB[Load Balancer]
LB --> API1[orders-api 1]
LB --> API2[orders-api 2]
API1 --> Cache[(Redis)]
API2 --> Cache
API1 --> DB[(Postgres)]
API2 --> DB
API1 -->|async| Q[[SQS]]
Q --> W[worker]
W --> DB
W -->|webhook| Ext[Payment gateway]
```mermaid
graph TD
Client[Browser] -->|HTTPS| LB[Load Balancer]
LB --> API1[orders-api 1]
LB --> API2[orders-api 2]
API1 --> Cache[(Redis)]
API2 --> Cache
API1 --> DB[(Postgres)]
API2 --> DB
API1 -->|async| Q[[SQS]]
Q --> W[worker]
W --> DB
W -->|webhook| Ext[Payment gateway]
cloud.lb: HTTPS
cloud.lb -> cloud.api
cloud.api -> cloud.cache
cloud.api -> cloud.db
cloud.api -> cloud.queue: async
cloud.queue -> cloud.worker
cloud.worker -> ext: capture” data-toggle-ms=”1200″ aria-label=”Copy code” data-nosnippet=”” class=”code-copy-btn absolute right-3 top-3 size-8 p-1.5 flex items-center justify-center bg-black/50 text-white rounded-md transition-colors duration-200 cursor-pointer hover:bg-black/70″>
Eleven lines. That is a complete request-path diagram with a load balancer, two app instances, a cache, a database, a queue, a worker, and an external dependency — and the shapes carry meaning: [(...)] is a cylinder for datastores, [[...]] is a queue shape, {...} is a diamond for decisions.
Rendered with [mermaid-cli](https://github.com/mermaid-js/mermaid-cli), that exact source produces a 209 KB SVG containing 19 nodes and 19 edges.
Mermaid also does sequence diagrams, state machines, ER diagrams, Gantt charts, and pie charts from the same package.
**Why it works:** the native rendering on GitHub is the entire argument. A diagram that renders in the pull request is a diagram people will read and update, because the cost of updating it is editing three lines in a file they already have open. A diagram that lives as a PNG in a wiki is a diagram that goes stale, because updating it means finding the source, finding the app, re-exporting, re-uploading. Mermaid is not the most powerful tool on this list and its automatic layout can produce crossing edges that a human would route better, but it is the one with no adoption cost.
One practical note for local rendering: `mermaid-cli` drives a headless Chromium, which means it is slow and it needs a browser available. Rendering that flowchart takes 2.27 seconds, versus 22 milliseconds for Graphviz below. On a machine without a usable Chromium — a lean CI image, most commonly — it will not render at all until you install one or point it at an existing binary with a Puppeteer config file, which is what makes Mermaid awkward in a build pipeline. If you only ever view Mermaid on GitHub, none of this matters.
### 2. D2
The one that produces the best-looking diagrams with the least fighting.
[D2](https://github.com/terrastruct/d2) is a newer text-to-diagram language from Terrastruct, and its distinguishing feature is **containers** — you nest things, and it draws the boxes-inside-boxes that architecture diagrams are made of:
```plaintext
client: Browser {shape: person}
cloud: AWS {
lb: Load Balancer
api: orders-api {
shape: rectangle
api1: instance 1
api2: instance 2
}
cache: Redis {shape: cylinder}
db: Postgres {shape: cylinder}
queue: SQS {shape: queue}
worker: worker
}
ext: Payment gateway {shape: cloud}
client -> cloud.lb: HTTPS
cloud.lb -> cloud.api
cloud.api -> cloud.cache
cloud.api -> cloud.db
cloud.api -> cloud.queue: async
cloud.queue -> cloud.worker
cloud.worker -> ext: capture
Eleven lines. That is a complete request-path diagram with a load balancer, two app instances, a cache, a database, a queue, a worker, and an external dependency — and the shapes carry meaning: [(...)] is a cylinder for datastores, [[...]] is a queue shape, {...} is a diamond for decisions.
Rendered with [mermaid-cli](https://github.com/mermaid-js/mermaid-cli), that exact source produces a 209 KB SVG containing 19 nodes and 19 edges.
Mermaid also does sequence diagrams, state machines, ER diagrams, Gantt charts, and pie charts from the same package.
**Why it works:** the native rendering on GitHub is the entire argument. A diagram that renders in the pull request is a diagram people will read and update, because the cost of updating it is editing three lines in a file they already have open. A diagram that lives as a PNG in a wiki is a diagram that goes stale, because updating it means finding the source, finding the app, re-exporting, re-uploading. Mermaid is not the most powerful tool on this list and its automatic layout can produce crossing edges that a human would route better, but it is the one with no adoption cost.
One practical note for local rendering: `mermaid-cli` drives a headless Chromium, which means it is slow and it needs a browser available. Rendering that flowchart takes 2.27 seconds, versus 22 milliseconds for Graphviz below. On a machine without a usable Chromium — a lean CI image, most commonly — it will not render at all until you install one or point it at an existing binary with a Puppeteer config file, which is what makes Mermaid awkward in a build pipeline. If you only ever view Mermaid on GitHub, none of this matters.
### 2. D2
The one that produces the best-looking diagrams with the least fighting.
[D2](https://github.com/terrastruct/d2) is a newer text-to-diagram language from Terrastruct, and its distinguishing feature is **containers** — you nest things, and it draws the boxes-inside-boxes that architecture diagrams are made of:
```plaintext
client: Browser {shape: person}
cloud: AWS {
lb: Load Balancer
api: orders-api {
shape: rectangle
api1: instance 1
api2: instance 2
}
cache: Redis {shape: cylinder}
db: Postgres {shape: cylinder}
queue: SQS {shape: queue}
worker: worker
}
ext: Payment gateway {shape: cloud}
client -> cloud.lb: HTTPS
cloud.lb -> cloud.api
cloud.api -> cloud.cache
cloud.api -> cloud.db
cloud.api -> cloud.queue: async
cloud.queue -> cloud.worker
cloud.worker -> ext: capture
The dotted-path syntax (cloud.api -> cloud.cache) means you reference nested things naturally, and D2 draws the enclosing boxes for you.
It compiled that to a 32 KB SVG in 293 milliseconds. It also ships two layout engines — the default dagre and elk — and you switch with one flag:
d2 --layout=elk arch.d2 arch-elk.svg
d2 --layout=elk arch.d2 arch-elk.svg
I rendered both. The ELK output came out at 32,060 bytes against dagre’s 32,004, and the routing differs noticeably; when a diagram looks tangled, switching engines is a one-word fix that is worth trying before you start hand-tuning.
Why it works: D2 was designed after Mermaid and Graphviz existed, with the benefit of knowing where they get awkward. Containers, sane defaults, good typography, animated SVG output, and a --watch mode that live-reloads in a browser while you edit. The trade-off is that nothing renders it for you — GitHub will not display a .d2 file as a picture, so you commit the generated SVG alongside the source or render it in CI.
3. Graphviz
The oldest tool here, the fastest, and still the right answer when something else generates the diagram.
Graphviz has been around since the early 1990s and its DOT language is the lingua franca of generated diagrams. The source looks like this:
LB [label="HTTPS"];
LB -> API1; LB -> API2;
API1 -> DB; API2 -> DB;
DB [shape=cylinder];
}” data-toggle-ms=”1200″ aria-label=”Copy code” data-nosnippet=”” class=”code-copy-btn absolute right-3 top-3 size-8 p-1.5 flex items-center justify-center bg-black/50 text-white rounded-md transition-colors duration-200 cursor-pointer hover:bg-black/70″>
digraph orders {
rankdir=LR;
node [shape=box, style=rounded];
Client -> LB [label="HTTPS"];
LB -> API1; LB -> API2;
API1 -> DB; API2 -> DB;
DB [shape=cylinder];
}
digraph orders {
rankdir=LR;
node [shape=box, style=rounded];
Client -> LB [label="HTTPS"];
LB -> API1; LB -> API2;
API1 -> DB; API2 -> DB;
DB [shape=cylinder];
}
It rendered my architecture graph to SVG in 22 milliseconds — an order of magnitude faster than D2 and a hundred times faster than Mermaid’s headless-browser pipeline.
Graphviz is not one layout algorithm, it is five, and they are genuinely different tools:
dot— hierarchical, top-to-bottom or left-to-right. The one you want for dependency trees, call graphs, and architecture.neato— spring model. Good for undirected networks with no clear hierarchy.fdp— force-directed, handles larger graphs than neato.circo— circular. Good for cyclic structures and ring topologies.twopi— radial, with one node at the center.
I rendered the same source through all five. Same input, five genuinely different pictures, ranging from 8,746 to 9,594 bytes of SVG.
Why it works: almost every tool that programmatically emits a diagram emits DOT. go tool pprof writes DOT. Terraform’s terraform graph writes DOT. Profilers, build systems, dependency analyzers, ORMs, pydeps, madge — all DOT. Which means Graphviz is not really optional: if you want to see the output of those tools, you need dot installed. The language is less pleasant to write by hand than D2 or Mermaid, and that is fine, because most of the time you are not writing it by hand.
4. PlantUML
The one with the deepest UML support and the widest editor integration.
PlantUML is a Java program that renders a very large family of diagram types. Sequence diagrams are where it earns its keep:
API: POST /orders
API -> DB: INSERT order (pending)
API -> Q: publish order.placed
API –> Customer: 201 Created
Q -> worker: deliver
worker -> worker: capture payment
worker -> DB: UPDATE status = paid
@enduml” data-toggle-ms=”1200″ aria-label=”Copy code” data-nosnippet=”” class=”code-copy-btn absolute right-3 top-3 size-8 p-1.5 flex items-center justify-center bg-black/50 text-white rounded-md transition-colors duration-200 cursor-pointer hover:bg-black/70″>
@startuml
actor Customer
participant "orders-api" as API
database Postgres as DB
queue SQS as Q
participant worker
Customer -> API: POST /orders
API -> DB: INSERT order (pending)
API -> Q: publish order.placed
API --> Customer: 201 Created
Q -> worker: deliver
worker -> worker: capture payment
worker -> DB: UPDATE status = paid
@enduml
@startuml
actor Customer
participant "orders-api" as API
database Postgres as DB
queue SQS as Q
participant worker
Customer -> API: POST /orders
API -> DB: INSERT order (pending)
API -> Q: publish order.placed
API --> Customer: 201 Created
Q -> worker: deliver
worker -> worker: capture payment
worker -> DB: UPDATE status = paid
@enduml
That reads like a description of the flow, which is the point. It also does entity-relationship diagrams, class diagrams, activity diagrams, state machines, timing diagrams, and mind maps.
It rendered in 1.09 seconds, most of which is JVM startup. I also used it as the renderer for Structurizr’s output below, producing a 2418×442 PNG of a C4 container diagram.
Why it works: two reasons. First, the sequence diagram syntax is the best on this list — if you are documenting an interaction between services, PlantUML will do it with the least friction, including activation bars, loops, alt/else blocks, and notes. Second, editor support is everywhere: there are PlantUML preview plugins for VS Code, IntelliJ, Vim, Emacs, and Obsidian, so you edit text on the left and watch the picture update on the right.
The cost is the Java dependency, and the default visual style looks like 2009. Both are fixable — skinparam directives or one of the community themes clean up the look considerably — but out of the box it is the least attractive output here.
5. diagrams (Python)
The one for cloud architecture, with real provider icons.
Diagrams is a Python library that draws cloud architecture diagrams using the official AWS, Azure, GCP, Kubernetes, and on-prem icon sets. You write Python:
> Edge(label="HTTPS") >> lb >> api
api >> cache
api >> db
api[0] >> Edge(label="async", style="dashed") >> q >> worker >> db” data-toggle-ms=”1200″ aria-label=”Copy code” data-nosnippet=”” class=”code-copy-btn absolute right-3 top-3 size-8 p-1.5 flex items-center justify-center bg-black/50 text-white rounded-md transition-colors duration-200 cursor-pointer hover:bg-black/70″>
from diagrams import Diagram, Cluster, Edge
from diagrams.aws.compute import ECS
from diagrams.aws.database import RDS, ElastiCache
from diagrams.aws.network import ELB
from diagrams.aws.integration import SQS
from diagrams.onprem.client import Users
with Diagram("Orders platform", filename="cloudarch", show=False, direction="TB"):
users = Users("clients")
with Cluster("AWS us-east-1"):
lb = ELB("alb")
with Cluster("orders-api"):
api = [ECS("task 1"), ECS("task 2")]
cache = ElastiCache("redis")
db = RDS("postgres")
q = SQS("order events")
worker = ECS("worker")
users >> Edge(label="HTTPS") >> lb >> api
api >> cache
api >> db
api[0] >> Edge(label="async", style="dashed") >> q >> worker >> db
from diagrams import Diagram, Cluster, Edge
from diagrams.aws.compute import ECS
from diagrams.aws.database import RDS, ElastiCache
from diagrams.aws.network import ELB
from diagrams.aws.integration import SQS
from diagrams.onprem.client import Users
with Diagram("Orders platform", filename="cloudarch", show=False, direction="TB"):
users = Users("clients")
with Cluster("AWS us-east-1"):
lb = ELB("alb")
with Cluster("orders-api"):
api = [ECS("task 1"), ECS("task 2")]
cache = ElastiCache("redis")
db = RDS("postgres")
q = SQS("order events")
worker = ECS("worker")
users >> Edge(label="HTTPS") >> lb >> api
api >> cache
api >> db
api[0] >> Edge(label="async", style="dashed") >> q >> worker >> db
Run it like any Python script and it writes a PNG. Mine came out at 115 KB, 875×1963 pixels, with the real orange ECS hexagons and blue RDS cylinders that make a cloud diagram instantly readable to anyone who has used AWS. I looked at the result and it is correct: two ECS tasks behind the load balancer, both reaching the cache and database, a dashed async edge to the queue, and the worker writing back.
Note the >> operator doing double duty as “connects to,” the list [ECS("task 1"), ECS("task 2")] fanning out to both instances from one statement, and Cluster producing the dashed grouping boxes.
Why it works: this is the only tool here that makes a cloud diagram look like the ones in the vendor’s own documentation, which matters more than it should — those icons are a shared vocabulary, and a diagram that uses them needs less explanation. And because it is Python, you can generate the diagram from real data: read your Terraform state or your AWS API and draw what is deployed instead of what you remember deploying. It renders through Graphviz under the hood, so you need dot installed too.
6. Structurizr
The one that gives architecture diagrams a model instead of a drawing.
Structurizr implements the C4 model — the idea that architecture should be documented at four zoom levels (System Context, Container, Component, Code) rather than as one diagram that tries to show everything. The key difference from everything above: you describe the system once, and generate several diagrams from that one description.
api "Places an order" "HTTPS"
api -> db "Reads and writes"
api -> queue "Publishes events"
queue -> worker "Delivers events"
worker -> db "Updates order state"
worker -> payments "Captures payment" "HTTPS"
}
views {
systemContext orders "Context" {
include *
autolayout lr
}
container orders "Containers" {
include *
autolayout lr
}
}
}” data-toggle-ms=”1200″ aria-label=”Copy code” data-nosnippet=”” class=”code-copy-btn absolute right-3 top-3 size-8 p-1.5 flex items-center justify-center bg-black/50 text-white rounded-md transition-colors duration-200 cursor-pointer hover:bg-black/70″>
workspace "Orders platform" {
model {
customer = person "Customer" "Places orders"
orders = softwareSystem "Orders Platform" {
api = container "orders-api" "Handles order requests" "Go"
worker = container "worker" "Processes order events" "Go"
db = container "Database" "Orders and users" "Postgres"
queue = container "Event queue" "order.placed events" "SQS"
}
payments = softwareSystem "Payment gateway" "Third party"
customer -> api "Places an order" "HTTPS"
api -> db "Reads and writes"
api -> queue "Publishes events"
queue -> worker "Delivers events"
worker -> db "Updates order state"
worker -> payments "Captures payment" "HTTPS"
}
views {
systemContext orders "Context" {
include *
autolayout lr
}
container orders "Containers" {
include *
autolayout lr
}
}
}
workspace "Orders platform" {
model {
customer = person "Customer" "Places orders"
orders = softwareSystem "Orders Platform" {
api = container "orders-api" "Handles order requests" "Go"
worker = container "worker" "Processes order events" "Go"
db = container "Database" "Orders and users" "Postgres"
queue = container "Event queue" "order.placed events" "SQS"
}
payments = softwareSystem "Payment gateway" "Third party"
customer -> api "Places an order" "HTTPS"
api -> db "Reads and writes"
api -> queue "Publishes events"
queue -> worker "Delivers events"
worker -> db "Updates order state"
worker -> payments "Captures payment" "HTTPS"
}
views {
systemContext orders "Context" {
include *
autolayout lr
}
container orders "Containers" {
include *
autolayout lr
}
}
}
I ran that through the Structurizr CLI and it exported four PlantUML files from the one source — a context view, a container view, and a legend for each. Rendering the container view produced a diagram with the customer outside, the four containers inside a labeled “Orders Platform” boundary, the payment gateway outside as a third-party system, and every relationship labeled with both its description and its protocol.
Two things tripped me up, so you can skip them:
- The single-line brace form with semicolons (
systemContext orders "Context" { include * ; autolayout lr }) is not valid. Views must be multi-line blocks. The error wasToo many tokens, expected: systemContext <software system identifier> [key] [description] {, which did not make the real problem obvious. theme defaultmakes the CLI fetch a theme over the network at export time. On a machine without internet access it throws a stack trace fromThemeUtils.loadThemes. Remove the line and it exports fine.
Why it works: this is the only tool here that distinguishes a model from a view. Every other tool, if you want a high-level and a detailed diagram, means maintaining two files that drift apart. Structurizr means one model and two view definitions, and adding a container to the model updates every diagram that includes it. For a system big enough that one diagram cannot show it, that is the difference between documentation that survives and documentation that does not. For a small service, it is more ceremony than you need.
7. nomnoml
The one for quick class and domain diagrams, in five lines.
nomnoml is a small tool with a deliberately terse syntax for UML-ish class diagrams:
[Order|id;total;status]
[Order] o- [LineItem|sku;qty;price]
[Order] -> [Payment|amount;provider]
[ Payment is captured asynchronously by the worker]” data-toggle-ms=”1200″ aria-label=”Copy code” data-nosnippet=”” class=”code-copy-btn absolute right-3 top-3 size-8 p-1.5 flex items-center justify-center bg-black/50 text-white rounded-md transition-colors duration-200 cursor-pointer hover:bg-black/70″>
#direction: right
[Customer|id;email|placeOrder()] -> [Order|id;total;status]
[Order] o- [LineItem|sku;qty;price]
[Order] -> [Payment|amount;provider]
[<note> Payment is captured asynchronously by the worker]
#direction: right
[Customer|id;email|placeOrder()] -> [Order|id;total;status]
[Order] o- [LineItem|sku;qty;price]
[Order] -> [Payment|amount;provider]
[<note> Payment is captured asynchronously by the worker]
Each [Name|fields|methods] is a class box with compartments. o- is composition, -> is association. That produced a 705×296 SVG in well under a second, via npm install -g nomnoml && nomnoml cls.noml cls.svg.
Why it works: it is the fastest way to turn a domain model in your head into a picture that other people can argue with. When you are designing a schema or an API and you want to show four entities and how they relate, nomnoml takes about ninety seconds end to end. It is not trying to be a full UML tool and it is better for that. There is also a browser version at nomnoml.com that requires installing nothing.
8. Excalidraw
The whiteboard one, for diagrams that should look provisional.
Excalidraw is a virtual whiteboard with a hand-drawn aesthetic — everything looks sketched, deliberately. It runs in the browser at excalidraw.com, has an offline desktop build and a VS Code extension, saves to a .excalidraw JSON file you can commit, and supports real-time collaboration with end-to-end encryption.
Why it matters: the hand-drawn style is a feature, not decoration. A diagram that looks sketched reads as “this is a proposal, argue with it.” A diagram that looks like it came out of a CAD program reads as “this is decided,” and people stop questioning it. For design discussions, whiteboard sessions, and incident reviews, that signal is worth a lot. Excalidraw is also the only thing on this list that is genuinely pleasant to use live in a meeting with five people drawing at once.
Where it falls down is exactly where the text-based tools win: there is no diff, nobody reviews a .excalidraw JSON blob in a pull request, and keeping it current is manual. Use it for thinking, then move the result into Mermaid or D2 if it becomes permanent.
9. draw.io
The general-purpose canvas, for when you need shapes nothing else has.
draw.io (also called diagrams.net) is the free, open-source alternative to Visio and Lucidchart. Browser-based, desktop app available, stores files in Google Drive, OneDrive, GitHub, or locally, and has stencil libraries for AWS, Azure, GCP, Cisco, network equipment, floor plans, flowcharts, BPMN, and UML.
Why it matters: it is the tool you reach for when the diagram does not fit any of the categories above. Network topology with specific hardware icons, an org chart, a floor plan, a flowchart with swim lanes, a diagram someone sent you as a .vsdx that you need to edit. draw.io opens all of those. The .drawio format is XML and can be committed, though the diffs are not meaningfully reviewable.
One genuinely useful trick: draw.io can save as .drawio.png or .drawio.svg — a real image file with the editable source embedded in its metadata. You get a picture that displays anywhere and opens back up in the editor. That solves a good chunk of the “the original file is lost” problem without switching to text.
10. Kroki
The one that renders all of the above through a single API.
Kroki is a server that accepts diagram source in roughly 30 languages — Mermaid, PlantUML, Graphviz, D2, Structurizr, nomnoml, BPMN, Excalidraw, and more — and returns an SVG or PNG. One HTTP endpoint, every diagram tool:
b }" > out.svg” data-toggle-ms=”1200″ aria-label=”Copy code” data-nosnippet=”” class=”code-copy-btn absolute right-3 top-1/2 -translate-y-1/2 size-8 p-1.5 flex items-center justify-center bg-black/50 text-white rounded-md transition-colors duration-200 cursor-pointer hover:bg-black/70″>
curl -X POST https://kroki.io/graphviz/svg
-H "Content-Type: text/plain"
--data "digraph G { a -> b }" > out.svg
curl -X POST https://kroki.io/graphviz/svg
-H "Content-Type: text/plain"
--data "digraph G { a -> b }" > out.svg
You can also encode the source into the URL itself, which means a static site or a wiki can render diagrams with nothing but an <img> tag.
Why it matters: Kroki solves a specific, annoying problem. If you want Mermaid in your docs you need Node and a headless browser. PlantUML needs Java. Graphviz needs a C library. D2 needs a Go binary. Structurizr needs Java again. Putting all of that in a CI image is a chore and keeping it current is worse. Kroki replaces the entire toolchain with one HTTP call, and you can docker run yuzutech/kroki to host it yourself when sending your architecture to a third-party service is not acceptable — which, for most companies, it is not.
What to Pick
Quick version, by situation:
- Diagram in a GitHub README or pull request → Mermaid, no contest.
- Architecture diagram you want to look good → D2.
- Something else generated the diagram → Graphviz, because it already emitted DOT.
- Sequence diagram of a service interaction → PlantUML.
- Cloud architecture with provider icons → diagrams (Python).
- A system too big for one diagram → Structurizr.
- Domain model, right now → nomnoml.
- Design discussion with other people → Excalidraw.
- Shapes nothing else has → draw.io.
- Many diagram languages in one docs pipeline → Kroki.
Conclusion
The single most useful idea in this article is the one from the introduction: a diagram made of text is a diagram that survives. Everything else follows from that. Text lives next to the code, goes through code review, shows a readable diff, and can be regenerated by anyone with a checkout. A PNG in a wiki can be updated by exactly one person, who has probably moved teams.
Start with Mermaid, because it has no adoption cost. GitHub and GitLab render it in READMEs, issues, and pull requests with zero setup, which means the diagram is visible to people who would never open a diagram file. Eleven lines gave me a complete request-path diagram with a load balancer, two instances, a cache, a database, a queue, a worker, and an external dependency. If you only take one thing from this article, put a Mermaid flowchart in your service’s README this week.
Understand the rendering cost before you build a pipeline. Across comparable diagrams rendered with four tools, the spread is large: Graphviz at 22 milliseconds, D2 at 293 milliseconds, PlantUML at 1.09 seconds (mostly JVM startup), and Mermaid’s CLI at 2.27 seconds because it drives a headless Chromium. If you render one diagram, none of this matters. If you render two hundred on every docs build, it is the difference between a four-second build and a seven-minute one.
D2’s containers are the reason to look at it. Real architecture diagrams are boxes inside boxes — a VPC containing a subnet containing services — and D2’s nesting with dotted-path references (cloud.api -> cloud.cache) expresses that directly. The two layout engines are worth knowing about too: when a diagram looks tangled, --layout=elk is a one-word change that often fixes it, and that beats hand-tuning coordinates.
Graphviz is not optional even if you never write DOT. go tool pprof, terraform graph, dependency analyzers, profilers, and ORMs all emit DOT. If dot is not installed, you cannot see their output. Install it regardless of which tool you choose for hand-written diagrams. And its five layout engines genuinely produce different diagrams from identical input — dot for hierarchy, neato and fdp for networks, circo for rings, twopi for radial.
Structurizr is the only one with a model instead of a drawing. Every other tool makes you maintain the high-level diagram and the detailed diagram separately, and they drift. Structurizr has one model and several view definitions, so adding a container updates every view that includes it. That is real leverage on a large system and unnecessary ceremony on a small one. If you try it, remember that views need multi-line brace blocks and that theme default requires network access at export time.
The Python diagrams library is the one that produces a diagram your director will recognize, because it uses the real AWS, Azure, and GCP icon sets. And because it is a Python program, you can generate it from your Terraform state and draw what is deployed rather than what you believe is deployed. That is a genuinely different capability from everything else here.
The GUI tools are not a step backwards, they are a different job. Excalidraw’s sketchy aesthetic signals “this is a proposal,” which is exactly right for a design discussion, and nothing text-based is usable live with five people in a room. draw.io opens the .vsdx someone emailed you and has stencils for hardware nobody else supports. Use them for thinking and for one-offs; move anything permanent into text. If you stay on draw.io, save as .drawio.svg so the editable source rides along inside the image.
And if your docs render several diagram languages, look at Kroki before you build a container with Node, Java, Go, and Graphviz in it. One HTTP endpoint replaces the whole toolchain, and docker run yuzutech/kroki keeps your architecture off someone else’s server.
A last practical suggestion. The highest-value diagram at most companies is not an elaborate architecture poster — it is a ten-line Mermaid flowchart at the top of each service’s README showing what calls it and what it calls. It takes fifteen minutes, it answers the question every new person asks in their first week, and because it is three lines of text in a file people already edit, it stays true.
This concludes my article on diagramming tools. I hope this helps. If you have any questions or comments, please let me know. Thanks for reading!


