Files never leave your device

NFA to DFA converter

Build reachable deterministic subsets from a nondeterministic finite automaton. Your inputs stay on your device.

Set up your task

Ready. Processing stays in this browser.

How to use NFA to DFA converter

Build reachable deterministic subsets from a nondeterministic finite automaton. The pre-filled problem gives you a worked starting point. Compare the response with your own working before trying the self-check below.

  1. Check the example inputs: States, Start state, Accepting states, Transitions (state symbol target).
  2. Change the inputs for your problem. Results update as you type, so finish entering the values before copying an answer.
  3. Use the working to check an intermediate value or assumption. Then change the example as suggested in the self-check and compare the result.

Supported inputs and limits

Use up to eight NFA states, six single-character alphabet symbols and 100 transitions. Enter eps for an epsilon transition.

How it works

An NFA may follow several transitions for the same symbol, and epsilon moves need no input. A DFA can simulate it by making each deterministic state a set of all NFA states still possible after reading a prefix. The starting subset is the epsilon closure of the NFA start.

For a symbol, take all matching transitions out of the current subset, then take their epsilon closure. A subset accepts when it contains an accepting NFA state. The empty subset serves as a rejecting sink when it is reachable. The conversion generates only subsets reached in this manner.

Example

Run the pre-filled example. Its first result is “Reachable DFA subsets: 4”.

States
q0 q1 q2
Start state
q0
Accepting states
q2
Transitions (state symbol target)
q0 eps q1
q1 a q1
q1 b q2
Reachable DFA subsets: 4
Start: {q0, q1}
{q0, q1}: a → {q1} · b → {q2}
{q1}: a → {q1} · b → {q2}
{q2} (accepting): a → ∅ · b → ∅
∅: a → ∅ · b → ∅

Questions about NFA to DFA converter

Do I need a transition out of every NFA state?

No. A missing transition contributes an empty move from that state. The deterministic output still shows a result for every symbol in its alphabet.

Why can the DFA have more states than the NFA?

A subset records which original states can be active together. An NFA with n states allows up to 2ⁿ different subsets.

Look for q0 and q1 in the example’s start subset.

Both are present because q0 has an epsilon transition to q1. Reading b directly can reach the accepting state q2.

Related tools

Year 2: Algorithms and theory

Last updated