FSM simulator

Visually simulate your DFAs, NFAs and ε-NFAs
one input symbol at a time!

① Create automaton

Enter a regular expression into the input field below or click Generate random regex to have the app generate a simple regex randomly for you. Next, click Create automaton to create a FSM for the defined regex and display its transition graph.

A valid regex consists of alphanumeric characters representing the set of input symbols (e.g. a, B, 9), the $ character representing the empty string, the choice operator +, the Kleene operator *, and parentheses ( and ). An example of a valid regex is: (a+B)*(c9+$)+$.

Enter a FSM into the input field below or click Generate random DFA/NFA/eNFA to have the app generate a simple FSM randomly for you. Next, click Create automaton to display the FSM's transition graph.

A valid FSM definition contains a list of states, symbols and transitions, the initial state and the accepting states. States and symbols are alphanumeric character strings and can not overlap. Transitions have the format: stateA:symbol>stateB,stateC. The $ character is used to represent the empty string symbol (epsilon) but should not be listed in the alphabet. Generate a FSM to see a valid example.

② Simulate automaton

Enter a sequence of input symbols into the input field below or click Random string, Acceptable string and Unacceptable string to have the app generate random acceptable and unacceptable sequences for you.

Click Read next to have the FSM consume the next input symbol in the sequence and Read all to consume all remaining input symbols. Click Step backward to go back one symbol and Reset to reset the FSM and go back to the beginning of the input sequence.

The input field highlights the input symbol that will be read next.


③ Transition graph

The FSM being simulated is displayed in the form of a transition graph. The nodes representing the current states of the FSM are colored in    .

④ What's next?

This is just the beginning! If you like learning about and playing with FSMs and regexes, check out these other Web apps:

⑤ Feedback

Love the application, hate it, found a bug, or have a feature idea? I'd love to hear about it! Please send your feedback via the noam project issues page on GitHub.