A deterministic finite automaton (DFA) is a set of states connected by labeled transition arrows, one starting state and one or more accepting states. Reading an input string one symbol at a time, the automaton follows exactly one transition per symbol — the current state and the next symbol together determine the only possible next state. If the automaton runs out of matching transitions it gets stuck and the string is rejected immediately; otherwise, once every symbol has been consumed, the string is accepted if the automaton lands on an accepting state, and rejected otherwise.
δ: State × Symbol → State
accept(w) ⇔ δ*(q₀, w) ∈ F
- Preset — three classic regular languages: even parity of 0s, binary numbers divisible by 3 (tracked via remainder states), and strings ending in "ab".
- Run / Step — animate the whole string at once, or advance one symbol at a time to watch each transition individually.
- Build mode — construct your own automaton from scratch: add states by clicking the ground, wire transitions in Connect mode, then mark a start state and one or more accepting states.
- This is exactly the machinery behind lexical analyzers and regular-expression engines — every regex ultimately compiles down to a finite automaton just like the ones animated here.