GHZ state (Greenberger-Horne-Zeilinger state) is a maximally entangled quantum state of three or more qubits. The three-qubit GHZ state is an equal superposition of all-zeros and all-ones.
$$\lvert\text{GHZ}\rangle = \frac{1}{\sqrt{2}}(\lvert 000\rangle + \lvert 111\rangle)$$
The GHZ state is named after Daniel Greenberger, Michael Horne, and Anton Zeilinger, who introduced it in 1989. It is a natural generalization of the two-qubit Bell state $\lvert\Phi^+\rangle$ to three qubits. Measuring any single qubit of the GHZ state in the computational basis yields $0$ or $1$ with equal probability, and collapses all remaining qubits to the same value.
The $n$-qubit GHZ state generalizes straightforwardly to any number of qubits $n \geq 2$.
$$\lvert\text{GHZ}_n\rangle = \frac{1}{\sqrt{2}}\left(\lvert 0\rangle^{\otimes n} + \lvert 1\rangle^{\otimes n}\right)$$
The three-qubit GHZ state is prepared by applying a Hadamard gate to the first qubit and then applying CX gates from the first qubit to each of the other two qubits.
$$\lvert 000\rangle \xrightarrow{H \otimes I \otimes I} \frac{1}{\sqrt{2}}(\lvert 0\rangle + \lvert 1\rangle)\otimes\lvert 00\rangle \xrightarrow{\text{CX}_{1\to 2}} \frac{1}{\sqrt{2}}(\lvert 000\rangle + \lvert 100\rangle) \xrightarrow{\text{CX}_{1\to 3}} \frac{1}{\sqrt{2}}(\lvert 000\rangle + \lvert 111\rangle)$$
Unlike the W state, the GHZ state is fragile: tracing out any single qubit reduces the remaining two-qubit state to the completely mixed state $I/2$, with no residual entanglement between the surviving qubits.
Flipping all three qubits simultaneously just swaps $\lvert 000\rangle \leftrightarrow \lvert 111\rangle$ in the superposition, so the GHZ state is unchanged. This global bit-flip symmetry is a defining feature of the GHZ state: the correlations are all-or-nothing, and the “all zeros” and “all ones” branches are related by a global flip.
$$X^{\otimes 3}\lvert\text{GHZ}\rangle = \frac{1}{\sqrt{2}}(X\lvert 0\rangle X\lvert 0\rangle X\lvert 0\rangle + X\lvert 1\rangle X\lvert 1\rangle X\lvert 1\rangle) = \frac{1}{\sqrt{2}}(\lvert 111\rangle + \lvert 000\rangle) = \lvert\text{GHZ}\rangle$$
Applying Z to any single qubit negates the $\lvert 111\rangle$ term (where that qubit is in $\lvert 1\rangle$) and leaves $\lvert 000\rangle$ unchanged. This flips the relative sign, producing a distinct state sometimes written $\lvert\text{GHZ}^-\rangle$.
$$Z_1\lvert\text{GHZ}\rangle = \frac{1}{\sqrt{2}}(Z\lvert 0\rangle\otimes\lvert 00\rangle + Z\lvert 1\rangle\otimes\lvert 11\rangle) = \frac{1}{\sqrt{2}}(\lvert 000\rangle - \lvert 111\rangle)$$
Applying $Z$ to a second qubit would negate the $\lvert 111\rangle$ term again, cancelling the first sign flip and returning to $\lvert\text{GHZ}\rangle$. So $Z$ on an even number of qubits leaves the state invariant; $Z$ on an odd number gives $\lvert\text{GHZ}^-\rangle$.
The two-qubit Bell state $\lvert\Phi^+\rangle = \tfrac{1}{\sqrt{2}}(\lvert 00\rangle + \lvert 11\rangle)$ is the $n=2$ member of the GHZ family. It shares the same structure — equal superposition of all-zeros and all-ones — and the same bit-flip invariance ($X\otimes X$ leaves it unchanged). The GHZ state is what you get by entangling one more qubit into the superposition.
The GHZ state and the W state are the two inequivalent classes of genuine three-qubit entanglement. Tracing out any single qubit of the GHZ state collapses the remaining two to the completely mixed state $I/2$, with zero residual entanglement. The W state is the opposite: qubit loss still leaves a Bell state behind two thirds of the time. The two classes cannot be interconverted by LOCC.
The $n$-qubit GHZ state $\tfrac{1}{\sqrt{2}}(\lvert 0\rangle^{\otimes n} + \lvert 1\rangle^{\otimes n})$ is prepared by one Hadamard on qubit 1 followed by $n-1$ CX gates from qubit 1 to each of the other qubits. The state saturates the Mermin inequality for $n$ qubits, producing the maximum possible violation of local hidden variable theories for multi-qubit correlations.