StateTrace: Interactive DFA & NFA Simulator

Draw finite-state machines and simulate DFA and NFA input strings with step-by-step transition tracing, visual execution, and acceptance results.

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. StateTrace 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

StateTrace 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.