An X-ray imaging apparatus which takes an image of an object to be detected, comprises: a first grating to form a periodic bright-dark pattern by a Talbot effect, based on an X-ray from an X-ray source a second grating, disposed at a position where the bright-dark pattern is formed, to block a part of the bright-dark pattern a detector to detect an X-ray intensity distribution of the X-ray which passed through the second grating and a calculator to calculate phase information of the X-ray based on the detected X-ray intensity distribution, wherein the second grating includes a first region having a first blocking pattern and a second region having a second blocking pattern, and a direction in which the first blocking pattern blocks a bright section of the bright-dark pattern is different from a direction in which the second blocking pattern blocks the bright section of the bright-dark pattern.