Chalkline / Guides / PlantUML and D2 online

PlantUML and D2 online, free and offline

Diagrams written as code live happily next to your source, but you still need somewhere to see and polish them. Here is how PlantUML and D2 text work, and how to open both as editable diagrams in your browser.

Updated 7 November 2026 · 2 minute read

What "diagrams as code" means

Instead of dragging boxes, you write a few lines of text and a tool draws the diagram. The text sits in your repository, shows up in code review, and never goes out of date because nobody can find the original file. PlantUML, D2 and Mermaid are the three best known languages for this.

LanguageGood atLooks like
PlantUMLUML: sequence, class, activity@startuml … @enduml
D2Architecture and flows with containersapi -> db: query
MermaidFlowcharts, sequence, Gantt, many moreflowchart LR

PlantUML: an activity diagram

A PlantUML activity diagram for a password resetA PlantUML activity diagram for a password resetStartEnter emailAccount found?Send reset linkSet new passwordShow a neutral messageEndyesno
A PlantUML activity diagram for a password resetOpen this example in Chalkline →

The text behind it:

@startuml
start
:Enter email;
if (Account found?) then (yes)
  :Send reset link;
  :Set new password;
else (no)
  :Show a neutral message;
endif
stop
@enduml

PlantUML sequence and class text work too, so a @startuml block you already have in a wiki opens as it is.

D2: a small architecture

A D2 diagram of a web app with a cache and a databaseA D2 diagram of a web app with a cache and a databaseUserWeb appAPICacheDatabaseopensrequestsread firstquery
A D2 diagram of a web app with a cache and a databaseOpen this example in Chalkline →

The text behind it:

direction: right
user: User
web: Web app
api: API
db: Database
db.shape: cylinder
user -> web: opens
web -> api: requests
api -> db: query
  • name: Label gives a node a readable label.
  • a -> b: text draws a labelled arrow. <- and <-> point the other way or both ways.
  • name.shape: cylinder changes the shape; circle, diamond and hexagon work too.
  • direction: right lays the diagram out left to right.

Why open them in a drawing tool?

Text is great for keeping a diagram correct. It is less great for the last mile: nudging a label, adding a note for a slide, colouring one path, or showing it to someone who does not read code. Opening the text in an editor gives you both: generate the layout from text, then polish by hand.

Paste your PlantUML or D2Open Diagram as text and paste it into the flowchart box
Open the example

Opening PlantUML and D2 in Chalkline

In Chalkline, open Diagram as text, paste PlantUML or D2 into the flowchart box and press Apply. Chalkline recognises the language on its own. Activity diagrams and D2 flows become normal flowcharts, so they stay linked: rename a shape on the board and the text updates. Everything runs in your browser; your text is never sent to a rendering server, which matters for diagrams of internal systems.

From there you can switch between hand drawn and clean, export to SVG, vector PDF, editable PowerPoint or TikZ for LaTeX, or embed the diagram on a web page. For Mermaid syntax, see the Mermaid flowchart cheat sheet. For sequence diagrams in detail, see the sequence diagram tutorial.