We present an analysis of the magnetic-field fluctuations in the magnetoionic medium in front of the radio galaxy 3C 31 derived from rotation-measure (RM) fits to high-resolution polarization images. We first show that the Faraday rotation must be due primarily to a foreground medium. We determine the RM structure functions for different parts of the source and infer that the simplest form for the power spectrum is a power law with a high-frequency cutoff. We also present three-dimensional simulations of RM produced by a tangled magnetic field in the hot plasma surrounding 3C 31, and show that the observed RM distribution is consistent with a spherical plasma distribution in which the radio source has produced a cavity.