NMR well logging is a technique to characterize earth formations that can be many kilometers underground. In this method, a sensor is lowered into a borehole and instructed to continuously measure the NMR response of the fluids filling the pore space in the rocks surrounding the borehole. The sensor must be designed to withstand the adverse environmental conditions. It consists of permanent magnets, a radiofrequency coil, and the complete electronics for the transmitter and receiver functions. Such inside-out-devices generate static and radiofrequency magnetic fields that are necessarily grossly inhomogeneous across the formation. As a consequence, all NMR pulses act as slice-selective pulses. Despite these limitations, measurement techniques based on one-and two-dimensional pulse sequences have been developed that enable the quantitative determination of the relaxation and diffusion properties of the formation. The resulting distribution function of relaxation times and the two-dimensional relaxation-diffusion distribution functions are used to infer unique information about the types and compositions of the fluids residing in the pore space and give estimates of the distribution of pore sizes. The technique has found widespread commercial application in the evaluation of hydrocarbon-bearing reservoirs.