Skip to content

Why D2?

D2 is a modern language that turns text to diagrams. It stands for Declarative Diagramming.

One of the main advantages of D2 is that its main objective is to output diagrams that are meant to be viewed in a web context. To achieve this, D2 outputs SVG by default which contains the diagram and its associated CSS styles. No client-side JavaScript is required to render the diagrams, even animated ones.

Features

D2 also includes a lot of powerful features out of the box, such as:

You can read more about D2 design decisions on the official website.

Comparison

You can use the “Text to Diagram” comparison tool to compare D2 with other similar tools like Mermaid, Graphviz, PlantUML, etc. from diagram definition, rendering to detailed list of features.