Build with code

Your diagram is just text. Treat it like code.

Write it in Mermaid syntax, version it in Git, and let Mermaid handle the layout. The diagram lives next to the thing it describes — and never drifts out of date.

Mermaid code editor showing Mermaid syntax on the left and a live-rendered diagram on the right — write text, get a diagram

Write diagrams as code*

Describe systems in Mermaid’s Markdown-style syntax and generate diagrams automatically.

Skip the manual formatting

No dragging boxes or fixing arrows. Your text defines the logic and Mermaid handles the layout.

Keep visuals and logic in sync

Edit your logic in text or diagrams — changes update both so docs and visuals never go stale.

Extend your editor

From VS Code to Confluence to Google Anti-gravity IDE, our plugins keep diagrams alongside your code. No context-switching, no interruptions.

Version diagrams like code

Because they’re text-based, Mermaid diagrams fit naturally into your Git workflows.

Use AI to move faster

Use @mermaid-chart in GitHub Copilot Chat, or connect to our MCP server to generate, validate, and render diagrams directly from Claude, VS Code, or Cursor — no manual syntax needed.

*Mermaid’s Markdown-style syntax is clear and readable, so no technical skills are required. Want to learn how to write it yourself? Check out our docs.

See your code in context

Visualize what matters most to build, document, review, and innovate.

Mermaid architecture diagram mapping a distributed software system with services, APIs, databases, and cloud infrastructure — written in Mermaid syntax and versioned in Git alongside code

Map your architecture

See how your systems fit together, before and after you build.

Plan cloud infrastructure and map AWS, Azure, or GCP services in minutes

Spot dependencies that could cause bottlenecks later

Explain architecture to teammates and stakeholders clearly in reviews, proposals, or documentation

Mermaid recommends:

Flowcharts, C4 diagrams, architecture diagrams

Mermaid sequence diagram embedded in a code repository README — documenting API call flow, service interactions, and system behavior directly alongside the codebase

Document your code

Make your codebase easier to understand and maintain.

Explain communication flow between systems with sequence diagrams — click any element to jump straight to the matching syntax

Embed diagrams in READMEs or attach them to specific code files so teammates can find them right where they work

Reduce onboarding time with clear, AI-generated overviews of any codebase

Mermaid recommends:

Sequence diagrams, Class diagrams, Architecture diagrams (C4), ER diagrams

Mermaid ER diagram showing a relational database schema with tables, primary keys, foreign keys, and relationships — designed before writing SQL to avoid costly rework

Model your databases

See how your data connects, and share that picture with your team.

Design schemas before coding to avoid costly rework

See how tables, keys, and constraints fit together without digging through SQL

Share data flows and ownership so teammates and stakeholders stay on the same page

Mermaid recommends:

ER diagrams

Mermaid diagram showing service ownership, system dependencies, and team boundaries — used to reduce onboarding time and keep distributed teams aligned on architecture

Track ownership and dependencies

Show who owns what and how the system really works.

Visualize code ownership to know who maintains each package

Uncover hidden dependencies before they become blockers

Simplify code reviews and handoffs with clear, up-to-date visuals

Mermaid recommends:

Flowcharts, Git graphs

Turn Markdown into diagrams

01.
Write in text

Use Mermaid's Markdown-style syntax directly in VS Code, the Live Editor, or the Visual Editor after login.

02.
Preview instantly

Diagrams render live as you type, in VS Code, JetBrains, or the Live Editor.

03.
Refine your way

Edit the text, prompt in plain language, or hand it to Mermaid AI. The diagram updates automatically.

04.
Commit to Git

Store diagrams as plain text in your repo, track changes, and roll back just like any other code.

Want to dive deeper?

Check out our documentation for syntax guides, chart references, and examples to get you started.

Fast, accurate, editable, and yours.

Describe an idea, get a diagram you can refine, then share it with your team in seconds.

FAQ

Have questions about building diagrams with code? These should help.

Mermaid is a diagramming platform that lets you create diagrams from simple Markdown-style syntax or with AI. The Live Editor is a browser tool within Mermaid where you can instantly preview and experiment with Mermaid syntax (no sign-up required).
Text is faster and easier to maintain than manual drawing:
  • Layout happens automatically — nodes and edges snap into place
  • Diagrams update as your code changes, so they never go stale
  • You can copy Mermaid syntax into tools like Cursor or Windsurf to "vibe code" visuals
  • Because they're just text, diagrams live in Git — making them versionable, reviewable, and collaborative
No. Anyone can write Mermaid syntax, and you don't have to touch it at all: chat with AI, prompt inline, speak your edits with voice, start from a template, or build in the Visual Editor. Six ways, in one canvas.
Yes. Our MCP server connects Mermaid to Claude, VS Code, Cursor, and other AI-native tools. Ask in plain language and get back clean syntax, a PNG, and a shareable link — no manual syntax. Developers can connect to our remote MCP server to automate diagram generation in their own workflows.
Yes. Mermaid diagrams are plain text files written in Markdown-style syntax. Commit, diff, branch, and roll back your diagrams just like source code — perfect for version-controlled projects.
Explore our documentation here. You'll find syntax references, chart type examples, and best practices to help you get started.
FAQ Icon