An X-ray imaging apparatus includes an X-ray generator configured to generate and radiate X-rays to a subject, an X-ray detector configured to detect and convert X-rays transmitted through the subject into an image signal, and a controller configured to analyze the image signal of the subject and set gain of the X-ray detector according to detection regions.