The recent technological developments in nuclear magnetic resonance (NMR) have made it possible to extend the use of this methodology to the formation of body images (MRI), as well as to the in vivo detection of metabolites in tissues and organs, by means of localized magnetic resonance spectroscopy (MRS). After presenting a brief semi-classical introduction to the NMR phenomenon, this article illustrates the principles of MRI, starting from phase encoding to the most commonly used pulse sequences. The main techniques of localized MRS are then introduced, with particular attention to their major advantages and limitations. The last session is devoted to the schematic description of a system for magnetic resonance imaging and spectroscopy.