D2 vs Kroki vs PlantUML

D2, Kroki and PlantUML all let engineering teams keep diagrams as version-controlled plain text instead of drag-and-drop files, but they solve different parts…

D2

Free / Open Source · From Free

Best for: Teams that want modern, git-friendly software architecture and infrastructure diagrams with automatic layout and minimal manual positioning.

Kroki

Free / Open Source · From Free

Best for: Teams that need one self-hosted API endpoint to render many different diagram syntaxes, including PlantUML and Mermaid, without installing and maintaining separate renderers.

PlantUML

Open Source · From Free

Best for: Teams standardized on classic UML documentation who want the broadest native diagram-type coverage and the largest ecosystem of editor and CI integrations.

At a Glance

 D2KrokiPlantUML
Primary categoryCollaborationCollaborationCollaboration
RatingNot documentedNot documentedNot documented
Pricing modelFree / Open SourceFree / Open SourceOpen Source
Starting priceFreeFreeFree
Free planYesYesYes
Free trialNot documentedNot documentedNot documented
PlatformsMac, WindowsWebNot documented
Team collaborationNot documentedNot documentedNot documented
AI featuresNot documentedNot documentedNot documented
Public APIYesYesYes

Standout Differences

D2 is purpose-built for architecture diagrams, not general UML

D2's shape library leans into cylinders, queues, clouds and infrastructure icons with selectable dagre and ELK layout engines, giving polished technical diagrams with less manual tuning than classic UML tools, though it uses its own language rather than a widely pre-integrated one like Mermaid.

D2

Kroki trades its own syntax for universal coverage

Rather than defining a diagram language, Kroki exposes one HTTP API that renders over 20 existing syntaxes, including PlantUML, Mermaid, GraphViz, C4 and Excalidraw, which is valuable for teams that don't want to standardize on a single diagram language but do want a single rendering endpoint.

Kroki

PlantUML remains the deepest native UML tool, and a Kroki backend

Among native UML diagram types, PlantUML supports state, class, sequence, use case, activity, component and deployment diagrams out of the box, plus extensions like C4 and Gantt charts, and because it's also one of the syntaxes rendered by Kroki's unified API, it has reach both as a standalone tool and inside Kroki-based pipelines.

PlantUML, Kroki

All three are free with different open-source licenses

D2 is MPL-2.0, Kroki is MIT, and PlantUML is GPL - all are free to self-host with no paid tier documented for the core tool, though the license terms differ enough to matter for teams with strict open-source compliance policies.

D2, Kroki, PlantUML

Feature-by-Feature

Licensing and Deployment

FeatureD2KrokiPlantUML
Open-source, self-hostable coreAvailableAvailableAvailable
Free public hosted instanceNot documentedAvailableAvailable

Diagram Language Coverage

FeatureD2KrokiPlantUML
Own dedicated diagram-description languageAvailableUnavailableAvailable
Single API rendering multiple diagram syntaxesUnavailableAvailableUnavailable
Broad native UML diagram types (sequence, class, use case, state)LimitedAvailableAvailable

Layout, Styling and Integration

FeatureD2KrokiPlantUML
Selectable auto-layout enginesAvailableNot documentedLimited
Built-in visual themes, including dark modeAvailableNot documentedNot documented
Editor and documentation-tool integrationsAvailableAvailableAvailable

Pricing Compared

Starting price reflects the lowest paid tier, not the full cost for every team size or usage level.

D2

D2 (Open Source) — Free N/A

Kroki

Free (Public API or Self-Hosted) — $0 N/A

PlantUML

PlantUML — Free N/A

Pros & Cons

D2

Pros

  • Completely free and open source (MPL-2.0)
  • Diagrams stored as plain text, ideal for Git version control and code review
  • Purpose-built shape library and layout for software architecture diagrams
  • Active open-source community and growing ecosystem of integrations

Cons

  • Newer and less pre-integrated into platforms like GitHub or Notion than Mermaid
  • Requires learning a diagram-specific syntax rather than pure drag-and-drop
  • Advanced visual and collaborative editing requires Terrastruct's separate paid app
  • Auto-layout engines can require manual tuning for very complex diagrams

Kroki

Pros

  • Free to use, both as a self-hosted service and via the public kroki.io API
  • One API covers dozens of diagram-as-code syntaxes instead of installing separate renderers
  • Docker-based self-hosting keeps proprietary diagrams off third-party servers
  • Wide ecosystem of plugins for documentation tools like Asciidoctor, MkDocs, and Confluence
  • Actively maintained open-source project with a permissive MIT license

Cons

  • No official SaaS support contract or SLA, since it is a community open-source project
  • Self-hosting the full set of diagram types requires running multiple companion containers
  • Complex diagrams can render slowly on the free public instance
  • No built-in visual, WYSIWYG diagram editor, since input is text-based markup
  • Documentation assumes familiarity with the underlying diagram syntaxes, such as PlantUML or Mermaid

PlantUML

Pros

  • Completely free and open source with no paid tiers
  • Diagrams-as-code approach fits naturally into version control and documentation-as-code workflows
  • Extremely broad diagram type support beyond just UML
  • Large ecosystem of editor, wiki and CI integrations
  • Long-running, mature project with an active community

Cons

  • Text-based syntax has a learning curve compared to drag-and-drop diagram tools
  • Fine-grained visual styling and layout control is more limited than dedicated design tools
  • Relies on Java and, for some diagram types, Graphviz, which adds setup steps for self-hosting
  • No official commercial support plans, so enterprise users rely on community help or third-party vendors

Use Cases

Choose D2: Teams that want modern, git-friendly software architecture and infrastructure diagrams with automatic layout and minimal manual positioning.
Choose Kroki: Teams that need one self-hosted API endpoint to render many different diagram syntaxes, including PlantUML and Mermaid, without installing and maintaining separate renderers.
Choose PlantUML: Teams standardized on classic UML documentation who want the broadest native diagram-type coverage and the largest ecosystem of editor and CI integrations.

D2

  • Software architecture documentation-as-code — Maintaining architecture diagrams as version-controlled text alongside source code.
  • Auto-generated database ER diagrams — Generating entity-relationship diagrams directly from a live database schema.
  • Technical diagrams in internal docs — Embedding rendered D2 diagrams into wikis and internal documentation sites.

Kroki

  • Docs-as-code diagramming — Embed version-controlled, text-based diagrams directly in Markdown or AsciiDoc documentation instead of maintaining binary image files.
  • Internal developer platforms — Self-host Kroki behind a firewall so architecture and sequence diagrams never leave internal infrastructure.
  • Automated diagram generation in CI/CD — Call the Kroki API from build pipelines to regenerate architecture or pipeline diagrams automatically whenever source text changes.

PlantUML

  • Software architecture documentation — Engineering teams document system architecture and sequence flows as version-controlled text alongside their code.
  • API and onboarding documentation — Technical writers embed generated diagrams directly into Markdown docs and wikis to explain system behavior.
  • Automated diagram generation in CI — Teams generate up-to-date architecture or dependency diagrams automatically as part of build pipelines.

Frequently Asked Questions

Can Kroki render diagrams written in D2 syntax?

Based on Kroki's documented list of 20-plus supported diagram types, which includes PlantUML, Mermaid, GraphViz, C4 and others, D2 is not listed among them, so teams standardized on D2 should keep using D2's own CLI or server rendering rather than expecting Kroki to render D2 files.

Is PlantUML one of the diagram types Kroki supports?

Yes, PlantUML is listed among Kroki's supported diagram languages, meaning a team can send PlantUML markup to Kroki's unified API and get a rendered diagram back without running a separate PlantUML server.

Which of these three is the simplest to self-host?

D2 ships as a single Go binary with no external runtime dependencies. Kroki self-hosts via Docker or Docker Compose, though rendering the full set of 20-plus diagram types means running additional companion service containers. PlantUML runs as a Java application or server and, for some diagram types, also depends on Graphviz being installed.

Do any of these tools have a paid tier?

Based on the provided pricing data, D2, Kroki and PlantUML are all free and open source with no paid tier for the core tool itself. Terrastruct, the company behind D2, does sell a separate commercial visual editor product, but that is distinct from the free D2 language and CLI.

Which tool requires the least setup to try immediately without installing anything?

Kroki is the most immediate option because of its free public instance at kroki.io, which can render diagrams via a simple HTTP request with no local installation. D2 and PlantUML both require downloading and running a local binary, server, or Docker image to render diagrams.

Which tool has the broadest native UML diagram support?

PlantUML goes deepest on classic UML: activity, component, state, class, sequence, use case and deployment diagrams are all natively supported, alongside extensions such as C4, Gantt charts and mind maps. D2 leans architecture-focused rather than UML-complete, and Kroki only reaches UML territory indirectly, by passing PlantUML markup through its API instead of implementing UML support of its own.

Read the full D2 review · Read the full Kroki review · Read the full PlantUML review