D2

d2lang.com ↗

Turn a concise text description into a customizable diagram with the D2 language.

SI Score
75/100
Pricing
Open Source AI reading, not confirmed
Free plan
Not confirmed
Sign-up required
Not confirmed

Ask SI about D2

Answers use saved listing facts and recorded sources.
Homepage screenshot
Screenshot of the D2 homepage

What it does

D2 is a diagram scripting language that turns text into diagrams. Its official documentation presents it as a declarative language with customizable themes and layout options; source files can be rendered into diagrams for use in documentation and design materials. D2 is a command-line and language project rather than a hosted diagramming service.

Keep diagrams in text form

Write a D2 source file describing the components and connections in a system, then render it as a diagram. The official documentation shows examples that turn structured text into network and architecture diagrams, and the project supports themes and layout customization. Keeping the diagram in source form makes changes reviewable and easier to regenerate alongside code or design notes.

D2 is useful when a team prefers diagram-as-code over drawing every shape by hand. It produces diagrams from the structure the author supplies; it does not infer a system architecture from arbitrary code or prose. The official repository is licensed under the Mozilla Public License 2.0. For example, keep a small web -> api -> database diagram beside the service documentation and review the source change with the code.

Strengths

  • Text-based diagram source can be reviewed and kept alongside project documentation.
  • Themes and layout options let authors customize the generated diagram.
  • The official project supports export to multiple diagram formats and includes language tooling.

Watch out for

  • The author must describe the nodes and relationships in source; D2 does not automatically discover a system architecture.

Best for

  • Maintaining architecture or process diagrams as version-controlled text
  • Generating repeatable diagrams for technical documentation
  • Teams that want customizable diagram-as-code rather than a hosted drawing canvas

Sources