We report on the experimental observation of a transition from a dispersive wave turbulence regime to a nondispersive regime involving shock waves on the surface of a fluid. We use a magnetic fluid in a canal subjected to an external horizontal magnetic field to tune the dispersivity of the system. For a low magnetic field, gravity-capillary wave turbulence is observed, whereas for a high enough field, random steep coherent structures arise which are found to be shock waves. These shock waves create singularities in the second-order difference of the surface elevation, leading to an ω −4 frequency power spectrum. This spectrum is also found to be controlled by the number and amplitude of the shocks and is well captured by a model based on a random Dirac-δ distribution (Kuznetsov-like spectrum). Finally, the shock-amplitude statistics exhibits a power-law distribution with an exponent close to the predictions of the one-dimensional random-forced Burgers equation. This shock-wave regime, discovered here for surface waves, thus paves the way to better explore their properties.