D2
D2: A strong developer-focused choice for diagrams-as-code and offline rendering. Ranked #29 of 44 in Diagramming Software by our editors (6.3/10); pricing: Free plan; best for open-source diagrams-as-code.
At a glance
- Editor score6.3 / 10
- PricingFree plan
- Best forOpen-source diagrams-as-code
- Free planYes
- Paid fromFree
- Facts checked20 Sep 2026

Where it wins
- Text-based syntax supports versionable, repeatable diagram workflows
- Local CLI, watch mode, multiple layouts, themes, and sketch mode
- Exports to SVG, PNG, PDF, PPTX, GIF, and ASCII
Where it doesn't
- Text-first authoring is less suited to drag-and-drop diagramming
- Developer-oriented features may not fit general business users
- Local workflows are not centered on hosted collaborative editing
Our verdict on D2
D2 is an open-source declarative diagramming language for software engineers. Users write diagrams as text files and render them through a local command-line interface, watch mode, or the D2.js browser and Node.js library. It fits teams and individuals creating software architecture diagrams, UML class diagrams, and sequence diagrams who prefer diagrams-as-code, offline editing, and repeatable source files. D2 runs on macOS, Linux, and Windows, with an online playground for browser-based creation and sharing.
Its strongest differentiator is the depth of its text-based workflow. Containers, imports, variables, and globs support structured diagram sources, while Markdown, LaTeX, tables, code snippets, images, and icons add content beyond basic shapes and labels. Interactive tooltips and links can add context to diagrams. Multiple layout engines, themes, and sketch mode provide rendering options without changing the underlying declarative approach. Integrations with Visual Studio Code and Vim fit developer editors, while the language API and D2.js extend diagram generation into browser and Node.js projects.
D2 also covers a wide range of output needs: SVG, PNG, PDF, PPTX, GIF, and ASCII exports support graphical, document, presentation, animated, and text-based use cases. That breadth makes it practical when diagrams need to move beyond a source repository. The tradeoff is focus: D2 is a local developer tool rather than a hosted collaborative editor, and its text-first model is not aimed at users who want a primarily visual, drag-and-drop experience. Choose it for open-source diagrams-as-code, local CLI workflows, and software-focused documentation; choose a different category option if real-time collaborative editing or a desktop GUI is central to the workflow.
Your product? Our editors can test D2 in depth and publish a review, labelled as paid · from $149/mo →
D2 pricing
D2 fact sheet
| Free plan | Yes |
|---|---|
| Paid from | Free |
| Real-time collaboration | Not verified |
| Diagram types | software architecture diagrams; UML class diagrams; sequence diagrams |
| Desktop apps | Not verified |
| Offline editing | Yes |
| Import/export formats | D2 (.d2); SVG; PNG; PDF; PPTX; GIF; ASCII |
| Editor seat limit | Not verified |
| Deployment | Cloud, Desktop |
| Platforms | Web, Windows, macOS, Linux |
| Support | Community, Docs |
| Built for | Solo, Small business, Mid-market, Enterprise (editorial estimate) |
| Integrations | 4 integrations: Visual Studio Code, Vim, D2.js, Online playground |
| Pricing | Free plan |
| Website | d2lang.com |
| Facts checked | 20 Sep 2026 |
D2 integrations
D2 lists 4 integrations on its own site.
- Visual Studio Code
- Vim
- D2.js
- Online playground
Alternatives to D2
- draw.ioA broad, free diagramming editor with strong format support and collaboration options.9.4
- LucidchartA broad, collaborative diagramming workspace for business and technical teams.9.3
- Microsoft VisioA mature Microsoft-focused diagramming suite with web, Teams, and desktop options.9.1
Used D2? Be the first to review it
The editor score above is our own research. What this page doesn't have yet is a reader's view — what you used D2 for, what worked and what didn't. No stars are seeded and no review is paid for; an editor reads every one before it appears.
Write a reviewTwo minutes · verified accounts only · read by an editor before it appears
Featured on iTechGuides
D2 is listed in our Diagramming Software directory. Add the badge to your site — it links back to this page.
<a href="https://www.itechguides.com/products/d2/"><img src="https://www.itechguides.com/best/badge/d2.svg" alt="Featured on iTechGuides" width="230" height="46"></a>
Reviewed by iTechGuides Editors · Editorial team · Updated Oct 2026
Advertiser disclosure: iTechGuides is reader-supported. Vendors can pay for top positions in our rankings and for a place on other products' pages, and we may earn a commission when you click some links. Bought places stand at the number bought; this page and our disclosure say so. Paying vendors may get a fuller, more detailed review from our editors, and that review can change their score. How we rank.
Last updated · How we research and update


