A theoretical study of the electronic structure and magnetic properties of the half-metallic ferromagnet CrO2 is performed by means of the relativistic full-potential linear muffin-tin orbital method within the generalized gradient approximation (GGA) to the exchange correlation potential. The calculated spin and orbital magnetic moments at the chromium site agree well with existing experimental and theoretical results. It is found that the easy magnetization is along the [001] axis in agreement with experiment, which is confirmed by a noticeable anisotropy between the calculated chromium L 2,3 x-ray magnetic circular dichroism (XMCD) spectra for the [100] and [001] quantization directions. Furthermore, the oxygen K edge XMCD spectrum clearly shows an induced magnetism at the oxygen site, in agreement with experiment. The XMCD sum-rule-computed spin and orbital magnetic moments from the experimental spectra are close to the self-consistent results and are in good agreement with most experimental results. © 2006 IOP Publishing Ltd.