Regular expression to NFA
Type a regular expression and watch Thompson’s construction assemble the NFA, one sub-expression at a time. Then open it in the simulator and run strings through it.
Each step lights up the fragment built for one sub-expression, innermost first. Use + or | for union, * for repetition, ? for optional, and ε for the empty string.
A symbol becomes two states and one transition
The smallest fragment: an entry, an exit, and the symbol between them.
Concatenation chains fragments
The second fragment starts where the first one ends.
Union branches with ε-moves
An ε-move leads into each alternative, and an ε-move leads from each one to a shared exit.
Star adds a loop and a bypass
ε-moves let the inner fragment be repeated any number of times, or skipped entirely.
Which syntax is supported?
Juxtaposition for concatenation, + or | for union, * for Kleene star, ? for optional, parentheses, ε for the empty string and ∅ for the empty language. There is no “one or more” operator because + means union, as in most automata textbooks: write aa* instead.
Why does the NFA have so many ε-moves?
Thompson’s construction trades size for simplicity: every operator is handled the same mechanical way. Open the result and use Convert → To DFA, then Minimize, to get the compact machine.
Can I get a DFA directly?
Yes, in two clicks: open the NFA in the simulator, convert it to a DFA, and minimize.