For electronic excitations in the ultraviolet and visible range of the electromagnetic spectrum, the intensities are usually calculated within the dipole approximation, which assumes that the oscillating electric field is constant over the length scale of the transition. For the short wavelengths used in hard X-ray spectroscopy, the dipole approximation may not be adequate. In particular, for metal K-edge X-ray absorption spectroscopy (XAS), it becomes necessary to include higher-order contributions. In quantum-chemical approaches to X-ray spectroscopy, these socalled quadrupole intensities have so far been calculated by including contributions depending on the square of the electric-quadrupole and magnetic-dipole transition moments. However, the resulting quadrupole intensities depend on the choice of the origin of the coordinate system. Here, we show that for obtaining an originindependent theory, one has to include all contributions that are of the same order in the wave vector consistently. This leads to two additional contributions depending on products of the electric-dipole andelectric-octupole and of the electric-dipole and magnetic-quadrupole transition moments, respectively. We have implemented such an origin-independent calculation of quadrupole intensities in XAS within timedependent density-functional theory, and demonstrate its usefulness for the calculation of metal and ligand K-edge XAS spectra of transition metal complexes.2