Mermaid State Diagram Editor

Model finite state machines and application state transitions using Mermaid state diagram syntax — live preview, free.

Runs 100% in your browser. Your input and files never leave your device.

Why use our online Mermaid State Diagram Editor?

Model finite state machines, UI state transitions, and workflow logic with Mermaid state diagrams — live preview included.

How to use Mermaid State Diagram Editor

  1. 1
    Define your states

    Simply name your states. The start state is [*]. Use stateDiagram-v2 at the top for the modern syntax.

  2. 2
    Add transitions

    Define transitions with: StateA --> StateB : Event. The label after the colon describes what triggers the transition.

  3. 3
    Add composite states

    Nest states inside a state block: state "Processing" { Validating --> Saving }. This represents a compound state.

  4. 4
    Export the diagram

    Download as SVG for crisp vector output, or PNG at 2× resolution for embedding in design specs and documentation.

Frequently Asked Questions

What is the difference between stateDiagram and stateDiagram-v2?

stateDiagram-v2 is the newer, recommended syntax. It supports composite states, notes, and concurrency. Use v2 for new diagrams.

How do I show the start and end states?

Use [*] for both. [*] --> Idle is the initial transition into the first state. Running --> [*] means the state machine terminates from Running.

How do I model concurrent states?

Use a -- separator inside a composite state: state Active { MovingLeft -- Accelerating }. Each part separated by -- runs concurrently.

Can I add notes to a state diagram?

Yes: note right of StateA: This is a note. Notes appear as labeled boxes positioned relative to the named state.

What are state diagrams used for in software development?

State diagrams model how a system responds to events — UI component states, order lifecycle, authentication flow, or network connection states. They make implicit state machines explicit and reviewable.

Also useful: Markdown EditorSVG Converter