According to one embodiment, a magnetic disk device includes a disk, a head, and a controller that sets at least a set of a first target position and a second target position to be matched, among a plurality of the first target positions respectively corresponding to a plurality of first tracks in a case where writing on the first tracks is performed to the first region of the disk in a radial direction of the disk under a first recording mode, and a plurality of the second target positions respectively corresponding to a plurality of second tracks in a case where writing on the second tracks is performed to the first region in the radial direction under a second recording mode different from the first recording mode.