The discovery of topological order has revised the understanding of quantum matter and provided the theoretical foundation for many quantum error–correcting codes. Realizing topologically ordered states has proven to be challenging in both condensed matter and synthetic quantum systems. We prepared the ground state of the toric code Hamiltonian using an efficient quantum circuit on a superconducting quantum processor. We measured a topological entanglement entropy near the expected value of –ln2 and simulated anyon interferometry to extract the braiding statistics of the emergent excitations. Furthermore, we investigated key aspects of the surface code, including logical state injection and the decay of the nonlocal order parameter. Our results demonstrate the potential for quantum processors to provide insights into topological quantum matter and quantum error correction.