← Learn
Converter · step by step

NFA to DFA converter

Draw an NFA, press one button, and step through the subset construction: every move lights up the NFA states involved, and the DFA’s state table fills in as you go.

Watch it — strings ending in “ab”

This NFA guesses where the final “ab” begins. The subset construction replaces the guess with bookkeeping: each DFA state remembers every place the NFA could currently be. Press Play, or go step by step.

To DFA1/8
The NFA
aaaba,bεεbbεεq0q1q2
DFA · being built
q0
Start state
The DFA starts in q0 = ε-closure of the NFA's start state = {q0}.
each DFA state = a set of NFA states
q0 = {q0}
How it works
1

Start from the ε-closure of the start state

The DFA’s start state is the set of every NFA state reachable from q0 without reading anything.

2

For each set and each symbol, collect where the NFA could go

Follow that symbol from every state in the set, then add everything reachable by ε-moves. The result is one DFA state — a new one if that set has not been seen before.

3

Repeat until no new sets appear

An NFA with n states has at most 2ⁿ sets, but only the reachable ones are built, which is usually far fewer.

4

Mark the accepting states, add a trap state if needed

A set is accepting when it contains an accepting NFA state. If the NFA can get stuck, the empty set becomes a trap state so that the DFA has a transition for every symbol.

Questions

Does it handle ε-transitions?

Yes. ε-closures are taken at the start and after every symbol, so an ε-NFA converts directly — there is no separate ε-removal step.

Is the result the smallest possible DFA?

Not necessarily. The subset construction only builds reachable states, but some of them may still be equivalent. Use Minimize on the result to merge them.

How do I convert my own NFA?

Open the simulator, draw the NFA, and choose Convert in the dock. The same steps play on your machine, with the states lighting up on the canvas, and the DFA opens as a new machine next to it.

More step-by-step tools