X-ray powder diffraction (XRPD) is a key technique for identifying crystalline forms of a active pharmaceutical ingredient (API), providing a distinct "fingerprint" for every crystalline phase such as polymorph, solvate, hydrate, salt, and cocrystal. This chapter discusses the underlining physics of powder diffraction related to the molecular structure of pharmaceutical materials and showcase qualitative/quantitative applications of XRPD in characterizing pharmaceutical solids. It also presents some advanced applications of this technique, such as Rietveld analysis, solving crystal structures using powder patterns, and studying the structure of amorphous materials by determining their pairwise distribution functions. The chapter then briefly describes various types of instrumentation involving XRPD including variable temperature XRPD (VT-XRPD). Atomic pair distribution function (PDF) has emerged as a useful technique to characterize pharmaceutical materials based on total diffraction analysis. The PDF offers a fingerprint of the interatomic distances that define the structure of a particular solid form.