An X-ray imaging apparatus includes an X-ray source to generate and irradiate X-rays an X-ray detector installed in at least one module of one or more modules, to detect the irradiated X-rays an Identification (ID) resistor included in the module a port included in the X-ray detector and a controller to determine a module in which the X-ray detector has been installed, using the ID resistor and the port. The controller may assign a static Information Provider (IP) address to the module, and determine a module in which the X-ray detector has been installed, based on the static IP address. According to the X-ray imaging apparatuses and a control method thereof, it is possible to determine an installation location of the X-ray detector, and to use the X-ray detector in various modules without having to provide separate X-ray detectors for different locations.