An X-ray imaging apparatus for imaging an object to be inspected includes a grating that forms a periodic pattern using an X-ray from an X-ray source and a detector that detects the periodic pattern. In the X-ray imaging apparatus, when θ1 is an angle formed between a first direction, which is a periodic direction of the periodic pattern in a plane that is perpendicular to an optical axis of the X-ray, and a line parallel to an X-ray receiving surface of the detector in the plane, and θ2 is a grazing angle of the X-ray relative to the X-ray receiving surface, holds. Also in the X-ray imaging apparatus, an angle formed between a surface of the grating and the optical axis of the X-ray is from 45 to 90°.