We propose a method to construct a nondestructive n-qubit Greenberger– Horne–Zeilinger (GHZ)-state analyzer. The method is applied to any systems in which two-qubit parity gates, controlled-phase gates, or controlled-NOT gates can be realized. We also present a simplified two-photon parity gate with which a nondestructive n-photon GHZ-state analyzer could be largely simplified. The nondestructive GHZ-state analyzer is expected to find useful a...