NFA to DFA Converter
Convert NFA to DFA using the subset construction algorithm. Step-by-step walkthrough with worked examples for automata theory students.
Visual guide to NFA to DFA conversion using the subset construction algorithm.
Home → CS Student Hub → NFA to DFA Converter
Use the free NFA to DFA converter below to turn any NFA into an equivalent DFA, or learn how to convert NFA to DFA yourself with worked NFA to DFA conversion examples and practice problems.
📌 What is an NFA to DFA Converter?
An NFA to DFA converter takes a nondeterministic finite automaton (NFA) and builds an equivalent deterministic finite automaton (DFA) that accepts exactly the same language. It uses the subset construction algorithm: each DFA state stands for a set of NFA states.
Try the NFA to DFA Converter
Enter your NFA, press Convert, and get the DFA transition table with every subset-construction step. ε-transitions are supported.
Format: q0, 0 -> q0, q1 (state, symbol -> set of next states). Also accepted: δ(q0,0) = {q0,q1}. Leave a pair out, or write ∅, for no move. State names should not contain hyphens.
Unlock Your Potential
Turn your highest ambitions into everyday reality. You set the standard and aim for the goal; when you’re ready for what comes next, we help you cross the finish line.
Own Your Future →How to Convert NFA to DFA: Subset Construction Algorithm
Follow these steps to master NFA to DFA conversion.
Find the ε-closure of the start state
The ε-closure includes the start state and all states reachable via ε-transitions. This becomes the start state of your DFA.
For each input symbol, compute transitions
For each state set and input symbol, find all reachable NFA states. Then take the ε-closure of that set. This is the core of the subset construction algorithm.
Create new DFA states from reachable sets
Each new set of NFA states becomes a single state in the DFA. Continue this process until no new sets are generated. This NFA to DFA conversion method guarantees an equivalent DFA.
Mark final states in the DFA
Any DFA state that contains at least one final state from the original NFA becomes a final state in the DFA.
NFA to DFA Conversion Examples
Walk through a complete NFA to DFA conversion example using the subset construction algorithm.
Problem: Convert the following NFA to DFA.
NFA Definition: States {q0, q1, q2}, alphabet {0,1}, start state q0, final state q2. Transitions: δ(q0,0) = {q0,q1}, δ(q1,1) = {q2}.
Step 1: Start state DFA = ε-closure(q0) = {q0} (call it state A)
Step 2: From {q0}, on 0: move({q0},0) = {q0,q1} → ε-closure = {q0,q1} (new state B)
Step 3: From {q0}, on 1: move({q0},1) = {} → ε-closure = {} (dead state)
Step 4: From {q0,q1}, on 0: move = {q0,q1} → ε-closure = {q0,q1} (state B again, so no new state)
Step 5: From {q0,q1}, on 1: move = {q2} → ε-closure = {q2} (new state C, final because it contains q2)
Result: DFA with states A = {q0}, B = {q0,q1}, C = {q2} (final), plus the dead state ∅. The full transition table for Example 1 is in the “Subset Construction Algorithm: Transition Table” section further down this page. Examples 2 and 3 below show their tables right under the steps.
Example 2: NFA for strings ending in 01
NFA: States {q0, q1, q2}, alphabet {0,1}, start q0, final q2. Transitions: δ(q0,0) = {q0,q1}, δ(q0,1) = {q0}, δ(q1,1) = {q2}. There are no ε-moves, so every ε-closure is the set itself.
Step 1: Start: ε-closure(q0) = {q0}, so the DFA start state is A.
Step 2: From A = {q0}, on 0: move = {q0,q1} → ε-closure = {q0,q1} = B (new state)
Step 3: From A = {q0}, on 1: move = {q0} → ε-closure = {q0} = A
Step 4: From B = {q0,q1}, on 0: move = {q0,q1} → ε-closure = {q0,q1} = B
Step 5: From B = {q0,q1}, on 1: move = {q0,q2} → ε-closure = {q0,q2} = C (new state)
Step 6: From C = {q0,q2}, on 0: move = {q0,q1} → ε-closure = {q0,q1} = B
Step 7: From C = {q0,q2}, on 1: move = {q0} → ε-closure = {q0} = A
Result: only 3 DFA states are reachable (not 2³ = 8). C is final because it contains q2.
| DFA state | NFA state set | on 0 | on 1 |
|---|---|---|---|
| → A | {q0} | B | A |
| B | {q0,q1} | B | C |
| * C | {q0,q2} | B | A |
→ start state, * final state
Example 3: NFA with an ε-transition
NFA: States {q0, q1, q2}, alphabet {a,b}, start q0, final q2. Transitions: δ(q0,ε) = {q1}, δ(q0,a) = {q0}, δ(q1,b) = {q1,q2}, δ(q2,a) = {q2}.
Key point: the DFA start state is ε-closure(q0) = {q0,q1}, not just {q0}, because q0 can move to q1 without reading anything. After every move, take the ε-closure again.
Step 1: Start: ε-closure(q0) = {q0,q1}, so the DFA start state is A.
Step 2: From A = {q0,q1}, on a: move = {q0} → ε-closure = {q0,q1} = A
Step 3: From A = {q0,q1}, on b: move = {q1,q2} → ε-closure = {q1,q2} = B (new state)
Step 4: From B = {q1,q2}, on a: move = {q2} → ε-closure = {q2} = C (new state)
Step 5: From B = {q1,q2}, on b: move = {q1,q2} → ε-closure = {q1,q2} = B
Step 6: From C = {q2}, on a: move = {q2} → ε-closure = {q2} = C
Step 7: From C = {q2}, on b: move = ∅ → ε-closure = ∅ = ∅ (new state)
Step 8: ∅ is the dead state: it goes to itself on every symbol.
Result: B and C are final because they contain q2.
| DFA state | NFA state set | on a | on b |
|---|---|---|---|
| → A | {q0,q1} | A | B |
| * B | {q1,q2} | C | B |
| * C | {q2} | C | ∅ |
| ∅ | ∅ | ∅ | ∅ |
→ start state, * final state
Subset Construction Algorithm: Transition Table
The subset construction algorithm creates a transition table for the DFA.
Common Mistakes in NFA to DFA Conversion
Avoid these errors when using an NFA to DFA converter.
Always compute ε-closure after finding reachable states. This is critical for correct NFA to DFA conversion.
Every new state set becomes a DFA state. Don’t forget to process all of them.
A DFA state is final if it contains ANY NFA final state. This is a common mistake.
Include dead states explicitly for complete DFA representation.
Frequently Asked Questions
Common questions about NFA to DFA conversion and the subset construction algorithm.
What is an NFA to DFA converter?
An NFA to DFA converter is a tool or algorithm that transforms a nondeterministic finite automaton into an equivalent deterministic finite automaton. The subset construction algorithm is the standard method used for this conversion.
How to convert NFA to DFA step by step?
How to convert NFA to DFA involves 4 steps: (1) Find ε-closure of start state, (2) For each input symbol, compute transitions, (3) Create new DFA states from reachable sets, (4) Mark final states. This is the subset construction algorithm.
Why is the subset construction algorithm important?
The subset construction algorithm is the foundation of NFA to DFA conversion. It proves that NFAs are not more powerful than DFAs — any language accepted by an NFA can also be accepted by a DFA.
Where can I find more NFA to DFA conversion examples?
This page provides NFA to DFA conversion examples. For additional practice, check external resources like GeeksforGeeks and TutorialsPoint.
Can NFA to DFA conversion increase the number of states?
Yes, NFA to DFA conversion can cause state explosion. A DFA may have up to 2ⁿ states where n is the number of NFA states. The subset construction algorithm generates all possible subsets of NFA states.
Additional Resources
Explore more about automata theory and finite automata.
Turing Machine Simulator
Watch a Turing machine run palindrome, aⁿbⁿcⁿ and binary examples.
Try Turing Machine Simulator →Still Stuck with NFA to DFA Conversion?
Tried the subset construction algorithm but still confused? Don’t spend hours stuck on the same conversion.
Submit Your NFA/DFA Question — Get a Step-by-Step Solution
One of our CS experts will review your automata problem and send you a detailed, step-by-step explanation within 24-48 hours. Free. No strings attached.
📋 Before you submit:
- Be specific about the NFA you’re trying to convert (states, alphabet, transitions, start state, final states)
- Share where exactly you’re getting stuck — ε-closure? subset construction? transition table?
- Include any steps you’ve already completed (e.g., “I found the ε-closure of q0 = {q0,q1}”)
- If applicable, provide a diagram description or state transition table
Fill out the form below
🔒 Your email is safe with us. We’ll never share your information. Questions may be anonymized and added to our FAQ to help other students.
⚠️ Important Disclaimer
This form is for educational assistance only. We aim to respond within 24-48 hours, but response times may vary based on volume.
While we strive to provide accurate, step-by-step explanations, we cannot guarantee the correctness of every solution. Our guidance is meant to help you learn — not to replace your own work or your professor’s instruction.
For urgent exam questions, please consult your professor or teaching assistant. We do not provide last-minute solutions.
Get More Automata Theory Resources
Subscribe to get new NFA to DFA conversion examples, subset construction practice problems, and theory of computation study guides delivered to your inbox.
No spam. Unsubscribe anytime.
More NFA to DFA Practice Problems
Problem 1: strings that contain 00
NFA: states {q0, q1, q2}, alphabet {0,1}, start q0, final q2. δ(q0,0) = {q0,q1}, δ(q0,1) = {q0}, δ(q1,0) = {q2}, δ(q2,0) = {q2}, δ(q2,1) = {q2}. Convert it to a DFA with the subset construction, then open the answer to check.
Show answer
| DFA state | NFA state set | on 0 | on 1 |
|---|---|---|---|
| → A | {q0} | B | A |
| B | {q0,q1} | C | A |
| * C | {q0,q1,q2} | C | D |
| * D | {q0,q2} | C | D |
→ start state, * final state
Problem 2: strings ending in 00
NFA: states {q0, q1, q2}, alphabet {0,1}, start q0, final q2. δ(q0,0) = {q0,q1}, δ(q0,1) = {q0}, δ(q1,0) = {q2}. Convert it to a DFA with the subset construction, then open the answer to check.
Show answer
| DFA state | NFA state set | on 0 | on 1 |
|---|---|---|---|
| → A | {q0} | B | A |
| B | {q0,q1} | C | A |
| * C | {q0,q1,q2} | C | A |
→ start state, * final state
Problem 3: ε-NFA with 4 states
NFA: states {q0, q1, q2, q3}, alphabet {a,b}, start q0, final q3. δ(q0,ε) = {q1,q2}, δ(q1,a) = {q3}, δ(q2,b) = {q3}, δ(q3,a) = {q3}. Convert it to a DFA with the subset construction, then open the answer to check.
Show answer
| DFA state | NFA state set | on a | on b |
|---|---|---|---|
| → A | {q0,q1,q2} | B | B |
| * B | {q3} | B | ∅ |
| ∅ | ∅ | ∅ | ∅ |
→ start state, * final state
© 2025 MarxisSolution | The Framework | The Solution | Student Hub | Contact
Free NFA to DFA converter using subset construction algorithm for computer science students.
