State Diagram Generator
Describe the states of an order, a ticket or a device as text — get a state machine diagram instantly. Paste Mermaid stateDiagram-v2 code — or start from the example — and this free online state diagram generator renders it in your browser, ready to download as a crisp PNG. No sign-up, and nothing you paste leaves your device.
The demo above is live — edit the code and hit Generate. The example that loads with the page is free; each Generate click uses one of your 10 free generations per day.
How it works
From states written as text to a state machine diagram in four steps.
List your states
What can the thing be — Pending, Paid, Shipped — and which event moves it from one to the next.
Turn it into Mermaid code
Write the transitions as lines like Paid --> Shipped: order fulfilled — or let ChatGPT or Claude write the code for you.
Pick “Mermaid diagram” and hit Generate
The visual type is pre-selected on this page. Your state diagram is drawn instantly in your browser — nothing is uploaded.
Download PNG
One click, no watermark — ready for design docs, wikis or slides.
What goes into a state diagram
Three building blocks describe any state machine — and all three are just text.
States
Rounded boxes are the conditions your thing rests in over time — an order that is Pending, Paid or Delivered.
Transitions
Arrows connect states; the label after the colon is the event that triggers the move, like “payment confirmed”.
Start & end
[*] marks where the lifecycle begins and which states are final — Closed or Cancelled in the example above.
From text to state diagram, the AI-friendly way
You never have to write Mermaid by hand: describe the lifecycle to ChatGPT or Claude and paste what it returns here — no sign-up, and everything renders locally on your device.
Describe your lifecycle in English
Tell ChatGPT or Claude what happens — “an order goes pending, paid, shipped, delivered, closed; it can be cancelled before shipping” — and ask for Mermaid stateDiagram-v2 code.
Paste the code here
Copy the state diagram code it returns and drop it into the box above, skipping the fence lines around the code block.
Generate, download PNG
Hit Generate: the state machine draws instantly in your browser and exports as a crisp, watermark-free PNG for docs and slides.
Private by design: your state diagrams never leave your browser
State machines often describe how internal systems really work. Text2Viz renders them locally, so nothing is uploaded.
No sign-up, no account
There is nothing to create and nothing to log into. Open the page and start diagramming.
Rendered locally
Your diagram is drawn by JavaScript running on your own device. Your state text is never sent to our servers.
Safe for internal systems
Order pipelines, ticket workflows, device firmware modes — render them here without a second thought.
What people make with it
Three common ways people use this free state diagram generator.
Model an order or ticket lifecycle
Show every state an order can reach — including the unhappy paths like Cancelled — before you write the code.
Design a device or workflow controller
States and events make embedded modes, approval chains and job pipelines explicit and reviewable.
From AI chat to image
ChatGPT or Claude drafted your lifecycle as stateDiagram code? Paste it here and export a shareable PNG.
Frequently asked questions
Is this state diagram generator free?
How do I turn text into a state diagram online?
What is the difference between a state diagram and a flowchart?
How do I show a decision or fork in a state diagram?
Can AI write the stateDiagram code for me?
Can I download the state diagram as a PNG?
More text-to-diagram tools
The same paste-and-generate flow, tuned for other diagram types.
ER Diagram Maker
Entity relationship diagrams for database schemas from Mermaid erDiagram syntax.
Class Diagram Generator
UML class diagrams for domain models from Mermaid classDiagram syntax.
User Journey Map Generator
Map customer journey steps, satisfaction scores and actors from Mermaid journey syntax.
Quadrant Chart Generator
Plot options on a 2x2 matrix with Mermaid quadrantChart syntax.
Git Graph Generator
Visualize commits, branches and merges with Mermaid gitGraph syntax.
Sankey Diagram Maker
Show how budget, energy or users flow between stages with Mermaid sankey-beta code.
Block Diagram Maker
Lay out system components in a grid of blocks and arrows from Mermaid block-beta code.
Requirement Diagram Maker
Map requirements, elements and satisfies links from Mermaid requirementDiagram code.
C4 Context Diagram Maker
Draw a C4 context diagram — people, systems and relationships — from Mermaid C4Context code.
C4 Container Diagram Maker
Zoom inside a system's containers with Mermaid C4Container syntax.
Text to Timeline Maker
Dates and events become a clean horizontal timeline. Also see the horizontal, project and history timeline makers.