Phosphorus K-edge X-ray absorption near-edge structure (XANES) spectroscopy is a technique routinely employed in the qualitative and quantitative analysis of phosphorus speciation in many scientific fields. The data analysis is, however, often performed in a qualitative manner, relying on linear combination fitting protocols or simple comparisons between the experimental data and the spectra of standards, and little quantitative structural and electronic information is thus retrieved. Herein, we report a thorough theoretical investigation of P K-edge XANES spectra of NaH 2 PO 4 •H 2 O, AlPO 4 , α-Ti(HPO 4 ) 2 •H 2 O, and FePO 4 •2H 2 O showing excellent agreement with the experimental data. We find that different coordination shells of phosphorus, up to a distance of 5−6 Å from the photoabsorber, contribute to distinct features in the XANES spectra. This high structural sensitivity enables P Kedge XANES spectroscopy to even distinguish between nearly isostructural crystal phases of the same compound. Additionally, we provide a rationalization of the pre-edge transitions observed in the spectra of α-Ti(HPO 4 ) 2 •H 2 O and FePO 4 •2H 2 O through density of states calculations. These pre-edge transitions are found to be enabled by the covalent mixing of phosphorus s and p orbitals and titanium or iron d orbitals, which happens even though neither metal ion is directly bound to phosphorus in the two systems.