Mermaid Docs and Tutorials
All the documentation in one place: syntax references, step-by-step tutorials and export guides. Every example renders on the page, and the editor is always one click away.
Syntax reference
Look up how to write a diagram, or why one does not render.
Export and AI code
Turn Mermaid code into images and documents, or render the code an AI assistant gave you.
Your first diagram in one minute
Mermaid turns short text into diagrams. The first line names the diagram type, and each following line adds a node, a message or a task. Because it is plain text, a diagram can live next to your code, in a README, a pull request or a wiki page, and it changes in the same review as the code it describes.
Copy the example below into the editor and change a label: the preview updates as you type.
graph TD
Idea[Write the steps] --> Code[Turn each step into a line]
Code --> Preview{Looks right?}
Preview -->|Yes| Share[Export or share]
Preview -->|No| CodeA learning path
- Start with flowcharts: graph TD, node shapes and arrows cover most everyday diagrams.
- Move on to sequence diagrams for anything that involves several systems talking to each other.
- Use ER diagrams and class diagrams to document data models and code structure.
- Plan work with Gantt charts, timelines and kanban boards.
- Keep the cheat sheet open while you write, and the syntax errors guide for when a diagram does not render.
Frequently asked questions
Is Mermaid hard to learn?
No. A flowchart needs only a first line such as graph TD and one arrow per line. Most people draw a useful diagram in a few minutes.
Where can I practice?
Every example on these pages opens in the online editor, where you can change it and see the result immediately.