A finite automaton maker that shows its work
Draw the automaton the way you would on paper: circles for states, arrows for transitions, a double circle for accepting states and an arrow into the start state. Then type an input and trace it. For a DFA the simulator lights up the single current state after every symbol; for an NFA it lights up the whole set of states the machine could be in, which is the part that is hard to keep straight by hand. Beside the canvas, the transition table (δ table) updates as you draw, in the layout exam answers use: one row per state, one column per symbol, → for the start state and * for accepting states.
DFA or NFA: which mode to use
A DFA has exactly one transition for every state and symbol, so a run is a single path and the answer is decided by the state you finish in. An NFA may have several transitions on the same symbol, none at all, or ε-moves that change state without reading input. It accepts if any of its possible runs ends in an accepting state. Every NFA has an equivalent DFA, but the DFA can need up to 2ⁿ states for an n-state NFA, which is why NFAs are the easier ones to design.
Switch to NFA mode whenever your diagram has a choice on some symbol or an ε arrow. In NFA mode the simulator takes the ε-closure at the start and after every symbol, so states reachable by ε-moves count as active too.
Worked example: strings ending in "abb"
Load the preset NFA: ends in 'abb'. It is the textbook four-state NFA over {a, b}: q0 loops on a and b, q0 –a→ q1, q1 –b→ q2, q2 –b→ q3, and q3 accepts. Trace babb:
| After reading | Active states |
|---|---|
| (start) | {q0} |
| b | {q0} |
| a | {q0, q1} |
| b | {q0, q2} |
| b | {q0, q3} → accepted, q3 is accepting |
Now trace abba: the active sets are {q0, q1}, {q0, q2}, {q0, q3}, then {q0, q1} after the final a. No accepting state is left, so it is rejected. The NFA "guesses" where the final abb begins by keeping q0 alive the whole time, while q1 → q3 checks the guess.
Those four active sets are exactly the states of the equivalent DFA. Open the NFA to DFA converter to see the subset construction build them one row at a time.
Examples you can load
Each example loads with a string it accepts, ready to trace. Every one has been checked against its language on all strings up to eight symbols long.
| Example | Type | How it works |
|---|---|---|
| Starts with a, ends with b | DFA, 4 states | A trap state catches anything starting with b; two states remember whether the last symbol was b. |
| Ends in abb | NFA, 4 states | The start state loops on a and b, and guesses where the final abb begins. |
| NFA with ε | NFA, 3 states | Accepts exactly "a" and "b": an ε-move lets the start state also act as q1. |
| Even number of 0s | DFA, 2 states | One state for "even so far", one for "odd"; 0 switches between them, 1 stays put. |
| Binary multiple of 3 | DFA, 3 states | The state is the value read so far, mod 3. Reading bit b moves remainder r to (2r + b) mod 3, so "110" (six) goes r0 → r1 → r0 → r0. |
| Contains 101 | DFA, 4 states | The states track how much of 101 has just been seen; after a full match, an accepting state loops on everything. |
| Even a's and even b's | DFA, 4 states | One state per pair of parities (EE, OE, EO, OO); a flips the first, b the second. |
| 3rd symbol from the end is 1 | NFA, 4 states | The NFA guesses which 1 is third from the end. A DFA for the same language needs 8 states, one for each pattern of the last three symbols. |
The last one is the standard example of why NFAs matter: run it through the NFA to DFA converter and the subset construction produces all 8 states, none of which can be merged.
Share it, export it, hand it in
- Share link puts the whole automaton, and the input you were tracing, into the URL. Anyone who opens it sees the same diagram ready to run, which is handy for checking an answer with a classmate or a teacher.
- Copy LaTeX (TikZ) gives a
tikzpictureusing the standardautomatalibrary, with start and accepting states marked and loops and two-way edges laid out. Paste it into Overleaf for a lab report or thesis. - Save PNG downloads the diagram as an image for slides or a document.
Nothing is uploaded: the automaton lives in your browser and in the link itself.
The rest of the automata toolkit
The same notation carries across every theory-of-computation step:
- Regex to NFA converter: Thompson's construction from a regular expression.
- NFA to DFA converter: the subset construction, step by step.
- DFA minimizer: merge equivalent states into the minimal DFA.
- PDA simulator: pushdown automata for context-free languages such as aⁿbⁿ.
- Turing machine simulator: tape, head and transitions for anything computable.
For the theory behind them, read NFA vs DFA and the subset construction explained. Coming from JFLAP? See how these tools compare with JFLAP, or every tool for the course in the CS theory lab.