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
- 1Define your states
Simply name your states. The start state is [*]. Use stateDiagram-v2 at the top for the modern syntax.
- 2Add transitions
Define transitions with: StateA --> StateB : Event. The label after the colon describes what triggers the transition.
- 3Add composite states
Nest states inside a state block: state "Processing" { Validating --> Saving }. This represents a compound state.
- 4Export 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.
Related Tools
More Developer Tools- Diff CheckerCompare two files for visual differences.Free • In browser
- SQL to ORM ConverterConvert CREATE TABLE SQL to Prisma, Drizzle, SQLAlchemy, Django, TypeORM, Sequelize, GORM, and Ecto model definitions — free, browser-based, no account needed.Free • In browser
- Hash GeneratorGenerate MD5, SHA-1, SHA-256, and SHA-512 hashes from text or files. Supports HMAC authentication codes.Free • In browser
Also useful: Markdown EditorSVG Converter