In the recent years, slim-borehole nuclear magnetic resonance (NMR) tools, designed for shallow hydrogeological applications, have become available. We have developed and improved the performance of one of them to detect and characterize hydrocarbon contamination. Our objectives were (1) to generally increase the vertical resolution of NMR logs below the instrumental resolution to detect thin layers and (2) to study the feasibility of using these tools to distinguish fluids (i.e., oil and water) using NMR diffusion measurements. To increase the vertical resolution, we have jointly inverted measurements made with overlapping sensitive volumes. We have developed an example in which a thin layer of 10 cm was successfully resolved. Using this approach, the instrumental resolution of the probe (50 cm) can be increased at the cost of additional measurement time. To differentiate and quantify the water and oil phases based on their contrast in diffusion coefficient, we have used a Carr-Purcell-Meiboom-Gill pulse sequence with varying echo spacings. We have found that, due to the low magnetic gradient of the probe, diffusion coefficients <= 1 x 10(-10) m(2)/s were difficult to resolve. Therefore, hydrocarbons with low diffusion coefficients, e.g., crude or rapeseed oil, cannot be uniquely identified, but can be quantified and clearly distinguished from water. Hydrocarbons with higher diffusion coefficients, e.g., diesel, kerosene, and gasoline, can be unambiguously identified based on their diffusion coefficient but may be difficult to distinguish from water. We have combined both approaches, enabling NMR logging to be used for fluid identification with increased vertical resolution. We have evaluated the performance of the measurement and inversion schemes using a controlled experimental setup consisting of a rapeseed oil layer on top of water in a tank.