Mermaid State Diagram Editor

Describe transition logic between different states of an object, suitable for state machine design, business rule analysis and complex system modeling.

What is a state diagram

A state diagram is a UML diagram used to describe the state transition process of an object or system. It shows behavior changes of an object under different conditions through state nodes and state transition relationships. State diagrams are suitable for analyzing systems with lifecycle characteristics, such as order states, user states, device running states and state transition logic in business processes.

Use cases

Object lifecycle analysis

Describe the state changes of an object from creation, execution to completion, helping understand complex behavior logic.

Business state management

Suitable for business process design with multiple phase changes, such as orders, users and tasks.

System behavior modeling

Show state transitions and response rules of a system triggered by different events.

Exception flow design

Define special states such as errors, failures and recovery to help improve system stability design.

State machine development

Provide clear design references for developers implementing state control logic.

State diagramFree templates

Order Lifecycle

Order Lifecycle

User Account Lifecycle

User Account Lifecycle

How to generate a state diagram with Mermaid

1

Multiple editing methods

You can generate state diagrams by writing Mermaid code, pasting Mermaid code, AI generation, image recognition, code summary and more. You can also draw state diagrams using our built-in state diagram templates.

2

Auto rendering

After entering Mermaid syntax, state diagrams are generated and previewed in real time, with support for custom state diagram styles and themes.

3

Export or share

You can download state diagrams and save them locally. We support exporting state diagrams to PNG, PDF, SVG, JPG, Markdown and other formats, or clicking the “Share” button to share the link with others.

4

Edit again

If you are not satisfied with the result, click the “Visual editing” button to edit the state diagram again in the ProcessOn editor.

State diagramCommon syntax

Syntax
Graphic
Meaning
stateDiagram-v2
State diagram
Create a state diagram
state StateName
Rounded rectangle
Define a basic state node
state StateName : text
Rounded rectangle with text
Add description text to a state
[*]
Solid small dot or double ring
Represents the start or end of a state
[*] --> StateName
Start arrow
Represents entering the first state
StateName --> [*]
End arrow
Represents the end of the state flow
A --> B
Solid arrow
Represents a state transition
A --> B: event
Solid arrow with label
State transition with a trigger event
state StateName { ... }
Nested rounded rectangle
Define a composite state
state Node <>
Diamond
Branch decision node
state Fork <>
Thick horizontal separator
Represents the start of parallel flows
state Join <>
Thick horizontal separator
表示并行流程结束合并
More Syntax

Why choose us

Online editing tool

Free templates

Powerful AI capabilities

Real-time preview

Export in multiple formats

Supports re-editing

State diagramDrawing questions

What is a Mermaid state diagram

A Mermaid state diagram is a UML diagram used to describe the state transition process of an object or system, showing the logic of a system moving from one state to another through state nodes and transition relationships.

What scenarios are Mermaid state diagrams suitable for?

Mermaid state diagrams are widely used in software state machine design, order flow analysis, device running state management, user lifecycle analysis and business rule modeling.

What state relationships can Mermaid state diagrams represent?

Mermaid state diagrams support state nodes, state transitions, conditions, start states and end states, clearly expressing state flow relationships in complex systems.

What is the difference between Mermaid state diagrams and Mermaid flowcharts?

Mermaid flowcharts mainly show task execution steps and business processes, while Mermaid state diagrams focus more on the change process of an object between different states, such as the state evolution of an order from creation to completion.

How to create a Mermaid state diagram?

When creating a Mermaid state diagram, simply use state diagram syntax to define state nodes and transition rules, and the editor will automatically generate the corresponding state relationship diagram from the code.