PlantUML sequence diagram tool

PlantUML Sequence Diagram Tool

Create and preview PlantUML sequence diagrams online. Model API calls, user workflows, service interactions, and system responses with editable text-based UML.

PlantUML Sequence Diagram Editor

Edit the sequence diagram source, preview the interaction flow, and download PNG or SVG output.

Open Full Editor
Diagram preview

Use this focused tool to draft a sequence diagram. Open the full editor for AI generation, syntax repair, sharing, and saved projects.

Create and Share Sequence Diagrams Online

Edit PlantUML sequence diagrams online with a real-time preview to model API flows, user journeys, and service interactions. Export clear PNG or scalable SVG files for documentation and team communication, or continue in the full editor when a workflow needs more room.

Convert PlantUML to SVG

Paste PlantUML code, preview the rendered diagram, and download a SVG file from the browser.

Preview before export

Check the diagram output before downloading so syntax issues are easier to spot.

No local setup

Render PlantUML without installing Java, Graphviz, or a desktop IDE extension.

Works with quick drafts

Use the sample editor for fast diagram checks when you only need a single export.

Continue in OnUML

Move to the full editor for AI generation, AI repair, sharing, and saved projects.

Browser-based workflow

Keep conversion, preview, and export in one page without switching tools.

How to Create a PlantUML Sequence Diagram

Start with the participants, write the interaction from top to bottom, and use PlantUML blocks when the flow branches or repeats.

  1. 1

    Define actors, participants, and services as lifelines.

  2. 2

    Add messages and return values in time order.

  3. 3

    Use alt, loop, or par to describe branches, retries, and parallel work.

  4. 4

    Preview the diagram, refine the source, and export PNG or SVG.

PlantUML Sequence Diagram Syntax and Examples

Learn the PlantUML syntax behind participants, messages, return values, conditions, loops, and asynchronous interactions.

What Is a PlantUML Sequence Diagram?

A PlantUML sequence diagram is a UML behavioral diagram that shows messages exchanged between users, objects, services, and other participants in time order. It makes the order of an interaction visible, from the first request through each response or side effect.

Common Use Cases for Sequence Diagrams

Use sequence diagrams to document REST API requests and responses, login and payment flows, microservice calls, and asynchronous messages. They also help with production troubleshooting, user-story discussions, and architecture reviews because everyone can inspect the same interaction timeline.

Participants and Lifelines

Declare each lifeline with the keyword that best describes its role: actor for a person or external system, participant for a general component, boundary for an interface, control for orchestration, entity for domain data, and database for stored records. Add an alias such as participant "Payment API" as PaymentApi to keep messages short while preserving clear labels.

Messages and Return Values

Use -> for a synchronous request and --> for a return value. Use ->> and -->> when the message or response is asynchronous. Label every arrow with an action or meaningful result, such as "POST /orders" or "201 Created", so readers can understand the intent and outcome without guessing.

Conditions with alt and else

Use alt and else to show mutually exclusive outcomes in one readable interaction, such as a login, authorization check, or payment decision. Put the business condition in the alt label and make each response explicit.

alt Payment approved
  Client -> Payment API: Capture payment
  Payment API --> Client: Payment confirmed
else Payment declined
  Payment API --> Client: Decline reason
end

Loops, Notes, and Grouped Interactions

Use loop for repeated work such as polling, retries, or processing batches. Add a note over one or more participants when an assumption needs context, and use group or box to visually organize related interactions, services, or bounded responsibilities.

loop Retry up to 3 times
  Worker -> Queue: Poll message
  Queue --> Worker: Return job or empty result
end

Asynchronous Messages and Parallel Work

Use ->> to distinguish an asynchronous event or queued command from a synchronous call that waits for a reply. Use par, and, and end to show independent work that can happen in parallel, such as notifying a customer while a worker updates analytics.

Sequence Diagram Best Practices

Give participants stable, descriptive names and keep message granularity consistent across the diagram. Limit crossing lines by ordering lifelines thoughtfully, split very long flows into focused diagrams, and keep the PlantUML source with the code or documentation so the diagram can be reviewed and updated.

PlantUML Sequence Diagram Example

This editable example shows an API authentication flow with participants, request and response messages, a database lookup, and valid or invalid credential branches.

@startuml
title API Authentication Flow

actor User
participant "Web App" as App
participant "Auth API" as API
database "User Database" as DB

User -> App: Submit email and password
App -> API: POST /login
API -> DB: Find user by email
DB --> API: User record

alt Credentials are valid
  API -> API: Create access token
  API --> App: 200 OK + access token
  App --> User: Show dashboard
else Credentials are invalid
  API --> App: 401 Unauthorized
  App --> User: Show login error
end
@enduml

Why Use PlantUML for Sequence Diagrams

PlantUML keeps interaction diagrams in readable text, making them easy to edit, review, version, and export whenever system behavior changes.

Fast SVG output

Turn PlantUML text into a downloadable SVG file without preparing a local PlantUML environment.

Editor-first conversion

Adjust the source code and confirm the visual result before exporting the file.

A path to larger diagram work

Use the full OnUML editor when a quick conversion becomes a diagram that needs AI help or project history.

Frequently Asked Questions

How do I convert PlantUML to SVG online?

Paste PlantUML code into the editor, wait for the preview to render, and click Download SVG.

Do I need to install PlantUML locally?

No. This page renders PlantUML through an online preview workflow, so you do not need Java, Graphviz, or a local extension.

Can I preview the diagram before downloading SVG?

Yes. The preview panel updates before export, which helps you check the rendered diagram and catch syntax issues.

Can OnUML fix PlantUML syntax errors?

Yes. AI repair is available in the full OnUML editor. This converter page is focused on quick preview and file export.

What is the difference between this converter and the full editor?

This page is optimized for one quick conversion. The full editor adds AI generation, syntax repair, sharing, saved projects, and support for Mermaid and draw.io.

What is a PlantUML sequence diagram?

A PlantUML sequence diagram is a text-defined UML behavioral diagram that shows participants, their lifelines, and the messages they exchange over time. PlantUML renders that source into a visual interaction flow that is easy to review and version.

How do I show an API request and response?

Declare the client and API as participants, then use -> for the request and --> for the response. Add clear message labels such as "GET /profile" and "200 OK + profile" to make the REST API flow readable at a glance.

How do I add an if/else branch?

Wrap alternative outcomes in an alt block, add an else line for the second branch, and close the block with end. This is useful for login success versus failure, authorization decisions, and payment approval or decline paths.

Can I show asynchronous messages?

Yes. Use ->> for an asynchronous message, such as publishing an event or sending work to a queue, and -->> for an asynchronous response when it helps explain the flow. Combine these arrows with par blocks when concurrent work matters.

When should I use a sequence diagram?

Use a sequence diagram when the order of interactions matters: REST API behavior, user journeys, microservice orchestration, background jobs, incident investigation, or an architecture review. It is especially helpful when several systems exchange messages to complete one outcome.

Can I export a PlantUML sequence diagram as PNG or SVG?

Yes. Preview the PlantUML sequence diagram in the online tool, then export PNG for slides and quick sharing or SVG for scalable documentation and web pages. Both formats preserve the same interaction flow from the source diagram.

Need a Complete Diagram Workspace?

Open the full OnUML editor for AI generation, syntax repair, sharing, saved projects, and broader diagram workflows.

Open Full Editor