Skip to content
D2 logo

Terrastruct

D2

Write code

Open-source diagram language from Terrastruct: you write declarative D2 text and the CLI renders it; the paid D2 Studio editor is shutting down at the end of 2026.

Visit D2Compare with anotherChecked 17 October 2026
How you draw
Code
Free for work
Yes
Open source
Paid from
Free
Open source
Exports
SVG, PNG, PDF
Runs on
Web, Windows, Mac, Linux
Works offline
Made by
Terrastruct
United States

Good to know

  • The free version can be used for work
  • Works fully offline
  • Open source (MPL-2.0)
  • Diagrams as code: D2

Where it stands among 24

Each fact with every app's answer. D2 is outlined.

Plans and prices

In USD, per month, as listed by Terrastruct. Checked 17 October 2026.

PlanBilled yearlyBilled monthlySeatsNotes
FreeFree and open sourceUnlimited with the open-source CLIWork use: allowed
D2 StudioNot statedNot statedNot statedPaid monthly or annually after a free trial; shutting down at the end of 2026.
Free for work use
YesYes
One-time licence
Not stated
Enterprise
Price on request

How you make a diagram

Ways to draw
Code
AI from a text prompt
Not statedNot stated Not stated
AI limits
Not applicable No AI features stated
Diagram code
D2 Declarative D2 language; D2 Studio added two-way text and GUI editing
Diagram types
UML, Sequence, Cloud architecture General technical diagrams; curated icon set

What you get out

SVG
YesYes Default CLI output
PNG
YesYes
PDF
YesYes
Visio (VSDX)
Not statedNot stated Not stated
Watermark on free exports
NoNo Open-source CLI output
Imports
None No diagram file import stated

Where it runs and where files live

Apps
Web, Windows, Mac, Linux
Works offline
YesYes The CLI works fully offline
Open source
YesYes The D2 language and CLI; D2 Studio isn't
Self-hosting
Paid plansPaid plans Enterprise self-hosted D2 Studio; the CLI runs anywhere
Where diagrams are stored
Files on your device, GitHub, Maker's cloud Local .d2 files; D2 Studio on Google Cloud with GitHub sync
Works inside
GitHub, Confluence, Slack, VS Code, Jira Through Terrastruct plugins and its Atlassian integration
Live co-editing
Not statedNot stated Not stated
API
YesYes D2 Language API for creating diagrams in code

Who you're trusting

Company
Terrastruct, Inc.
Owned by
Not stated No parent company stated
Based in
United States San Francisco address
Launched
2022 D2 was open-sourced in November 2022
Security reports
SOC 2 Type not stated
Single sign-on
Not stated The run reported SSO on Enterprise; not in the cited excerpt
Data residency
Not stated None stated

Where we recommend it

Compare D2