The present disclosure provides a magnetic disk device capable of improving write performance. According to an embodiment, the magnetic disk device includes a magnetic disk, a head that writes data to a track of the magnetic disk, and a controller that performs positioning of the head, registers an address of a sector to which the data is written and a positioning error of the head at the address, judges whether or not a positioning error of a second sector that is two tracks ahead of a first sector to which the data is to be written is registered, sets a first threshold value that allows a write operation with respect to the positioning error of the first sector based on the positioning error of the second sector in a case where the positioning error of the second sector is registered, judges whether or not the positioning error of the first sector exceeds the first threshold value, and stops the write operation in a case where the positioning error of the first sector exceeds the first threshold value.