We present Chandra X-ray and Very Large Array radio observations of the radio galaxy 3C 305. The X-ray observations reveal the details of the previously known extended X-ray halo around the radio galaxy. We show using X-ray spectroscopy that the X-ray emission is consistent with being shock-heated material and can be modelled with standard collisional-ionization models, rather than being photoionized by the active nucleus. On this basis, we can make a self-consistent model in which the X-ray-emitting plasma is responsible for the depolarization of some regions of the radio emission from the jets and hotspots, and to place lower and upper limits on the magnetic field strength in the depolarizing medium. On the assumption that the X-ray-emitting material, together with the previously known extended emission-line region and the outflow in neutral hydrogen, is all being driven out of the centre of the galaxy by an interaction with the jets, we derive a detailed energy budget for the radio galaxy, showing that the X-ray-emitting gas dominates the other phases in terms of its energy content. The power supplied by the jets must be ∼1043 erg s−1.