We report on the realization and application of nondestructive three-qubit parity measurements on nuclear spin qubits in diamond. We use high-fidelity quantum logic to map the parity of the joint state of three nuclear spin qubits onto an electronic spin qubit that acts as an ancilla, followed by a single-shot nondestructive readout of the ancilla combined with an electron spin echo to ensure outcome-independent evolution of the nuclear spins. Through the sequential application of three such parity measurements, we demonstrate the generation of genuine multipartite entangled states out of the maximally mixed state. Furthermore, we implement a single-shot version of the Greenberger-Horne-Zeilinger experiment that can generate a quantum versus classical contradiction in each run. Finally, we test a state-independent noncontextuality inequality in eight dimensions. The techniques and insights developed are relevant for fundamental tests as well as for quantum information protocols such as quantum error correction.