- Executors
-
Learn
Learn Python Runnable examples, NumPy, pandas, and more Learn AI / Machine LearningNeural networks, ML and LLMs from scratch Learn C & C++ Pointers, memory, STL, and modern C++ Learn C#C# basics, OOP, LINQ, async, and .NET exercises Learn MatplotlibLine, bar, scatter and pie charts with live visualizers Learn RustOwnership, traits, error handling, and threads Learn GoSlices, interfaces, goroutines, and channels Python Algorithms Search, sorting, recursion, and visualizers O(n) C & C++ Algorithms Compare algorithms implemented in C and C++ Coding for Kids Learn to code by playing!
- QuizzesNew
- ChallengesNew
- For TeachersNew
- Updates
- Buy me a coffee
Visualizers
Mermaid Sequence Diagram Editor
Show who talks to whom and in what order. Edit the example, check the syntax below and export the diagram.
- Runs in your browser
- Instant results
- Free, no sign-up
Loading the tool…
How to use the Mermaid Live Editor
- List the participants (or just start sending messages) after "sequenceDiagram".
- Write one message per line, like "User->>API: POST /login", and add notes, loops or alt blocks.
- Download SVG or PNG, copy the Markdown block, or copy a share link.
Frequently asked questions
What does a Mermaid sequence diagram show?
The messages between participants (users, services, databases) in time order, from top to bottom. It is a common way to document an API call, a login flow or how services work together.
What is the difference between ->> and -->>?
"->>" draws a solid line with an arrowhead, usually a request. "-->>" draws a dashed line, usually the reply. "-)" draws an open arrow for async messages.
How do I show if/else in a sequence diagram?
Use an alt block: "alt Valid password", the messages for that case, "else Wrong password", the other messages, then "end". Use "opt" for an optional step and "loop" for repeats.
Can I number the messages?
Yes. Add "autonumber" on the line after "sequenceDiagram" and every arrow gets a number.
Syntax cheat sheet
| Code | What it does |
|---|---|
sequenceDiagram | Start a sequence diagram |
participant A as API | A participant with a short id and a display name (actor draws a person) |
A->>B: text | A solid arrow: a call or request |
B-->>A: text | A dashed arrow: a reply |
A-)B: text | An async message (open arrow) |
Note over A,B: text | A note across one or more participants |
loop Every minute ... end | A repeated block |
alt Success ... else Error ... end | Alternative paths |
autonumber | Number every message |
Practice Python with coding challenges
Solve hands-on problems right in this editor: run the sample tests, submit, and get an AI code review.