D2 vs Diagrams
A data-driven comparison of two Diagrams as code: popularity, development activity, licensing and installation. Updated .
Key differences
- Diagrams has 1.7× as many GitHub stars as D2 (42.7K vs 25.6K).
- D2 had more development activity over the last 12 months: 324 commits vs 48.
- D2 is licensed under MPL-2.0; Diagrams under MIT.
- D2 is written primarily in Go, Diagrams in Python.
- Diagrams is the older project: its repository was created in 2020, D2's in 2022.
By the numbers
- D2
- Diagrams
Show data as a table
| Metric | D2 | Diagrams |
|---|---|---|
| GitHub stars | 25,564 | 42,673 |
| Commits, last 12 months | 324 | 48 |
| Contributors | 65 | 178 |
| Forks | 757 | 2,732 |
Development activity
Commits per month to each default branch, last 12 complete months.
- D2
- Diagrams
Show data as a table
| Month | D2 | Diagrams |
|---|---|---|
| Oct 2025 | 7 | 6 |
| Nov 2025 | 0 | 6 |
| Dec 2025 | 0 | 1 |
| Jan 2026 | 0 | 1 |
| Feb 2026 | 0 | 2 |
| Mar 2026 | 0 | 1 |
| Apr 2026 | 2 | 2 |
| May 2026 | 0 | 2 |
| Jun 2026 | 0 | 6 |
| Jul 2026 | 0 | 3 |
| Aug 2026 | 160 | 13 |
| Sep 2026 | 155 | 5 |
Side by side
| Attribute | D2 | Diagrams |
|---|---|---|
| Description | Declarative diagram scripting language that turns text into diagrams. | Diagram as code in Python for prototyping cloud system architectures. |
| Category | Diagrams as code | Diagrams as code |
| License | MPL-2.0 | MIT |
| Language | Go | Python |
| Status | Active | Active |
| Latest release | v0.9.0 () | v0.25.1 () |
| Last commit | ||
| Repository created | ||
| Open issues | 477 | 318 |
| Install | go get github.com/d2lang/d2 | pip install diagrams |
Which should you choose?
Popularity and activity are only part of the story. Consider which ecosystem you work in, the chart types and interactions you need, how much data you render, and whether the license fits your project. Both tool pages list alternatives if neither is quite right.