An x-ray imaging apparatus and a method of controlling the x-ray imaging apparatus are provided. The x-ray imaging apparatus includes x-ray detectors configured to store detector identification data of the x-ray detectors, and a controller configured to receive the detector identification data from the x-ray detectors, and search for detector pairing data of usable x-ray detectors that match with the received detector identification data.