An automatic analyzer having a transport device that transports a specimen rack (2, 3) on which one or more specimen containers containing a specimen to be analyzed are mounted; and an analysis unit that analyzes the specimen contained in the specimen container, wherein the transport device includes: a specimen rack gripping mechanism (59; 59A) comprising gripping plates (57a;257a) that grips the specimen rack (2, 3) on a first transport path on which the specimen rack (2, 3) is transported by the specimen rack (2, 3) being sandwiched between gripping plates (57a; 257a) from both sides of flanks in the transport direction to transport the specimen rack (2, 3) along the first transport path; and a gripping width controller that controls a distance between the gripping plates (57a; 257a) of the specimen rack gripping mechanism (59; 59A) in accordance with a width of the specimen rack (2, 3), and a rack stopper wherein the transport device transports two types of the specimen racks (2, 3), a first specimen rack holding only one specimen container and a second specimen rack on which a plurality of specimen containers is mounted by the specimen racks (2, 3) being arranged equidistantly in the transport direction, a length of the first specimen rack in the transport direction is formed shorter than the gripping plate (57a; 257a) and the width thereof is formed wider than the second specimen rack, the length of the second specimen rack is substantially equal to the length of the gripping plate (57a; 257a) and the width thereof is formed narrower than the first specimen rack, and the automatic analyzer comprises: a plurality of sensors arranged along the first transport path of the transport device to detect presence/absence of the first specimen rack or the second specimen rack in each arrangement position on the first transport path; and a general management computer that determines whether the specimen rack (2, 3) on the first transport path is the first specimen rack or the second specimen rack based on detection results from the plurality of sensors, characterized in that, depending on the determination result of the general management computer, when the first specimen rack and the second specimen rack are successively stopped by a rack stopper in a gripping position of the specimen rack gripping mechanism (59; 59A) and a plurality of the first specimen racks is successively stopped from the upstream side, the general management computer controls the specimen rack gripping mechanism (59; 59A) to grip the plurality of the first specimen racks that are successively stopped simultaneously and transports them downstream. a specimen rack gripping mechanism (59; 59A) comprising gripping plates (57a;257a) that grips the specimen rack (2, 3) on a first transport path on which the specimen rack (2, 3) is transported by the specimen rack (2, 3) being sandwiched between gripping plates (57a; 257a) from both sides of flanks in the transport direction to transport the specimen rack (2, 3) along the first transport path; and a gripping width controller that controls a distance between the gripping plates (57a; 257a) of the specimen rack gripping mechanism (59; 59A) in accordance with a width of the specimen rack (2, 3), and a rack stopper wherein the transport device transports two types of the specimen racks (2, 3), a first specimen rack holding only one specimen container and a second specimen rack on which a plurality of specimen containers is mounted by the specimen racks (2, 3) being arranged equidistantly in the transport direction, a length of the first specimen rack in the transport direction is formed shorter than the gripping plate (57a; 257a) and the width thereof is formed wider than the second specimen rack, the length of the second specimen rack is substantially equal to the length of the gripping plate (57a; 257a) and the width thereof is formed narrower than the first specimen rack, and the automatic analyzer comprises: a plurality of sensors arranged along the first transport path of the transport device to detect presence/absence of the first specimen rack or the second specimen rack in each arrangement position on the first transport path; and a general management computer that determines whether the specimen rack (2, 3) on the first transport path is the first specimen rack or the second specimen rack based on detection results from the plurality of sensors, a plurality of sensors arranged along the first transport path of the transport device to detect presence/absence of the first specimen rack or the second specimen rack in each arrangement position on the first transport path; and a general management computer that determines whether the specimen rack (2, 3) on the first transport path is the first specimen rack or the second specimen rack based on detection results from the plurality of sensors, characterized in that, depending on the determination result of the general management computer, when the first specimen rack and the second specimen rack are successively stopped by a rack stopper in a gripping position of the specimen rack gripping mechanism (59; 59A) and a plurality of the first specimen racks is successively stopped from the upstream side, the general management computer controls the specimen rack gripping mechanism (59; 59A) to grip the plurality of the first specimen racks that are successively stopped simultaneously and transports them downstream.