Jupiter’s atmosphere is rotating differentially, with zones and belts rotating at speeds that differ by up to 100 metres per second. Whether this is also true of the gas giant’s interior has been unknown, limiting our ability to probe the structure and composition of the planet. The discovery by the Juno spacecraft that Jupiter’s gravity field is north-south asymmetric and the determination of its non-zero odd gravitational harmonics J3, J5, J7 and J9 demonstrates that the observed zonal cloud flow must persist to a depth of about 3,000 kilometres from the cloud tops. Here we report an analysis of Jupiter’s even gravitational harmonics J4, J6, J8 and J10 as observed by Juno and compared to the predictions of interior models. We find that the deep interior of the planet rotates nearly as a rigid body, with differential rotation decreasing by at least an order of magnitude compared to the atmosphere. Moreover, we find that the atmospheric zonal flow extends to more than 2,000 kilometres and to less than 3,500 kilometres, making it fully consistent with the constraints obtained independently from the odd gravitational harmonics. This depth corresponds to the point at which the electric conductivity becomes large and magnetic drag should suppress differential rotation. Given that electric conductivity is dependent on planetary mass, we expect the outer, differentially rotating region to be at least three times deeper in Saturn and to be shallower in massive giant planets and brown dwarfs.