Solid organic matter (OM) plays an essential role in the generation, migration, storage, and production of hydrocarbons from economically important shale rock formations. Electron microscopy images have documented spatial heterogeneity in the porosity of OM at nanoscale, and bulk spectroscopy measurements have documented large variation in the chemical composition of OM during petroleum generation. However, information regarding the heterogeneity of OM chemical composition at the nanoscale has been lacking. Here we demonstrate the first application of atomic force microscopy-based infrared spectroscopy (AFM-IR) to measure the chemical and mechanical heterogeneity of OM in shale at the nanoscale, orders of magnitude finer than achievable by traditional chemical imaging tools such as infrared microscopy. We present a combination of optical microscopy and AFM-IR imaging to characterize OM heterogeneity in an artificially matured series of New Albany Shales. The results document the evolution of individual organic macerals with maturation, providing a microscopic picture of the heterogeneous process of petroleum generation.