There is a fundamental need for techniques for thin film characterization. The current options for obtaining infrared (IR) spectra typically suffer from low signal-to-noise-ratios (SNRs) for sample thicknesses confined to a few nanometers. We present nanomechanical infrared spectroscopy (NAM-IR), which enables the measurement of a complete infrared fingerprint of a polyvinylpyrrolidone (PVP) layer as thin as 20 nm with an SNR of 307. Based on the characterization of the given NAM-IR setup, a minimum film thickness of only 160 pm of PVP can be analyzed with an SNR of 2. Compared to a conventional attenuated total reflectance Fourier transform infrared spectroscopy (ATR-FTIR) system, NAM-IR yields an SNR that is 43 times larger for a 20 nm-thick PVP layer and requires only a fraction of the acquisition time. These results pave the way for NAM-IR as a highly sensitive, fast, and practical tool for IR analysis of polymer thin films.