# D2

> Declarative diagram scripting language that turns text into diagrams.

- Category: [Diagrams as code](https://awesomedataviz.com/categories/diagrams-as-code/)
- Website: https://d2lang.com
- Repository: https://github.com/d2lang/d2
- License: MPL-2.0
- Language: Go
- Status: Active (commits in the last 90 days)
- GitHub stars: 25,564
- Commits in the last 12 months: 324
- Contributors: 65
- Last commit: Oct 2, 2026
- Latest release: v0.9.0 (Sep 7, 2026)
- Install (Go): `go get github.com/d2lang/d2`
- Topics: Diagrams & diagrams as code

## Overview

D2 is an open-source diagram-as-code tool released under the MPL-2.0 license. Its GitHub repository has 25,564 stars, 757 forks, and 65 contributors. It is actively developed with 324 commits in the last 12 months. The latest release, v0.9.0, was published on Sep 7, 2026.

## Alternatives

- [Mermaid](https://awesomedataviz.com/tools/mermaid/): Generate diagrams and flowcharts from markdown-like text definitions, with a live editor. (90.5K stars)
- [Diagrams](https://awesomedataviz.com/tools/diagrams/): Diagram as code in Python for prototyping cloud system architectures. (42.7K stars)
- [PlantUML](https://awesomedataviz.com/tools/plantuml/): Generates UML, Gantt, mind map and other diagrams from plain text. (13.4K stars)
- [Markmap](https://awesomedataviz.com/tools/markmap/): Builds interactive mind maps from Markdown. (13.1K stars)
- [flowchart.js](https://awesomedataviz.com/tools/flowchart-js/): Draws SVG flowcharts from a textual description. (8.7K stars)
- [Penrose](https://awesomedataviz.com/tools/penrose/): Creates diagrams from mathematical notation in plain text, from Carnegie Mellon University. (8K stars)

## Comparisons

- [D2 vs Mermaid](https://awesomedataviz.com/compare/d2-vs-mermaid/)
- [D2 vs Diagrams](https://awesomedataviz.com/compare/d2-vs-diagrams/)
- [D2 vs PlantUML](https://awesomedataviz.com/compare/d2-vs-plantuml/)
- [D2 vs Markmap](https://awesomedataviz.com/compare/d2-vs-markmap/)

Source: https://awesomedataviz.com/tools/d2/ · Data updated 2026-10-04 · Content: CC BY 4.0, Awesome Dataviz (https://awesomedataviz.com).
