Skip to content

From D2

From D2 converts D2 source into editable LetDraw shapes. The flow is the same as From Mermaid; only the language is D2. It requires no AI and runs fully offline.

From D2: source on the left, live preview on the right

More tools (⋯) → From D2 in the bottom toolbar. (The same window is the D2 tab of Prompt to diagram.)

  1. Open More tools → From D2.
  2. Type/paste the D2 code into the left editor; a live preview appears on the right.
  3. Adjust the line style and zoom, then use Add to place it on the canvas.
server: Web Sunucusu
db: Veritabanı {shape: cylinder}
cache: Redis
server -> db: sorgu
server -> cache: oku/yaz
db -> cache: ısıt

D2 supports common structures like the shape type via shape: (cylinder, queue, person…), nodes, and labeled arrows. An unsupported structure shows a warning in the preview.

  • No key is needed; it runs fully offline.
  • You can turn the diagram you generated back into D2 with Diagram to Code.