We presented the X-ray magnetic circular dichroism (XMCD) and X-ray absorption spectroscopy (XAS) studies of heavy fermion compound CeAl 2 bulk and 8nm nanoparticles, performed at the Ce M 4,5 - and L 3 - absorption edges. XMCD and XAS revealed that Ce in bulk CeAl 2 exhibits localized 4f 1 character with magnetic ordering. The Ce in nanoparticles, on the other hand, shows a small amount delocalized 4f 0 character with non-magnetic Kondo behavior. By applying general sum rules, an estimation of the orbital and spin contribution to those Ce 4f moments can be obtained. Our results also demonstrated that the magnetic behavior in CeAl 2 is very sensitive to the degree of localization of the 4f electrons.