An X-ray imaging apparatus for imaging a subject includes a diffraction grating configured to form an interference pattern by diffracting X-ray radiation from an X-ray source, a shielding grating configured to shield part of the interference pattern, a detector configured to detect the X-ray radiation passing through the shielding grating, and a moving unit configured to change an angle between each of the diffraction grating, the shielding grating and the detector and an optical axis, wherein the detector is configured to detect the X-ray according to a change in the angle between each of the diffraction grating, the shielding grating and the detector and the optical axis.