Subject motion during brain magnetic resonance spectroscopy acquisitions generally reduces the magnetic field (B0) homogeneity across the volume of interest or voxel. This is the case even if prospective motion correction ensures that the voxel follows the head. We introduce a novel method for rapidly mapping linear variations in B0 across a small volume using two-dimensional excitations. The new field mapping technique was integrated into a prospectively motion-corrected single-voxel 1H magnetic resonance spectroscopy sequence. Interference with the magnetic resonance spectroscopy measurement was negligible, and there was no penalty in scan time. Frequency shifts were also measured continuously, and both frequency and first-order shim corrections were applied in real time. Phantom experiments and in vivo studies demonstrated that the resulting motion- and shim-corrected sequence is able to mitigate line broadening and maintain spectral quality even in the presence of large-amplitude subject motion. Magn Reson Med, 2012. © 2012 Wiley Periodicals, Inc.