Home/Glossary/Toffoli Gate
Gates

Toffoli Gate

The three-qubit CCX gate — flips the target qubit only when both control qubits are |1⟩.

The Toffoli gate (CCX or Controlled-Controlled-NOT) is a three-qubit gate that applies an X (NOT) gate to the target qubit only when both control qubits are in state |1⟩. It is named after Tommaso Toffoli who introduced it in 1980. The Toffoli gate is universal for classical reversible computation — any classical Boolean circuit (AND, OR, NOT) can be implemented reversibly using Toffoli gates. Combined with the Hadamard gate, it becomes universal for quantum computation. Since it is a 3-qubit operation, Toffoli gates are expensive on real hardware: they are typically decomposed into 6 CNOT gates and several single-qubit gates during transpilation. Toffoli gates appear frequently in quantum arithmetic, oracle construction for Grover's algorithm, and classical function simulation.