Heterogeneity of the static magnetic field in magnetic resonance imaging may cause image artifacts and degradation in image quality. The field heterogeneity can be reduced by dynamically adjusting shim fields or dynamic shim updating, in which magnetic field homogeneity is optimized for each tomographic slice to improve image quality. A limitation of this approach is that a new magnetic field can be applied only once for each slice, otherwise image quality would improve somewhere to its detriment elsewhere in the slice. The motivation of this work is to overcome this limitation and develop a technique using nonlinear magnetic fields to dynamically shim the static magnetic field within a single Fourier-encoded volume or slice, called sub-Fourier dynamic shim updating. However, the nonlinear magnetic fields are not used as shim fields; instead, they impart a strong spatial dependence to the acquired MR signal by nonlinear phase preparation, which may be exploited to locally improve magnetic field homogeneity during acquisition. A theoretical description of the method is detailed, simulations and a proof-of-principle experiment are performed using a magnet coil with a known field geometry. The method is shown to remove artifacts associated with magnetic field homogeneity in balanced steady-state free-precession pulse sequences. We anticipate that this method will be useful to improve the quality of magnetic resonance images by removing deleterious artifacts associated with a heterogeneous static magnetic field. Magn Reson Med 71:57–66, 2014. © 2013 Wiley Periodicals, Inc.