The discovery of new phenomena in layered and nanostructured magnetic devices is driving rapid growth in nanomagnetics research. Resulting applications such as giant magnetoresistive field sensors and spin torque devices are fuelling advances in information and communications technology, magnetoelectronic sensing and biomedicine1, 2. There is an urgent need for high-resolution magnetic-imaging tools capable of characterizing these complex, often buried, nanoscale structures. Conventional ferromagnetic resonance3, 4 (FMR) provides quantitative information about ferromagnetic materials and interacting multicomponent magnetic structures with spectroscopic precision and can distinguish components of complex bulk samples through their distinctive spectroscopic features. However, it lacks the sensitivity to probe nanoscale volumes and has no imaging capabilities. Here we demonstrate FMR imaging through spin-wave localization. Although the strong interactions in a ferromagnet favour the excitation of extended collective modes, we show that the intense, spatially confined magnetic field of the micromagnetic probe tip used in FMR force microscopy can be used to localize the FMR mode immediately beneath the probe. We demonstrate FMR modes localized within volumes having 200 nm lateral dimensions, and improvements of the approach may allow these dimensions to be decreased to tens of nanometres. Our study shows that this approach is capable of providing the microscopic detail required for the characterization of ferromagnets used in fields ranging from spintronics to biomagnetism. This method is applicable to buried and surface magnets, and, being a resonance technique, measures local internal fields and other magnetic properties with spectroscopic precision.