According to one embodiment, a magnetic disk device includes a disk, a head, and a controller setting a rewrite threshold value for executing a rewrite process of different tracks in a first sector group including at least one first sector continuous from a first parity sector in which error correction processing in units of tracks is executable based on the first parity sector and including the first parity sector, and a second sector group including at least one second sector continuous in which the error correction processing in units of tracks is unexecutable, and rewriting the first sector group and the second sector group with different frequencies.