The invention provides a magnetic disk device with high performance. A magnetic disk device includes a magnetic disk, a magnetic head, and a controller. The magnetic disk includes a plurality of tracks, and the controller calculates a first threshold associated with each of a plurality of first positions in a circumferential direction, for each of the first positions, on the basis of the quality of each of one or more second positions corresponding to each of the first positions among a plurality of second positions in the circumferential direction. During a writing operation on the first track, the controller calculates a first amount. The first amount is an amount obtained by accumulating an amount in which a squeezing amount, which is an amount in which the width of the second track is narrowed from a design value by the writing operation, exceeds a first threshold value, over all second positions included in a range adjacent to a portion in the circumferential direction in which writing has been completed by the writing operation among the plurality of second positions, and the first amount is compared with the second threshold value. On the basis of the comparison result of the first amount and the second threshold value, the controller executes the interruption of the write operation and the protection operation for protecting the data of the second track.