New: TypeFire 7 and TypeFire for Chrome 2.0.
Free · Live examples · No sign-up

Mermaid sequence diagrams, step by step

A sequence diagram shows who sends what to whom, in order, top to bottom. In Mermaid that's one line per message: Customer->>Shop: Place order. Edit the example below and it redraws as you type.

Free in your browser. On a Mac, TypeFire opens every .md file like this, right from Finder.Download free for Mac

Sequence diagram.md
FileEditViewInsertFormatHelp
Sequence diagram.md

A Mermaid sequence diagram

PaymentsShopCustomerPlace orderCharge $48.00ApprovedOrder confirmedShipping email
PaymentsShopCustomerPlace orderCharge $48.00ApprovedOrder confirmedShipping email

Try this

  • Add Note right of Payments: Takes about 2 seconds before the last line.
  • Put autonumber on the second line to number every message.
Loading the editor…Your files stay in your browser
  • Your files never leave your browser
  • Free, no sign-up
  • Download as Markdown, Word, a web page or a PDF

This editor comes from TypeFire, free for Mac

Your whole folder of Markdown notes in tabs, Quick Look previews in Finder, plus a text expander and a clipboard manager.

How it works

Write a Mermaid sequence diagram

  1. 01

    Name who's involved

    Start with sequenceDiagram, then a participant line for each one. They're drawn left to right in that order.

  2. 02

    Send messages

    Write A->>B: text for a message with a solid arrow, and B-->>A: text for a reply with a dashed one.

  3. 03

    Add the extras

    Notes, loops, alternatives and numbering each take one line, so the diagram stays easy to read as text.

Mermaid sequence diagram text on the left becomes a drawn checkout sequence between Customer, Shop and Payments
Free for Mac and Chrome

Diagrams in your notes? Get TypeFire.

On the Mac, every Mermaid block in your notes draws in TypeFire's colors. Open one full window to zoom in, resize it, link a box to another note, and save it as SVG or PNG.

Download free for MacAdd to Chrome7 day Pro trial, no card required.

Free text expander, markdown notes and a clipboard manager. $18 once for unlimited clips, notes sync and AI prompts.

At a glance

Arrows and blocks at a glance

Two characters decide what a message looks like.

Drawn from the example above

A->>B: text
A solid line with an arrowhead
A-->>B: text
A dashed line with an arrowhead, often a reply
A->B: text
A solid line, no arrowhead
A-xB: text
A line ending in a cross
A-)B: text
An open arrow for a message sent without waiting
Note right of A: text
A note beside a participant
loop Every minute ... end
A box around repeated steps
alt Paid ... else Declined ... end
Two alternative paths
autonumber
A number on every message
What it does

Sequence diagram tips

  1. Order is time

    Each line happens after the one above it, so write messages in the order they happen.

  2. Actors look like people

    Use actor instead of participant to draw a stick figure for a person.

  3. Show branches with alt

    Wrap two paths in alt Paid ... else Declined ... end to show both outcomes in one diagram.

  4. Keep labels short

    A message label is one line. Put the detail in a note beside it.

Markdown files dropped on the page open as tabs, one showing the drawn sequence diagram
Take it further

The same editor, without the browser tab

This editor comes from TypeFire, a free app for Markdown notes, a text expander and a clipboard manager. Here it works on the files you open. In the app, it opens your whole folder.

TypeFire for Mac with several Markdown notes open in one tab bar

TypeFire for Mac

  • Press Space on any .md file in Finder and read it rendered, with Quick Look.
  • Open a folder of Markdown, an Obsidian vault included, with tabs, search and links.
  • A text expander and a clipboard history in the same free app.
In a browser email, typing thx and a space expands into a whole thank-you reply

TypeFire for Chrome

  • This editor in its own tab, one click from the toolbar.
  • Your folder of .md notes in tabs, with search and links.
  • A text expander and your clipboard history on every site.

Frequently asked questions

Still not answered?

Put Mermaid in a code block marked mermaid. Start with sequenceDiagram, list participants, then write one message per line, like Alice->>Bob: Hello.

->> draws a solid line and -->> a dashed one.

Dashed lines are the usual way to show a reply.

Write Note right of Shop: text, or Note left of, or Note over Shop,Payments: text to span two participants.

Wrap the messages in loop Label ... end, or in alt Label ... else Other ... end for two paths. opt ... end shows an optional step.

Yes. Add autonumber on its own line after sequenceDiagram and every message gets a number.

Sequence diagrams in your notes

TypeFire for Mac draws them in your notes, with a viewer to zoom in and save as SVG or PNG. Free.

Download free for MacAdd to ChromeSee what $18 adds7 day Pro trial, no card required.

Free text expander, markdown notes and a clipboard manager. $18 once for unlimited clips, notes sync and AI prompts.

your clips your snippets