Understanding the composition and molecular structure of kerogens and coals is a key issue in geochemistry, as these parameters control their chemical evolution and their by-products generated in sedimentary basins. As they are chemically heterogenous, investing their structure and composition at various spatial scales is essential and relies on a variety of micro-analytical tools. Conventional infrared (IR) microscopy has proven to be a powerful and promising approach to characterize these heterogeneous materials, but due to the diffraction limit, the spatial resolution cannot get below ∼1 μm, and cannot measure individual submacerals, tiny mineral inclusions, and more generally cannot access to chemical variations at the nanometer scale. In contrast, atomic force microscopy coupled to infrared spectroscopy (AFM-IR) attains a much higher spatial resolution, down to tens of nanometers. In this paper, AFM-IR measurements were collected on three immature and mature coals, with mean-maximum vitrinite reflectance R0 of 0.33%, 1.16%, and 2.8%. Measurements were collected in both tapping and contact modes, on samples prepared as sulfur embedded ultrathin sections and pressed on diamond windows. These spectral data were compared to spectra collected with conventional micro-IR microscopy (μ-FTIR). Spectra with a high quality could be obtained, which point to chemical heterogeneity at the sub-micrometer scale, and they display similar bands than those observed in spectra collected by means of conventional micro-IR. The signal-to-noise ratio was better in spectra collected in contact mode compared to tapping mode. The spatial resolution was around ∼100 nm in contact mode, while a resolution of at least 20 nm was achieved in tapping mode. Kaolinite was detected as a ∼ 500 nm grain included in organic matter. These results show that sulfur embedded ultrathin sections are as a suitable sample preparation for AFM-IR. However, systematic differences are reported compared to spectra collected by conventional μ-FTIR, possibly due to an instrumental artifact that increases the absorption signal as the wavenumber is decreased. Similarly, systematic differences are observed between data collected in tapping and contact modes, along with a much broader chemical heterogeneity. These differences are not fully understood, and should be investigated further in future studies.