Defragmenting is a disk maintenance process that reorganizes the data on a hard disk to improve its performance. It identifies which files include fragmented data spread around the disk, then moves data around to improve read and write speed. Defragmenting hard disk drives is a common maintenance task, but it is unnecessary on SSDs and other flash drives.

When you save a new file to a hard disk, it breaks that data into small chunks on a disk platter called sectors. If the hard disk is relatively empty, it can easily allocate enough contiguous sectors to store the whole file in one spot. If you modify that file later in a way that takes up more space, and there aren't enough open sectors adjacent to it on the disk platter, the drive saves that data wherever there is room. Over time, files are broken up, or "fragmented," and scattered around all over the disk. Since the disk's read and write heads must move around more to read or write a file, this slows down disk access speeds and increases wear and tear on the disk drive.

Defragment a disk moves data around so that each file is saved to contiguous sectors
Defragment a disk moves data around so that each file is saved to contiguous sectors

A defragmentation utility cleans up a drive in several steps. First, it scans the entire disk to create a map of sectors and tracks which file each sector is associated with. It then rearranges data to reunite fragmented files back into contiguous blocks. If a disk is very fragmented, defragmenting can recover disk space by consolidating data from partially-used sectors. Defragmentation can take a lot of time on large, heavily fragmented disks, so you should regularly defragment your hard drives. Windows and Linux both come with built-in defragmentation utilities that often run automatically. While macOS does not have its own defragmentation utility, it does include other features that minimize file fragmentation.

NOTE: While defragmenting a hard disk drive is considered regular maintenance, defragmenting a solid-state drive is unnecessary and often harmful. SSDs read and write data at the same speed regardless of whether a file is fragmented or not, and attempting to defragment an SSD may instead reduce its lifespan through excessive read and write cycles.

Updated September 14, 2023 by Brian P.

quizTest Your Knowledge

Which statement best describes a protocol?

It is a standard set of rules that defines how devices communicate with each other.
It is a programming language used to create webpages.
It is an algorithm designed to encrypt and decrypt data.
It is a firewall that prevents unauthorized access to systems on a network.
Correct! Incorrect!     View the Protocol definition.
More Quizzes →

The Tech Terms Computer Dictionary

The definition of Defragment on this page is an original definition written by the team. If you would like to reference this page or cite this definition, please use the green citation links above.

The goal of is to explain computer terminology in a way that is easy to understand. We strive for simplicity and accuracy with every definition we publish. If you have feedback about this definition or would like to suggest a new technical term, please contact us.

Sign up for the free TechTerms Newsletter

How often would you like to receive an email?

You can unsubscribe or change your frequency setting at any time using the links available in each email.

Questions? Please contact us.