# D2 diagram language

21 Hacker News commenters recommended D2 diagram language and 6 criticized it, November 2025 to November 2026. It was recommended in 6 of 13 months. It meets the Hacker Approved badge rule.

**Verdict:** Diagram language people find cleaner and more expressive than Mermaid, with strong icon support. Common caveat: the default layout engine and limited layout control frustrate some users.

## Why people recommend it

- Cleaner, more expressive than Mermaid (4 comments): "I've switched to D2 from mermaid after they removed ELK from the base" ([source](https://news.ycombinator.com/item?id=49267934)) "is a nicer language than Mermaid with much nicer visual appearance" ([source](https://news.ycombinator.com/item?id=47780379)) "D2 feels cleaner and more expressive than Mermaid." ([source](https://news.ycombinator.com/item?id=47780684))
- Good results for architecture diagrams (3 comments): "I love making (architecture) diagrams in D2" ([source](https://news.ycombinator.com/item?id=46667000)) "I found I had better results with D2" ([source](https://news.ycombinator.com/item?id=50145290)) "I have had good luck with D2" ([source](https://news.ycombinator.com/item?id=50135970))
- Strong icon support (2 comments): "has better icon support and was designed for architecture diagrams" ([source](https://news.ycombinator.com/item?id=46585658)) "D2 has better icon support if you need that now." ([source](https://news.ycombinator.com/item?id=46579086))
- Declarative layouts and consistent language (2 comments): "The language is richer and all diagram types are implemented consistently in the same language in a way that can be composed" ([source](https://news.ycombinator.com/item?id=47780666)) "check D2 with declarative layouts instead of hardcoding drawing instructions" ([source](https://news.ycombinator.com/item?id=48706776))

## What people warn about

- Weak default layout and little control (2 comments): "the default layout engine is pretty terrible for some types of graphs" ([source](https://news.ycombinator.com/item?id=49605287)) "the lack of control over the layout is a bit frustrating sometimes" ([source](https://news.ycombinator.com/item?id=47899371))
- Maintenance worries, few recent commits (2 comments): "it's a little concerning it hasn't had any commits in the past 6 months" ([source](https://news.ycombinator.com/item?id=47781254)) "folks in their discord say it's not being actively maintained" ([source](https://news.ycombinator.com/item?id=47783048))
- AWS pack more icons than patterns (2 comments): "D2's AWS pack is more 'icons exist' than 'architecture patterns are easy.'" ([source](https://news.ycombinator.com/item?id=46599272)) "the examples on https://d2lang.com/ don't seem to fit the bill of a typical AWS Architecture diagrams" ([source](https://news.ycombinator.com/item?id=46588195))

## Alternatives hackers recommend

- [Mermaid](https://hackerapproved.com/p/mermaid.md): 93 recommend
- [Reladraw](https://hackerapproved.com/p/reladraw.md): 28 recommend
- [SQL to ER diagram tool](https://hackerapproved.com/p/free-sql-to-er-diagram-tool.md): 27 recommend
- [PlantUML](https://hackerapproved.com/p/plantuml.md): 16 recommend
- [Graphviz](https://hackerapproved.com/p/graphviz.md): 13 recommend

## Cite as

Hacker Approved, "D2 diagram language", https://hackerapproved.com/p/d2/ (counts from 1,795,640 Hacker News comments, November 2025 to November 2026).
