State Machine Designer

Design finite state machines visually. Create states, transitions, and events with a drag-and-drop canvas. Export as JSON or state machine code.

Mini Map
States: 4Transitions: 4

Understanding Finite State Machines

A Finite State Machine (FSM) is a computational model consisting of a finite number of states, transitions between those states, and events that trigger transitions.

Components of a State Machine

  • States — Distinct conditions or modes (e.g., Idle, Loading, Error).
  • Transitions — Rules for moving between states.
  • Events — Actions that trigger transitions (e.g., click, submit, timeout).
  • Initial State — The starting state of the machine.
  • Final States — States that represent completion.

Common Applications

  • UI component state management
  • Game character AI and behavior
  • Network protocol design
  • Compiler and parser design
  • Workflow and process automation

Frequently Asked Questions

How do I create transitions between states?
Drag from one state's output handle to another state's input handle. You can label the transition with the event name.
Can I mark initial and final states?
Yes, click on a state to change its type to Initial (green), Final (red), or Normal (blue).
Can I export my state machine as code?
Yes, export as JSON for use in XState or similar state machine libraries, or as a code snippet.
Can I have self-transitions (loops)?
Yes, you can connect a state back to itself to represent events that don't change the current state, such as retry or refresh actions.
Is my data stored on a server?
No. Everything runs entirely in your browser. Export your state machine as JSON to save your work locally.