AI & Generative AI

Diagrams in the AI Era — Complete Guide: 26 Code-Manageable Tools, Recommended by Use Case

Diagrams in the AI Era — Complete Guide: 26 Code-Manageable Tools, Recommended by Use Case

Thank you for visiting this site. This article provides a cross-cutting comparison of all 26 code-manageable diagram tools for the AI era and summarizes recommendations by use case.

With 26 tools, you are probably thinking “so which one should I actually use?” — this article tells you exactly that. Each category table has a link to the detailed article below it, so follow those links for anything that catches your interest.

What Does “Managing Diagrams as Code” Mean?

When you create a diagram in PowerPoint or draw.io, what gets saved is a binary file (a data format humans cannot read). Binary files come with awkward problems:

  • Contents are unreadable — opening the file reveals a sequence of 0s and 1s; there is no way to tell what is where
  • Changes cannot be seen — a Git diff only shows “something changed” — you cannot distinguish “one arrow was added” from “the whole thing was rebuilt”
  • AI cannot generate them — AI is a text-output tool and cannot directly generate binary images
  • The original tool is needed to edit — a diagram made in PowerPoint cannot be modified without PowerPoint

By contrast, the tools in this article define diagrams as text (code). For example, in Mermaid, writing the following text auto-generates a flowchart:

Sample Mermaid flowchart output

flowchart TD
  A[Start] --> B{Condition}
  B -->|Yes| C[Process A]
  B -->|No| D[Process B]

Because it is text, you can ask AI to “draw this diagram”, Git diffs show exactly which arrows were added, and anyone with a text editor can modify it.

With AI coding assistants now ubiquitous, I am convinced that the scope for code-managed diagrams will only expand going forward. Diagrams auto-updating in sync with documentation changes, diagram diffs visible in PR reviews, design discussions with AI that return specification-ready diagrams — all of this is already achievable, and will become even more natural as tools and AI continue to evolve.

Quick Reference: All 26 Tools

Below is a quick-reference table of all 26 tools across 8 categories. For anything of interest, follow the link below each category table for sample code and full details.

General-Purpose Diagrams (6 tools)

The go-to tools for flowcharts, sequence diagrams, ER diagrams, and other common development diagrams.

NameSyntaxAI CompatibilityDiagram TypesHighlights
MermaidCustomFlowchart, sequence, ER, Gantt, state machine, and 10+ moreEmbeds directly in GitHub. Start here if in doubt
D2CustomFlowchart, architecture, nested structure diagramsExcellent nesting syntax. Modern look
PlantUMLCustomAlmost all UML types (class, sequence, use-case, etc.)Suitable for formal UML-compliant documentation
GraphvizDOT languageNode-and-edge graphs (dependencies, data structures)Auto-layouts large numbers of nodes cleanly
NomnomlCustomClass and object diagramsRuns in the browser with no setup. Handy for quick sketches
PikchrPIC-basedCoordinate-based custom diagramsPixel-level layout control. For advanced users

For sample code, pros and cons, and full details, see:

Diagrams in the AI Era — 6 General-Purpose Tools: Mermaid, D2, PlantUML, Graphviz, Nomnoml, Pikchren.senkohome.com/ai-diagram-general/

Vector and Direct Drawing (3 tools)

Techniques for specifying coordinates and styles yourself to draw shapes. Expressive power is high, but code volume is large — best used as a supplement to general-purpose tools.

NameSyntaxAI CompatibilityWhat You Can DrawHighlights
SVGXMLAny shape (icons, logos, diagrams, etc.)No degradation on zoom. Also used as an output format by other diagram tools
CSS ArtCSSUI parts, icons, decorationsNo extra software needed — just HTML and CSS
Canvas / p5.jsJavaScriptAnimations, interactive figures that respond to mouse inputCreate moving and touchable diagrams

For sample code, pros and cons, and full details, see:

Diagrams in the AI Era — 3 Vector and Direct-Drawing Tools: SVG, CSS Art, Canvas/p5.jsen.senkohome.com/ai-diagram-vector/

Text Art (3 tools)

Drawing diagrams using only characters like +, -, |. No dedicated software required, and AI compatibility is good.

NameSyntaxAI CompatibilityWhat You Can DrawHighlights
ASCII ArtTextDiagrams composed purely of charactersNo dedicated software needed. Embeds in source code comments
DitaaTextASCII art → image (PNG) conversionConverts character diagrams to hand-drawn-style images
SvgbobTextASCII art → clean SVG conversionHigher quality than Ditaa. Also handles curves

For sample code, pros and cons, and full details, see:

Diagrams in the AI Era — 3 Text Art Tools: ASCII Art, Ditaa, Svgboben.senkohome.com/ai-diagram-textart/

Design-Specific (3 tools)

Domain-specific dedicated tools. They deliver expressive power and productivity in their respective areas that no general-purpose tool can match.

NameSyntaxAI CompatibilityDiagram TypesHighlights
Structurizr DSLCustom DSLSystem-wide architecture (4 zoom levels)Auto-generates from high-level to detailed views from a single definition
DBMLCustomDatabase table relationship diagrams (ER diagrams)Auto-generates ER diagrams; can also convert to SQL
Diagrams (Python)PythonCloud architecture diagrams (AWS/GCP/Azure)500+ official cloud icons built in

For sample code, pros and cons, and full details, see:

Diagrams in the AI Era — 3 Design-Specific Tools: Structurizr, DBML, Diagrams (Python)en.senkohome.com/ai-diagram-domain-design/

Hardware and Syntax (3 tools)

Quite niche content. Feel free to skip if digital circuit timing diagrams or protocol specifications are not your domain.

NameSyntaxAI CompatibilityDiagram TypesHighlights
WaveDromJSONDigital signal waveform diagrams (timing charts)For hardware design and protocol specifications
Railroad DiagramJavaScript / PythonProgramming language syntax diagrams (railway-style diagrams)For explaining language specs and API argument patterns
Bytefield-svgCustomCommunication packet byte structure diagramsFor network protocol specifications

For sample code, pros and cons, and full details, see:

Diagrams in the AI Era — 3 Hardware and Syntax Tools: WaveDrom, Railroad Diagram, Bytefielden.senkohome.com/ai-diagram-domain-hardware/

Charts and Graphs (4 tools)

The go-to tools for bar charts, line charts, pie charts, and other data visualization.

NameSyntaxAI CompatibilityChart TypesHighlights
Vega-LiteJSONBar, line, scatter, heatmap, and many moreJSON-defined. Excellent AI compatibility
Chart.jsJavaScriptBar, line, pie, radar, scatter, and moreWidely used; abundant information available
RechartsJSX (React)Bar, line, pie, radar, area, and moreIntegrates naturally into React apps
Observable PlotJavaScriptBar, line, scatter, density estimation, and moreHigh-quality output with minimal code. Designed by the D3.js creator

For sample code, pros and cons, and full details, see:

Diagrams in the AI Era — 4 Chart and Graph Tools: Vega-Lite, Chart.js, Recharts, Observable Ploten.senkohome.com/ai-diagram-dataviz/

Mind Map and Whiteboard (2 tools)

Suited for organizing thoughts and rough sketches. Markmap auto-generates from text; Excalidraw draws intuitively with a mouse.

NameSyntaxAI CompatibilityWhat You Can DrawHighlights
MarkmapMarkdownMind maps from MarkdownVisualize AI output directly
ExcalidrawGUI (saved as JSON)Free-form hand-drawn-style diagramsDraw intuitively with a mouse. Great for rough sketches

For sample code, pros and cons, and full details, see:

Diagrams in the AI Era — 2 Mind Map and Whiteboard Tools: Markmap, Excalidrawen.senkohome.com/ai-diagram-whiteboard/

Math and Academic (2 tools)

Diagram and notation tools used in academic papers and textbooks.

NameSyntaxAI CompatibilityWhat You Can DrawHighlights
TikZ/PGFLaTeXAny diagram at academic paper qualityThe world standard in LaTeX environments. Vast domain-specific library ecosystem
KaTeX / MathJaxLaTeXMathematical notation on the webAI generates with high accuracy

For sample code, pros and cons, and full details, see:

Diagrams in the AI Era — 2 Math and Academic Tools: TikZ, KaTeX/MathJaxen.senkohome.com/ai-diagram-academic/

Recommendations by Use Case

If the tables above leave you undecided, use the following as a reference.

What you want to doRecommendation
Just need a diagramMermaid — embeds in GitHub, easy for AI to generate
Draw an architecture diagramD2 — natural nesting syntax. For cloud icons, use Diagrams (Python)
Need a database ER diagramDBML — specialized for ER diagrams. Can also convert to SQL
Need a data chartVega-Lite (if AI will generate) / Chart.js (if embedding in a web app)
Need a figure for an academic paperTikZ — the standard in LaTeX environments
Want to organize your thinkingMarkmap — just write Markdown and it becomes a mind map
Need a rough sketchExcalidraw — draw intuitively with a mouse
Want to embed a diagram in source code commentsASCII Art — no dedicated software, works in any text editor

Where You Will Display It

Display targetRecommendation
GitHub READMEMermaid (native support)
Website / blogSVG, Mermaid, KaTeX
Academic paperTikZ
PresentationExcalidraw, Diagrams (Python)
Inside source codeASCII Art

Choose by Diagram Type

Diagram typeRecommendation
FlowchartMermaid, D2
Sequence diagramMermaid, PlantUML
ER diagramDBML, Mermaid
Class diagramPlantUML, Mermaid
Architecture diagramD2, Diagrams (Python)
Dependency graphGraphviz
Data chartVega-Lite, Chart.js
Mind mapMarkmap
Mathematical notationKaTeX / MathJax

Kroki — One Service for Multiple Tools

When you want to use multiple tools introduced so far from a single service, Kroki is a handy option.

Kroki is a rendering service that provides access to 20+ diagram tools through a single API. It supports Mermaid, PlantUML, Graphviz, D2, Svgbob, WaveDrom, and many other tools covered in this article.

Usage is simple — specify the tool name in the URL path and send the code:

# Generate a Mermaid flowchart
curl -X POST https://kroki.io/mermaid/svg \
  -d 'flowchart TD
    A[Start] --> B{Check}
    B -->|Yes| C[Process]
    B -->|No| D[End]'

# Generate a PlantUML sequence diagram
curl -X POST https://kroki.io/plantuml/svg \
  -d '@startuml
Alice -> Bob: Hello
Bob --> Alice: Hi
@enduml'

No tool installation whatsoever — just hit the HTTP API to get a diagram. docker run -d -p 8000:8000 yuzutech/kroki enables self-hosting, so it can be operated in a closed internal network.

Dependency on an external service means the official server going down stops diagram generation (avoidable with self-hosting).

Summary

This article introduced all 26 code-manageable diagram tools for the AI era, organized into 8 categories.

Honestly, there is no need to memorize all 26. Personally, I only use 4–5 tools regularly — the rest I pull out only when the need arises. What matters is having “I know tools like this exist” somewhere in the back of your mind, so that when the moment comes you can recall “right, there was a tool for this.”

Start with Mermaid, and add DBML, Diagrams (Python), Vega-Lite, and other specialized tools as needed — that progression works perfectly. If you end up using multiple tools, unifying via Kroki’s API is also a good strategy.

I hope this article helps you choose the right diagram tool for your needs.

Thank you for reading. We hope to see you in the next article.