Quantum physics cannot be reconciled with the classical philosophy of noncontextual realism. Realism demands that system properties exist independently of whether they are measured, while noncontextuality demands that the results of measurements do not depend on what other measurements are performed in conjunction with them. The Bell-Kochen-Specker theorem states that noncontextual realism cannot reproduce the measurement statistics of a single three-level quantum system (qutrit). Noncontextual realistic models may thus be tested using a single qutrit without relying on the notion of quantum entanglement in contrast to Bell inequality tests. It is challenging to refute such models experimentally, since imperfections may introduce loopholes that enable a realist interpretation. Using a superconducting qutrit with deterministic, binary-outcome readouts, we violate a noncontextuality inequality while addressing the detection, individual existence and compatibility loopholes. Noncontextuality tests have been carried out in a range of different physical systems and dimensionalities, including neutrons, trapped ions and single photons, but no experiment addressing all three loopholes has been performed in the qutrit scenario where entanglement cannot play a role. Demonstrating state-dependent contextuality of a solid-state system is also an important conceptual ingredient for universal quantum computation in surface-code architectures, currently the most promising route to scalable quantum computing.