Sequence diagram generator

Sequence diagram generator: describe the interaction, get the UML diagram

In short

A sequence diagram generator turns a plain description of an interaction — who sends what to whom, in what order — into a UML sequence diagram: one lifeline per participant, one arrow per message, time running top to bottom. Type the steps below and ChartCraft draws it; your first 3 diagrams are free, no account needed. Prefer writing code? Every symbol on this page comes with its Mermaid syntax.

Opens the studio with your text · free, no account for the first 3

Updated · by the ChartCraft team

What is a sequence diagram generator?

It is a tool that builds a UML sequence diagram for you from a description, instead of you placing lifelines and arrows by hand. ChartCraft reads your sentences, identifies the participants (people, apps, services, databases) and the messages between them, and lays them out in time order — so the diagram always matches the story you wrote. You then refine it with follow-up messages ("add a cache between the API and the database") and export SVG or PNG.

There are three ways to get a sequence diagram today, and they suit different people:

ApproachYou writeBest for
Prose → diagramPlain sentences (ChartCraft)Explaining a flow quickly, docs, design reviews, people who don't want to learn a syntax.
Diagram as codeMermaid or PlantUML textDiagrams versioned next to code in Git, READMEs, wikis that render Mermaid.
Drag and dropNothing — you draw shapesPixel-level control over one diagram you will rarely change.

How do I generate a sequence diagram from text?

Write the interaction as numbered or consecutive sentences, each naming a sender, a receiver and what is sent; ChartCraft turns every named party into a lifeline and every sentence into a message, in order.

  1. Name the participants once, consistently. "Web app", "Auth service", "User DB" — the same name every time, so each becomes one lifeline.
  2. One message per sentence, in time order. "The web app sends POST /login to the auth service." Put the payload or endpoint in the sentence; it becomes the arrow label.
  3. Say when something is a reply or fire-and-forget. "…returns the user record" becomes a dashed return; "…publishes an event without waiting" becomes an asynchronous arrow.
  4. Refine in follow-ups. "Rename User DB to Postgres", "add a rate limiter before the auth service" — the diagram is re-laid out, not redrawn by you.

The login prompt pre-filled above produces a diagram like the login sequence diagram example; open any example in the gallery below to see the exact text that generated it.

What symbols does a sequence diagram use?

Twelve symbols cover practically every sequence diagram: participants and actors with their lifelines, four kinds of message arrow (synchronous, asynchronous, return, self), activation bars, create and destroy marks, combined fragments, and notes. The last column says whether ChartCraft's generator draws the symbol today.

SymbolNameWhat it meansMermaid syntaxChartCraft draws it
ActorA human or external system that starts the interaction — drawn as a stick figure.actor U as UserYes
Participant + lifelineA box for each object or service, with a dashed line below it showing that it exists through time.participant A as Auth serviceYes
Activation barA thin rectangle on the lifeline: the period when the participant is busy handling a call.A->>+B: call / B-->>-A: replyMermaid only
Synchronous messageA call where the sender waits for the answer — solid line, filled arrowhead.A->>B: POST /loginYes
Asynchronous messageFire-and-forget: the sender carries on without waiting — open arrowhead.A-)B: publish eventYes
Return messageThe reply to an earlier call — dashed line pointing back to the caller.B-->>A: 200 OKYes
Self messageA participant calling itself: validation, a computation, a retry.A->>A: sign JWTYes
Create messageA message that brings a new participant into existence part-way down the diagram.create participant CMermaid only
Destroy (X)An X at the end of a lifeline: the object is deleted or the session ends.destroy CMermaid only
Combined fragmentA labelled box around messages: alt (if/else), opt (if), loop, par (parallel), break, critical.alt ... else ... endMermaid only
NoteA comment attached to one or more lifelines. Not part of the interaction itself.Note over A,B: textMermaid only
Boundary / control / entityRobustness stereotypes: the screen or API edge, the coordinating logic, the stored data.participant X@{ "type": "boundary" }Mermaid only

Want the full visual reference in Indonesian? See Simbol sequence diagram dan fungsinya.

What does a sequence diagram look like in Mermaid code?

A Mermaid sequence diagram starts with sequenceDiagram, declares participants (use actor for people), then lists one message per line as Sender->>Receiver: label. Here is a complete login flow with numbering, activation bars and an if/else branch — paste it into any Mermaid renderer:

sequenceDiagram
    autonumber
    actor U as User
    participant W as Web app
    participant A as Auth service
    participant D as User DB
    U->>W: Submit email + password
    W->>+A: POST /login
    A->>+D: SELECT user WHERE email = ?
    D-->>-A: user record
    alt password matches
        A->>A: sign JWT
        A-->>W: 200 { token }
        W-->>U: Show dashboard
    else wrong password
        A-->>W: 401 Unauthorized
        W-->>U: Show error
    end
    deactivate A

autonumber numbers the messages, +/- after the arrow open and close an activation bar, and alt … else … end draws the if/else fragment. All code on this page was checked with the Mermaid 12 parser.

What is the difference between synchronous, asynchronous and return messages?

A synchronous message (solid line, filled arrowhead) means the sender waits for an answer; an asynchronous message (open arrowhead) means it does not wait; a return message (dashed line) carries the answer back to whoever made the synchronous call.

Mermaid arrowLineUse it for
->>Solid, filled headSynchronous call — HTTP request, function call, RPC.
-->>Dotted, filled headReturn / response to an earlier call.
-)Solid, open headAsynchronous message — queued job, published event, webhook you don't wait for.
-xSolid, cross at the endMessage that is lost or rejected.
-> / -->Solid / dotted, no headPlain connection where the direction doesn't matter.
sequenceDiagram
    participant A
    participant B
    A->>B: synchronous call (solid, filled head)
    B-->>A: return (dotted, filled head)
    A-)B: asynchronous message (open head)
    A-xB: lost / rejected message (cross)
    A->B: plain solid line, no head
    A-->B: plain dotted line, no head

How do I show if/else, loops and parallel steps in a sequence diagram?

With combined fragments — boxes drawn around the messages they govern, labelled with an operator and a guard condition: alt for if/else, opt for an optional block, loop for repetition, par for steps that run in parallel, break for an early exit and critical for a block that must not be interrupted.

FragmentMeansMermaid
altIf / else — exactly one region runs, chosen by its guard.alt [cond] … else … end
optIf — the region runs only when the guard holds.opt [cond] … end
loopRepeat the region while the guard holds.loop [cond] … end
parRegions run in parallel.par … and … end
breakRun the region and then leave the enclosing interaction.break [cond] … end
criticalThe region runs atomically.critical … option … end
sequenceDiagram
    participant C as Checkout
    participant P as Payment API
    participant I as Inventory
    participant M as Mailer
    opt customer applied a coupon
        C->>P: validate coupon
    end
    loop up to 3 retries
        C->>P: charge card
    end
    par reserve stock
        C->>I: reserve items
    and send receipt
        C-)M: queue receipt email
    end
    break card declined
        P-->>C: payment failed
    end
    Note over C,P: Payment is idempotent per order id

When should I use a sequence diagram instead of a flowchart or activity diagram?

Use a sequence diagram when the important thing is the conversation between parties — which service calls which, in what order, and what comes back. Use a flowchart or an activity diagram when the important thing is the steps and decisions of one process.

DiagramAnswersTypical subject
SequenceWho talks to whom, in what order?API calls, login and OAuth flows, payment handshakes, microservice calls.
FlowchartWhat are the steps, and where does it branch?Algorithms, business rules, troubleshooting guides.
ActivityWhat happens, who does it, what runs in parallel?Business processes with swimlanes, fork/join concurrency.
State machineWhat states does one thing move through?Order status, TCP connection, ATM session.

What do real sequence diagrams made with the generator look like?

Below are sequence diagrams from the public examples gallery, each generated from a plain-English description — open one to see the prompt that produced it. More are collected on the sequence diagram examples page.

Questions

Is this sequence diagram generator free?

Yes. Your first 3 diagrams are free with no account; a free account gives you 5 a month. SVG and PNG export are available on every plan, including free, with no watermark.

How do I make a sequence diagram from text?

Write the interaction in order, one step per sentence, naming the sender and the receiver: "The user submits the form. The web app calls the auth service. The auth service queries the database and returns a token." ChartCraft turns each named actor or system into a lifeline and each step into a time-ordered message.

What are the main symbols of a sequence diagram?

Participants (boxes, or stick figures for human actors) with dashed lifelines beneath them, horizontal arrows for messages — solid with a filled head for synchronous calls, open head for asynchronous, dashed for returns — thin activation bars, and labelled fragment boxes such as alt, opt and loop for conditions and repetition.

What is the difference between a synchronous and an asynchronous message?

A synchronous message (solid line, filled arrowhead) means the sender waits for the reply before continuing — a normal function or HTTP call. An asynchronous message (open arrowhead) is fire-and-forget: the sender continues immediately, as with a queued job or a published event.

How do I show if/else in a sequence diagram?

Use an alt fragment: a box labelled alt, split by a dashed line into one region per condition, each with its guard, e.g. [password matches] and [wrong password]. Use opt for a single optional block and loop for repetition. In Mermaid: alt ... else ... end.

Can ChartCraft draw alt/loop fragments and activation bars?

Not yet. ChartCraft's generator draws participants (actors, systems, databases, components) and synchronous, asynchronous, return and self messages. For fragments, activation bars and notes, use the Mermaid code on this page — Mermaid renders all of them.

Sequence diagram or flowchart — which should I use?

Use a sequence diagram when the question is who talks to whom and in what order — APIs, login flows, service calls. Use a flowchart when the question is what steps happen and where the process branches, regardless of who performs them.

Can I export the diagram?

Yes — export to SVG or PNG from the studio, on every plan, without a watermark.

Guides & examples

More diagram generators

Describe the interaction — get the sequence diagram.

Open the studio →