Tools that turn plain-text descriptions into diagrams, so diagrams live in version control next to the code and documentation they describe. Mermaid renders flowcharts, sequence diagrams and more from Markdown-like text and is supported in GitHub Markdown; WaveDrom draws digital timing diagrams.

By GitHub stars, the most popular diagram-as-code tools here are Mermaid (91.1K stars), Diagrams (42.8K stars), and D2 (25.9K stars). 16 of 18 had commits in the last 90 days.

Diagrams as code, ranked by GitHub stars
1 Mermaid

Generate diagrams and flowcharts from markdown-like text definitions, with a live editor.

91.1K 2,832 MIT
2 Diagrams

Diagram as code in Python for prototyping cloud system architectures.

42.8K 46 MIT
3 D2

Declarative diagram scripting language that turns text into diagrams.

25.9K 328 MPL-2.0
4 PlantUML

Generates UML, Gantt, mind map and other diagrams from plain text.

13.4K 935 LGPL-3.0
5 Markmap

Builds interactive mind maps from Markdown.

13.3K 4 MIT
6 flowchart.js

Draws SVG flowcharts from a textual description.

8.7K 5 MIT
7 Penrose

Creates diagrams from mathematical notation in plain text, from Carnegie Mellon University.

8K 48 MIT
8 C4-PlantUML

PlantUML macros and styles for drawing software architecture diagrams with the C4 model.

7.5K 18 MIT
9 LikeC4

Architecture-as-code language and tools that generate live, interactive diagrams.

6.1K 2,023 MIT
10 Pele

Small, dependency-free renderer that turns Mermaid diagrams into SVG, from Obsidian.

4.6K 424 MIT
11 Kroki

Unified API that renders diagrams from many text formats, including PlantUML, Mermaid, Graphviz and D2.

4.4K 292 MIT
12 Svgbob

Converts ASCII art diagrams into SVG.

4.2K 2 Apache-2.0
13 WaveDrom

Draws timing diagrams and waveforms from simple textual descriptions.

3.5K 14 MIT
14 Flowchart Fun

Web app that generates flowcharts and diagrams from indented text.

3.4K 79 MIT
15 nomnoml

Draws UML diagrams from a simple text syntax.

2.8K 1 MIT
16 CeTZ

Drawing library for Typst with a TikZ-inspired API, for diagrams and plots.

1.9K 181 LGPL-3.0
17 PGF/TikZ

TeX packages for programmatically drawing vector graphics and diagrams in LaTeX.

1.4K 128 GPL-2.0 OR LPPL-1.3c
18 PGFPlots

TeX package for drawing 2D and 3D plots directly in LaTeX documents.

261 13 –

Head-to-head comparisons

Related topics

Related categories

Frequently asked questions

What is the most popular diagram-as-code tool?

By GitHub stars, Mermaid is the most popular, with 91.1K stars, followed by Diagrams (42.8K) and D2 (25.9K).

Which diagram-as-code tools are actively maintained?

18 of the 18 tools listed had commits in the last 12 months, including Mermaid, Diagrams, D2, PlantUML, and Markmap. Each tool page shows monthly commit activity.

Are these diagram-as-code tools free and open source?

17 of the 18 tools listed use an OSI-approved open-source license; the others are source-available, free to use, or use a custom license, so check each tool page. The most common license here is MIT.

Missing a tool? Add it with a one-line pull request to the README.