StateTrace2: Interactive DFA & NFA Simulator

StateTrace2 is the edition of the StateTrace DFA and NFA simulator kept on this site: draw finite-state machines and trace input strings step by step.

Explore finite-state machines

Build a DFA or NFA, enter an input string, and trace how the machine processes each symbol.

Draw a state machine

Add states and transitions on the canvas, mark the start state and the accepting states, and label each transition with input symbols or an ε-move. Diagrams export as PNG, SVG, LaTeX, or JSON.

Trace an input string

Run the finite automaton on any input and step forwards or backwards. StateTrace2 highlights the current state of a DFA, or every active state of an NFA, along with the transition being taken, the consumed and remaining input, and whether the string is accepted or rejected.

DFA and NFA support

StateTrace2 detects whether a diagram is a deterministic or a nondeterministic finite automaton, including NFAs with ε-transitions, and follows all branches of an NFA at once. Pushdown automata and Turing machines are not simulated.