An air conditioner in which one control portion (10, 30) and a plurality of indoor units (21 to 24) are connected to each other through a communication line (40,50) and running is controlled by conducting communication between said control portion and said plurality of indoor units based on a communication address corresponding to each of said plurality of indoor units, wherein said control portion includes: an identification number detection portion which transmits detection commands each of which requests a different one of digits of a unique identification number to each of said indoor units in a predetermined order while a position of one of said digits is changed and detects said identification number; and an address setting portion which imparts said communication address to one of said indoor units having said identification number detected by said identification number detection portion, each of said indoor units includes a transmitting and receiving portion (212a, 212b) which receives said detection commands from said control portion through said communication line and transmits a response including one of said digits of said identification number corresponding to each of said detection commands through said communication line, characterized in that: said identification number detection portion simultaneously transmits a first of said detection commands to said plurality of indoor units, and said identification number detection portion simultaneously transmits a second of said detection commands immediately preceding said first of said detection commands based on said predetermined order to said plurality of indoor units, when no said response to said first of said detection commands is received. an identification number detection portion which transmits detection commands each of which requests a different one of digits of a unique identification number to each of said indoor units in a predetermined order while a position of one of said digits is changed and detects said identification number; and an address setting portion which imparts said communication address to one of said indoor units having said identification number detected by said identification number detection portion, each of said indoor units includes a transmitting and receiving portion (212a, 212b) which receives said detection commands from said control portion through said communication line and transmits a response including one of said digits of said identification number corresponding to each of said detection commands through said communication line, characterized in that: said identification number detection portion simultaneously transmits a first of said detection commands to said plurality of indoor units, and said identification number detection portion simultaneously transmits a second of said detection commands immediately preceding said first of said detection commands based on said predetermined order to said plurality of indoor units, when no said response to said first of said detection commands is received. said identification number detection portion simultaneously transmits a first of said detection commands to said plurality of indoor units, and said identification number detection portion simultaneously transmits a second of said detection commands immediately preceding said first of said detection commands based on said predetermined order to said plurality of indoor units, when no said response to said first of said detection commands is received.