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

  1. List the participants (or just start sending messages) after "sequenceDiagram".
  2. Write one message per line, like "User->>API: POST /login", and add notes, loops or alt blocks.
  3. 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

CodeWhat it does
sequenceDiagramStart a sequence diagram
participant A as APIA participant with a short id and a display name (actor draws a person)
A->>B: textA solid arrow: a call or request
B-->>A: textA dashed arrow: a reply
A-)B: textAn async message (open arrow)
Note over A,B: textA note across one or more participants
loop Every minute ... endA repeated block
alt Success ... else Error ... endAlternative paths
autonumberNumber 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.

All Python challenges
Easy

Rectangle Perimeter

Compute the perimeter of a rectangle from its sides.

You'll learn ArithmeticReturn values
BeginnerLearning-pathVariables
Easy

Distance Between Points

Compute the straight-line distance between two points.

You'll learn Pythagorean theoremSquare roots
BeginnerFunctionsLearning-pathmath
Easy

Average of Three

Average three whole numbers.

You'll learn ArithmeticDivision
BeginnerLearning-pathVariables
Easy

Prime Number Check

Decide whether a number is prime.

You'll learn DivisibilityLoop optimization
BeginnerLoopsNumbersStudent-beginner
Easy

Dot Product of Two Vectors

Multiply two vectors element by element and add the results: the core operation of every neuron.

You'll learn VectorsDot product
Neural networksaimachine learning
Easy

Days in a Month

Return how many days a month has, including leap years.

You'll learn Calendar rulesHelper functions
BeginnerConditionsFunctionsLearning-path
Easy

Count Uppercase Letters

Count the capital letters in a text.

You'll learn Character checksCounting
BeginnerLearning-pathStrings
Easy

Celsius to Fahrenheit

Convert a temperature from Celsius to Fahrenheit.

You'll learn FormulasOperator precedence
BeginnerLearning-pathVariables
Easy

Min and Max Together

Find the smallest and largest value in one pass.

You'll learn Single passMultiple return values
ArraysBeginnerFunctionsLearning-path
Easy

Largest of Three

Pick the largest of three numbers without a built-in max.

You'll learn ComparisonsCombining conditions
BeginnerConditionsLearning-path
Easy

Swap First and Last

Exchange the first and last items of a list.

You'll learn List indexingSwapping
ArraysBeginnerLearning-path
Easy

Password Rules Check

Check a password against simple strength rules.

You'll learn ValidationBoolean flags
BeginnerConditionsLearning-pathStrings