I'm looking for some GUI tool where you can "draw" the state graphs for a Finite State Machine (FSM) and which subsequently generate the code. There are already plenty of tools that generate code or state graphs from some structured file input, but very few that does the opposite.

The only ones I could find were either >decade old or very expensive:

What are the free options to generate code from a drawing a finite state diagram diagram?
(I'd prefer output in either C/C++, Python or YAML. The cleaner/briefer, the better.)

As commented by @izzy, for me the best would be a simple to understand UI that allows you to draw the state graphs which simultaneously generate the state input file, perhaps in YAML (or whatever they like), and show the resulting output in the language I specify but preferably in C, Python or JS. (Java, no thanks.)

  • I've updated the title and added info on what I like.
    – not2qubit
    May 19, 2021 at 8:48
  • Thanks! Removed my comment and gave you a thumbs-up instead. Best luck (i.e. good recommendations and soon ;)
    – Izzy
    May 19, 2021 at 11:05

2 Answers 2


I have created a tool based on GraphViz: you provide a graphical description of the FSM in GraphViz, and the command line tool generates pure-c, dependency-free code for the FSM.

The CLI tool is written in Ruby (>=2.7) and it can be installed with gem install gv_fsm. See also https://github.com/pbosetti/gv_fsm.


Have you tried umple?

It allows you to "draw" UML diagrams, (including FSM) and lets you generate code with them, and yes, it's open source.

  • That is indeed a great free tool. Unfortunately, I am not able to get the drawing functionality to work for the state machine diagrams. Seem to only work for class diagrams.
    – not2qubit
    May 23, 2021 at 20:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.