In a method and device to determine distortion correction data for distortion correction of magnetic resonance images acquired with a magnetic resonance system, a starting spherical function is calculated represents the magnetic field of a gradient coil of the magnetic resonance system on the basis of the conductor geometry of the gradient coil. A three-dimensional parameter map is determined that represents a magnetic field generated by the gradient coil using a defined measurement subject, with a defined gradient strength being set for the appertaining gradient coil. A deviation parameter map is generated on the basis of the parameter map and on the basis of a reference parameter map which was determined with deactivated gradient coil. Spherical function coefficients of the gradient magnetic field are determined by fitting a spherical function representing the magnetic field of the gradient coil to the deviation parameter map using the starting spherical function. The distortion correction data are determined on the basis of the spherical function coefficients of the fitted spherical function.