D2 diagram language
Hacker ApprovedRanked 4 of 11 diagram tools by recommenders
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.
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.
27 people gave an opinion
- recommend it
- 21
- criticize it
- 6
- approval share
- 78%
Recommended in 6 of 13 months
- November 2025: not recommended
- December 2025: not recommended
- January 2026: recommended
- February 2026: not recommended
- March 2026: not recommended
- April 2026: recommended
- May 2026: not recommended
- June 2026: recommended
- July 2026: not recommended
- August 2026: recommended
- September 2026: recommended
- October 2026: recommended
- November 2026: not recommended (month in progress)
Why it carries the badge
- 21 people recommend itNeeds 10 or more, met.
- 3.5 recommenders for every criticNeeds 2 to 1 or better, met.
- Recommended in 6 of 13 monthsNeeds 4 or more, met.
The same three rules apply to every product, and the badge can’t be bought. How the badge works
What people say about it
The reasons people give, with the number of comments that give each one. Open a reason to read what they said.
Why people recommend it
Each mark is one comment
Cleaner, more expressive than Mermaid
“I've switched to D2 from mermaid after they removed ELK from the base”
Comment from 12 Aug 2026 in “Show HN: Line9 - a Mermaid rendering engine with its own layout” “is a nicer language than Mermaid with much nicer visual appearance”
Comment from 15 Apr 2026 in “Pretty Fish: A better mermaid diagram editor” “D2 feels cleaner and more expressive than Mermaid.”
Comment from 15 Apr 2026 in “Pretty Fish: A better mermaid diagram editor” - Comment from 22 Apr 2026 in “Zindex – Diagram Infrastructure for Agents”
Good results for architecture diagrams
“I love making (architecture) diagrams in D2”
Comment from 18 Jan 2026 in “Iconify: Library of Open Source Icons” “I found I had better results with D2”
Comment from 18 Oct 2026 in “Pele – Mermaid diagrams as themeable SVG” “I have had good luck with D2”
Comment from 17 Oct 2026 in “Pele – Mermaid diagrams as themeable SVG” Strong icon support
“has better icon support and was designed for architecture diagrams”
Comment from 12 Jan 2026 in “Show HN: Ferrite – Markdown editor in Rust with native Mermaid diagram rendering” “D2 has better icon support if you need that now.”
Comment from 11 Jan 2026 in “Show HN: Ferrite – Markdown editor in Rust with native Mermaid diagram rendering” Declarative layouts and consistent language
“The language is richer and all diagram types are implemented consistently in the same language in a way that can be composed”
Comment from 15 Apr 2026 in “Pretty Fish: A better mermaid diagram editor” “check D2 with declarative layouts instead of hardcoding drawing instructions”
Comment from 28 Jun 2026 in “Show HN: DiagramIDE – Diagrams as Source Files”
What people warn about
Each mark is one comment
Weak default layout and little control
“the default layout engine is pretty terrible for some types of graphs”
Comment from 8 Sep 2026 in “TALA Is Open-Source” “the lack of control over the layout is a bit frustrating sometimes”
Comment from 25 Apr 2026 in “"Plain text has been around for decades and it's here to stay." – Unsung” Maintenance worries, few recent commits
“it's a little concerning it hasn't had any commits in the past 6 months”
Comment from 15 Apr 2026 in “Pretty Fish: A better mermaid diagram editor” “folks in their discord say it's not being actively maintained”
Comment from 15 Apr 2026 in “Pretty Fish: A better mermaid diagram editor” AWS pack more icons than patterns
“D2's AWS pack is more 'icons exist' than 'architecture patterns are easy.'”
Comment from 13 Jan 2026 in “Show HN: Ferrite – Markdown editor in Rust with native Mermaid diagram rendering” “the examples on https://d2lang.com/ don't seem to fit the bill of a typical AWS Architecture diagrams”
Comment from 12 Jan 2026 in “Show HN: Ferrite – Markdown editor in Rust with native Mermaid diagram rendering”
Other diagram tools people recommend
The four most recommended other diagram tools, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.
| Product | Recommend | Criticize | Approval | Months | Owned | Badge |
|---|---|---|---|---|---|---|
| Mermaid | 93 | 46 | 67% | 12 | — | Approved |
| Reladraw | 28 | 7 | 80% | 1 | — | — |
| SQL to ER diagram tool | 27 | 1 | 96% | 2 | — | — |
| D2 diagram languageThis page | 21 | 6 | 78% | 6 | — | Approved |
| PlantUML | 16 | 2 | 89% | 6 | — | Approved |
What people said
27 of the 32 comments that mention it, newest first. Each links to the original comment.
“I found I had better results with D2”
“I have had good luck with D2”
“it doesn't handle hypergraphs IIRC”
“the default layout engine is pretty terrible for some types of graphs”
“saved me much more time than that”
“Really cool, seems like the right balance.”
“I remain a bit concerned.”
“But D2 for everything else.”
“I've switched to D2 from mermaid after they removed ELK from the base”
“check D2 with declarative layouts instead of hardcoding drawing instructions”
“the lack of control over the layout is a bit frustrating sometimes”
“an argument for D2 over Mermaid”
“d2 produces real svgs but I've found them to have a hard time displaying in other svg editors”
“folks in their discord say it's not being actively maintained”
“it's a little concerning it hasn't had any commits in the past 6 months”
“D2 feels cleaner and more expressive than Mermaid.”
“The language is richer and all diagram types are implemented consistently in the same language in a way that can be composed”
“is a nicer language than Mermaid with much nicer visual appearance”
“the main problem of D2, which is the orientation of diagrams”
“this looks really good and is written in Go!”
“I love making (architecture) diagrams in D2”
“D2's AWS pack is more 'icons exist' than 'architecture patterns are easy.'”
“the examples on https://d2lang.com/ don't seem to fit the bill of a typical AWS Architecture diagrams”
“has better icon support and was designed for architecture diagrams”
“D2 has better icon support if you need that now.”
“D2 (another diagram language) has better manual positioning”
“I'm discouraged from using mermaid and D2's online playground for privacy reasons”
Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.