Theory of Automata & Formal Languages

Context-Free Grammar Normal Form Converter

Convert any CFG to Chomsky Normal Form or Greibach Normal Form with step-by-step transformations, CYK parsing, FIRST/FOLLOW sets, and parse tree visualization.

0 CNF Steps
0 GNF Steps
0 Analysis Tools
Scroll

Everything you need for CFG analysis

A comprehensive toolkit for grammar transformations, parsing, and visualization

CNF Conversion

ε-elimination, unit removal, and binarization in 6 detailed steps

Core

GNF Conversion

Left-recursion elimination and terminal substitution in 9 steps

Core

CYK Algorithm

String membership testing with visual triangular parsing table

Parsing

FIRST & FOLLOW Sets

Tabular computation of FIRST and FOLLOW for every variable

Analysis

Parse Trees

Canvas-rendered trees with leftmost derivation tracing

Visual

Diff & Export

Before/after comparison, clipboard copy, and .txt export

Utility

Three simple steps

From grammar input to fully converted normal form

1

Enter Your Grammar

Type productions directly or use the structured form. Load built-in examples to get started quickly.

2

Choose Conversion

Select CNF, GNF, or both. The converter applies each transformation step-by-step with full explanations.

3

Analyze & Test

Test strings with CYK parsing, view FIRST/FOLLOW sets, explore parse trees, and export your results.

Input Grammar

Syntax reference
  • A-Z non-terminals (variables)
  • a-z 0-9 terminals
  • or -> production arrow
  • | alternatives
  • ε or eps empty string
  • First LHS = start symbol
123
Examples:
Ctrl+Enter convert · navigate steps · Space auto-play