thin films were studied with different Si concentrations by x-ray absorption spectroscopy ͑XAFS͒, and the analysis was confronted to their magnetic properties of coercivity and anisotropy. The analysis of the XAFS spectra showed a higher disorder in the amorphous Fe-Si films than in the Co-Si films and a larger degree of clustering of Co atoms, consistent with the higher heat of alloying of Fe-Si with respect to Co-Si alloys. Both kinds of amorphous films contained a strongly disordered silicide phase that was hardly detected by extended XAFS spectroscopy ͑EXAFS͒. EXAFS spectra were dominated by the nonmagnetic ͑Fe,Co͒Si 2 environments. The orientation of the magnetic easy axis of the films was correlated with the expected anisotropic spatial distribution of Si concentration, which was defined by the oblique angle of incidence of Si atoms during film deposition. This indicates that such a detected nonmagnetic Si rich environments were anisotropically distributed and possibly segregated, influencing in a significant way the magnetic anisotropy of these films.