Nondeterministic Finite Automaton
Test input
Input tape
ε (empty string)Want a specific preset configuration added? Request it by email at contact@csvisualizer.com.
Frequently Asked Questions
An NFA is a state machine where each (state, symbol) pair can have zero, one, or many transitions, and execution may branch into multiple simultaneous states. The machine accepts a string if any branch of execution ends in an accept state. NFAs are often easier to construct than equivalent DFAs.
An epsilon transition allows the automaton to move to another state without consuming any input character. NFAs can use ε-transitions to "jump" between states freely, which is useful for composing sub-machines. The simulator automatically computes ε-closures when stepping through execution.
Yes. For every NFA there exists a DFA that recognises the same language, via the subset construction (powerset construction). The resulting DFA may have exponentially more states in the worst case, but the recognised language is identical. Both models define exactly the class of regular languages.
The simulator tracks the full set of active states at each step, including ε-closure expansion. You can see which states are simultaneously active and how they evolve as each input symbol is consumed. Acceptance is shown once all input has been read and at least one active state is an accept state.
An NFA accepts a string if there exists at least one sequence of transitions — following the input symbols and any ε-transitions — that leads from the start state to an accept state after consuming all input. It is enough for one branch to succeed; all other branches may reject or get stuck.