X-ray absorption fine structure (XAFS) spectroscopy has been widely used for decades in a wide range of scientific fields, including physics, chemistry, biology, materials sciences, environmental sciences, etc. This review article is devoted to the applications of XAFS in nanomaterials. The basic principles of XAFS are briefly described from the view point of practical application, including its theory, data analysis and experiments. Using selected examples from recent literatures, the power of XAFS in determination of local atomic/electronic structures is illustrated for various nanomaterials, covering metal and semiconductor nanoparticles, catalysts, core/shell structures, ultrathin nanosheets, and so on. The utilization of time-resolved XAFS technique is also briefly introduced, for in-situ probing the nucleation/growth processes of nanomaterials and identifying reaction intermediates of nanostructured catalysts under operando conditions.