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. Alternatively, the module may include an electric device configured to generate an electrical signal according to whether the X-ray detector has been coupled and the controller is configured to determine a coupling module with which the X-ray detector has been coupled among the at least one coupling module, based on the electrical signal. 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.