D2
Leading#4 in Open sourcehigh confidence
Fast-rising modern diagram scripting language (~24.8k★) — cleaner syntax than PlantUML with strong automatic layout.Our read
Why it ranks #4
A fast-growing modern DSL at ~24.8k GitHub stars and the #2 recommendation in 2026 diagram-as-code comparisons, behind Mermaid mainly because its ecosystem and native integrations are smaller.Here is the catch
smaller integration and documentation ecosystem than Mermaid
no native GitHub rendering, so publishing needs a build step
the TALA layout engine requires a separate paid license
Does this well
clean syntax and attractive defaults are repeatedly preferred over older DSLs
multiple layout engines provide more control than Mermaid
nested containers work well for grouped architecture views
Pricing
Checked by hand on 2026-07-23. Prices in this category change often — if this looks wrong, it probably is.
Key features
readable declarative diagram languageDagre, ELK and optional TALA layoutsthemes, containers and Markdown labelsSVG, PNG and PDF export
Sources we read
Quick facts
More in this area
The rest of the Open source column.- 1MermaidThe de-facto text-to-diagram standard (~89.4k★) — natively rendered in GitHub/GitLab Markdown, making it the default diagram-as-code format agents produce for architecture, flow and sequence diagrams.
- 2ExcalidrawThe dominant open-source virtual whiteboard (~128.3k★) — hand-drawn aesthetic, hugely used for freeform architecture sketches and system diagrams.
- 3Diagrams (mingrammer)The leading diagram-as-code library for cloud/system architecture (~42.5k★) — draw AWS/GCP/Azure/Kubernetes architecture from Python.
- 5tldrawInfinite-canvas whiteboard SDK (~49.2k★) — the toolkit developers build collaborative diagramming apps on.
- 6PlantUMLThe long-standing text-to-UML workhorse (~13.2k★) — most complete UML coverage, ubiquitous in enterprise toolchains despite dated visuals.
- 7C4-PlantUMLThe standard way to render C4-model software architecture diagrams as code (~7.4k★) — the go-to for C4 + text.