Skip to content

PlantUML Alternatives: Code-First and Canvas Tools for Software Diagrams

Mermaid, D2, Structurizr, Graphviz, draw.io and Archboard compared as PlantUML alternatives, with one login sequence in PlantUML, in Mermaid and on a canvas.

· Founder & developer

Published

A PlantUML code block and a keyword table on the left. On the right, a sequence diagram: User sends POST /login to the web app, which calls the auth service, which looks up the user in the database. An alt fragment returns a session cookie or 401 Unauthorized.

Your design docs are full of .puml files. They diff well and cover almost every UML diagram there is, but GitHub shows them as plain text, the CI image needs Java and Graphviz, and the reviewer who could catch the mistake never opens the source.

This post covers what PlantUML does well, why teams look elsewhere, six alternatives with their trade-offs (four that keep diagrams as code and two canvas tools), the same login sequence in PlantUML and Mermaid, and that sequence drawn on a canvas.

What PlantUML does well

PlantUML turns plain text into diagrams, and its range is hard to match. The PlantUML site lists nine UML types, from sequence, class and activity diagrams with forks and swimlanes to deployment and timing diagrams, plus Gantt charts, mind maps, network diagrams, Salt wireframes, ArchiMate and more.

  • Text in the repository. A .puml file changes in the same pull request as the code it describes, and reviewers see the diff.
  • A real preprocessor. Variables, !if, !procedure, !function and !include, also from a URL, let teams share macros across diagrams (preprocessing).
  • A standard library. !include <C4/C4_Container> loads C4-PlantUML, with macros such as Person, Container and Rel, without extra files.
  • Detailed sequence diagrams. Participant shapes such as actor and database, alt, opt, loop and par groups, activation bars, notes and autonumbering.
  • Rendering in GitLab. GitLab.com renders PlantUML blocks with no setup; on GitLab Self-Managed, an administrator enables it.

Why teams look for an alternative

  • GitHub does not render it. GitHub's documentation lists four syntaxes it renders in Markdown: Mermaid, GeoJSON, TopoJSON and ASCII STL. A PlantUML code block stays text, so teams commit exported images or build them in CI.
  • A Java toolchain. PlantUML runs on Java, and use case, class, object, component, deployment, state and legacy activity diagrams use Graphviz for layout. !pragma layout smetana switches to Smetana, a Java port of Graphviz, which the documentation still calls experimental.
  • Layout is a negotiation. You can put left, right, up or down inside an arrow, or write left to right direction, and the use case documentation itself warns against overdoing it. In a large diagram, one new line can move half the picture.
  • The server sees your diagrams. A PlantUML server URL carries the diagram source, compressed with Deflate and re-encoded as ASCII, not encrypted. Anything you render on a public server goes to that server, so teams with private designs run their own PlantUML Server.
  • Few people edit text diagrams. Product managers, support and operations read the result but rarely change the source.

If rendering is your only problem, you may not need to switch. Kroki, MIT-licensed, offers one HTTP API for PlantUML, Mermaid, D2, Structurizr, Graphviz and more, as a free service or self-hosted, and GitLab Self-Managed or Dedicated can use it once an administrator enables it.

What to compare

Three questions decide most choices: who edits the diagram, where it has to render, and how much control you need over the layout.

Tool Strongest at Renders in GitHub or GitLab Markdown Layout
PlantUML UML breadth, detailed sequence diagrams GitLab Graphviz or Smetana, with direction hints
Mermaid Diagrams inside Markdown GitHub and GitLab Automatic
D2 Architecture diagrams as code GitLab Self-Managed, with Kroki dagre, ELK or TALA
Structurizr DSL C4 models with several views GitLab Self-Managed, with Kroki; or export to PlantUML or Mermaid autoLayout per view, or by hand
Graphviz DOT Graphs generated by scripts GitLab Self-Managed, with Kroki dot and other layout programs
draw.io Free general-purpose editing on a canvas No; files or exported images By hand
Archboard Typed nodes on a canvas that people and AI agents edit No; a live SVG image you can link By hand

Six PlantUML alternatives

Mermaid

Mermaid is an MIT-licensed JavaScript library that renders text definitions as SVG. Its documentation covers flowcharts, sequence, class, state and ER diagrams, Gantt charts, C4, mind maps, timelines and more, with use case and architecture diagrams in beta. GitHub and GitLab render it in Markdown without setup.

  • Best for: diagrams that live in READMEs, issues and pull requests.
  • Trade-offs: there is no preprocessor or include mechanism, and layout is automatic. PlantUML types such as timing diagrams and Salt wireframes have no Mermaid counterpart. See Mermaid vs a diagram canvas.

D2

D2 is a diagram language from Terrastruct, released under the Mozilla Public License 2.0. Its CLI bundles three layout engines: dagre (the default), ELK, and TALA, Terrastruct's own opt-in engine for software architecture (closed-source; commercial use needs a license). It has shapes for UML classes and SQL tables, nested containers, and sequence diagrams with groups.

  • Best for: architecture diagrams as code when you want to pick the layout engine.
  • Trade-offs: neither GitHub nor GitLab renders it out of the box, so you export SVG or render through Kroki. Its UML coverage is narrower than PlantUML's.

Structurizr DSL

Structurizr separates the model from the views. A workspace holds a model (people, software systems, containers, components and relationships) and views (system landscape, system context, container, component, dynamic, deployment and more), each laid out with autoLayout or by hand (language reference). Rename a container once and every view changes.

  • Best for: C4 models with several views that must stay consistent. See the C4 model explained with a real example.
  • Trade-offs: views are built around the C4 model (custom views add non-C4 elements, without UML notation); dynamic views number the interactions but are not full sequence diagrams. You render with Structurizr's tools or Kroki, or export to PlantUML, C4-PlantUML or Mermaid.

Graphviz DOT

Graphviz is open source graph visualization software and the layout engine behind many PlantUML diagrams. In DOT you list nodes and edges, and a layout program places them: dot draws layered drawings of directed graphs, and neato, fdp or circo suit other shapes.

  • Best for: generated graphs, such as dependency trees and build graphs, where a script writes the file.
  • Trade-offs: no UML vocabulary, layout control only through attributes, and no rendering in GitHub Markdown.

draw.io (diagrams.net)

draw.io is a free editor with Apache 2.0-licensed source, in the browser or on the desktop. It inserts Mermaid as draw.io shapes, whose Mermaid code can no longer be edited, or as an image that keeps the code. Its manual calls the PlantUML import a partial implementation of the syntax.

  • Best for: a free, familiar editor and files you keep yourself.
  • Trade-offs: a shape is a picture with a label, and once converted, the diagram and its source go separate ways. See draw.io vs Archboard.

Archboard

Archboard is a hosted canvas for structured diagrams. Every node has a type from a pack, such as Sequence, UML, C4 Model, Entity Relation, Cloud or Kubernetes, so a lifeline stays a lifeline. People and AI agents connected over MCP edit the same diagram live, and a share link or a live SVG image keeps docs current.

  • Best for: architecture and sequence diagrams that engineers, non-engineers and agents all edit, with a layout you control.
  • Trade-offs: there is no PlantUML importer; for a .puml file, an AI agent connected over MCP draws it, as in this post. It is closed-source SaaS with no self-hosted edition, and Free covers one seat, three diagrams and 15 diagram nodes per diagram. See how Archboard compares with other diagram tools.

The same sequence in PlantUML and Mermaid

A login request with two outcomes, in PlantUML:

@startuml
actor User
participant "Web app" as Web
participant "Auth service" as Auth
database "User DB" as DB

User -> Web: POST /login
Web -> Auth: verify(email, password)
Auth -> DB: find user by email
DB --> Auth: user or none
alt password matches
  Auth --> Web: user id
  Web --> User: 200 OK, session cookie
else no user or wrong password
  Auth --> Web: invalid credentials
  Web --> User: 401 Unauthorized
end
@enduml

And in Mermaid:

sequenceDiagram
  actor User
  participant Web as Web app
  participant Auth as Auth service
  participant DB as User DB
  User->>Web: POST /login
  Web->>Auth: verify(email, password)
  Auth->>DB: find user by email
  DB-->>Auth: user or none
  alt password matches
    Auth-->>Web: user id
    Web-->>User: 200 OK, session cookie
  else no user or wrong password
    Auth-->>Web: invalid credentials
    Web-->>User: 401 Unauthorized
  end

The translation is almost mechanical: -> becomes ->>, --> becomes -->>, and alt, else and end keep their names. Three things need work by hand: database needs Mermaid's JSON type syntax, participant DB@{ "type": "database" }, or it draws as a plain box; skinparam styling has to be redone; and preprocessor code has to be expanded.

How to choose

If you mainly need Start with
Diagrams that render on GitHub with no build step Mermaid
Every PlantUML feature you use today, rendered anywhere PlantUML behind Kroki or your own server
C4 models where one change updates every view Structurizr DSL
Architecture diagrams as code with a choice of layout engines D2
Graphs generated by scripts Graphviz DOT
A free editor and files you keep yourself draw.io
Typed nodes, your own layout, and live editing with people and AI agents Archboard

Migrate by diagram, not by repository. Sequence diagrams and small flowcharts move to Mermaid quickly, C4 diagrams to Structurizr or a canvas with a C4 pack, and the system overview everyone opens during onboarding belongs where everyone can edit it. Architecture diagrams that don't rot covers keeping them current afterwards.

The login sequence diagram

The same sequence on a canvas. We gave login.puml to an AI agent connected to Archboard over MCP, which drew each participant and message with a Sequence pack type and kept the source beside it:

A PlantUML code block and a keyword table on the left. On the right, a sequence diagram: User sends POST /login to the web app, which calls the auth service, which looks up the user in the database. An alt fragment returns a session cookie or 401 Unauthorized.

12 components · 8 connections

Open in Archboard
Diagram contents
  • User
  • Web app
  • Auth service
  • User DB
  • POST /login
  • verify(email, password)
  • find user by email
  • user or none
  • user id
  • 200 OK, session cookie
  • invalid credentials
  • 401 Unauthorized
The login sequence from this post: the PlantUML source on the left, the same messages drawn with the Sequence pack on the right, and the alt block as a fragment.

How to read it:

  • Left column: login.puml as a Code block, with line numbers, and a table that maps each PlantUML keyword and arrow to its counterpart on the canvas.
  • Top row: four participants: the User actor, the Web app and Auth service lifelines, and User DB as an Entity, because the pack has no database participant.
  • Arrows: solid lines with filled heads are calls (PlantUML ->); dashed lines with open heads are replies (-->).
  • The alt fragment holds both outcomes, and the dotted divider separates the guards [password matches] and [no user or wrong password].

Drawing sequence diagrams clearly

  • One scenario per diagram. Put alternative outcomes in an alt fragment; if you need more than two or three, draw a second diagram.
  • Label messages with the real call or result: POST /login and 401 Unauthorized say more than "login" and "error".
  • Keep calls and replies distinct: solid for calls, dashed for replies, in every diagram of the set.
  • Order participants by first use, left to right. In PlantUML, declaration order sets the display order, so declare participants at the top.

Common mistakes are two scenarios mixed in one diagram, replies drawn as new calls, unlabeled arrows, and sequence diagrams used to show deployment. The sequence diagram example walks through a longer flow, OAuth 2.0 with PKCE.

Build it in Archboard

  1. Sign in with Google or GitHub and create a diagram.
  2. From the Sequence pack, add an Actor named User, two Lifeline nodes named Web app and Auth service, and an Entity named User DB, in one row with the same height.
  3. Draw the eight messages from top to bottom: the three calls as solid lines with filled arrowheads, and the five replies as dashed lines with open arrowheads.
  4. Add a Fragment from the Sequence pack with the operator alt over the last four messages, and two Core Text guards: [password matches] and [no user or wrong password].
  5. From the Core pack, add a Code block with the PlantUML source and a Markdown block with the keyword table, plus three Core Text notes for the title and the two column captions.
  6. Or give the .puml file to an AI agent connected to Archboard over MCP, then check its drawing against the source.

If your diagrams are Mermaid flowcharts or ER diagrams, the Mermaid converter turns them into a first draft; sequence diagrams are not converted yet. To show the result in a README or wiki, see how to embed live diagrams in docs. The example uses 7 diagram nodes (four participants, the fragment, the Code block and the Markdown block) and 5 text notes, well within the Free plan's 15 diagram nodes per diagram.

FAQ

Does GitHub render PlantUML? No. GitHub renders Mermaid, GeoJSON, TopoJSON and ASCII STL in Markdown. For PlantUML, commit exported SVG or PNG files, or generate them in CI.

Can I convert PlantUML to Mermaid? Sequence diagrams map almost keyword for keyword, as shown above, so converting them by hand or with an AI assistant is quick. Styling, preprocessor code and types Mermaid lacks, such as timing diagrams, need rework or another tool.

Do I need Graphviz to run PlantUML? For use case, class, object, component, deployment, state and legacy activity diagrams, yes, unless you switch to Smetana with !pragma layout smetana, available since version 1.2021.5 and still experimental. Sequence diagrams and the other types do not use Graphviz. On Windows, PlantUML 1.2020.21 and later ship a minimal dot.exe and use it when Graphviz is not installed.

Can Archboard import PlantUML files? Not directly. An AI agent connected over MCP can read a .puml file and draw it with the Sequence, UML or C4 Model pack, as in this post, and the Mermaid converter handles flowcharts and ER diagrams.

Start free — one seat, no credit card.

Related posts

← Back to blog

Open a canvas in a minute

Sign in with Google or GitHub. Free for a single seat. Upgrade when the team joins.