Visual walkthrough — Chomsky Normal Form (CNF) — conversion
Step 0 — What are we even looking at?
WHAT. A grammar is a set of rewrite rules. On the left of every arrow sits a single variable (a placeholder, written as a capital letter). On the right sits a string of variables and terminals (the actual output letters, written lowercase). The special symbol means "the empty string — nothing at all".
WHY. Before transforming anything, we must agree on the shapes. CNF is a promise about the right-hand side of every rule. So the whole game is: reshape every right-hand side until it is one of exactly two allowed pictures.
PICTURE. The two legal CNF shapes, drawn as tree fragments.

Our patient for this whole page:
Read as "or" — it just lists several rules with the same left side. Notice the mess: is too long (3 symbols), mixes a terminal with a variable, is a rename, and vanishes. Every disease CNF cures is present here.
Step 1 — START: give the start symbol a bodyguard
WHAT. Add one brand-new variable and one rule . Now is the start symbol; the old becomes an ordinary worker.
WHY. CNF allows only from the start symbol. Later we will erase -rules everywhere else. If the start symbol also appeared inside other rules, erasing would tangle its two jobs (being the root, and being a building block). points only downward and appears on no right-hand side, so it stays clean forever.
PICTURE. The new root sits on top; nothing points back up into it.

Step 2 — DEL: find who can vanish, then erase
WHAT. First compute the nullable set — every variable that can eventually derive . Then, for each rule, add copies with the nullable symbols dropped, and finally delete the bare rules.
WHY. A rule like is illegal in CNF (for non-start ). But we cannot just delete it — some strings depend on disappearing. So we pre-bake every "what if this vanished?" outcome directly into the other rules, then throw the -rule away safely.
PICTURE — building by fixed point. We keep adding variables until nothing new appears.

Reading the picture:
- directly, so .
- , and every symbol on that right side () is now in , so .
- Check the rest: no other rule has an entirely nullable right side. stops growing.
PICTURE — patching . Both 's are nullable, so we drop the left one, the right one, or both.

Term by term for :
- drop neither →
- drop pos 3 →
- drop pos 1 →
- drop both →
So . For ( nullable): drop → add . For ( nullable): dropping would leave empty, i.e. — forbidden, so we discard that copy and keep . Finally delete .
Step 3 — UNIT: erase the renames
WHAT. A unit rule is — one variable renamed to another, producing no letter and no branch. We find every unit pair meaning " can reach using only renames", then copy 's real (non-unit) rules onto , and delete all renames.
WHY. Renames add tree depth but no information — they cannot be a "two variables" node or a "one terminal" node, so they are illegal in CNF. The fix is to short-circuit them: wherever a rename could eventually reach a productive body, attach that body directly.
PICTURE. Following the rename arrows, then collapsing them into direct edges.

The unit pairs here (a variable always reaches itself, plus follow the arrows):
- : so inherits 's real bodies.
- is a trivial self-rename — just delete it.
- and : so inherits both 's and 's real bodies.
Collect each variable's non-unit bodies:
- real bodies of :
- real bodies of : from reaching → ; from reaching →
Step 4 — TERM: pull terminals out of long rules
WHAT. Wherever a terminal sits next to other symbols (like in ), invent a variable with the single rule , and swap the loose for .
WHY. CNF forbids mixing — a two-child node must be two variables, never a letter beside a variable. A lone is already legal, so we only touch terminals that share a right-hand side with something else.
PICTURE. The terminal is lifted out into its own tiny rule.

Only mixes. Introduce , and rewrite (now two variables). The standalone and stay untouched.
Step 5 — BIN: chop everything down to pairs
WHAT. Any right-hand side longer than 2 gets cut into a chain of length-2 rules, each new link stored in a fresh helper variable.
WHY. The last illegal shape is too long: has three symbols. A binary tree node holds exactly two children, so we split "first symbol, then the rest", and let a helper variable be "the rest".
PICTURE. becomes a two-level fold: paired with a helper that unfolds into .

For : create and rewrite . Every other rule is already length .
Edge cases you must be able to survive
The one-picture summary

The whole pipeline in one strip: a messy right-hand side enters on the left and leaves on the right as pure "two boxes" and "one letter" pieces. Read the amber arrows in order — START, DEL, UNIT, TERM, BIN — the same order Sipser insists on, because DEL and UNIT can only shrink rules, so running them first means TERM and BIN never have to be redone.
Recall Feynman retelling — say it like a story
We had a grammar full of bad habits. First we hired a bodyguard so the real start symbol could be handled without breaking anything. Then we hunted down every variable that could vanish into nothing and, before deleting those vanishing rules, we pre-wrote every "what if it's gone?" version into the surviving rules. Next we spotted lazy renames — a variable that just points at another — and we replaced each one with the actual work the target does. Then we found terminals hiding among variables and gave each its own little factory . Finally we took every rule that was too long and folded it into a chain of pairs using helper variables. At the end, every rule is either "combine two things" or "emit one letter" — a perfect binary tree grammar that CYK can parse in .
Recall Self-test
Why must DEL run before TERM/BIN? ::: DEL/UNIT can only shrink or rename right-hand sides; doing them first means the freshly created TERM/BIN variables never need re-cleaning. In with nullable, what does DEL produce? ::: — every subset dropped except the empty one. After the full conversion, what is 's only rule? ::: .
Related: Context-Free Grammars · CYK Algorithm · Pumping Lemma for CFLs · Greibach Normal Form · Pushdown Automata