If your computer feels slow, it may be time to perform some maintenance. Defragmenting (or "defragmenting") is one of the most commonly recommended tasks in this area, in addition to uninstalling programs, checking your PC's memory, and running a virus scan. That's how it works and what you need to know.
What is Fragmentation
Traditional disks (sometimes referred to as HDDs) use rotating disks to store data in consecutive "blocks" of disks. If you delete some data, the drive will refill these blocks when you write new data. This sometimes results in files being split and stored in two (or more) different sections of the turntable. This means that the head of the drive must navigate to multiple locations to read the file, slowing down the process.
Defragmenting your drive rebuilds these files and consolidates the free space into a block, speeding up reading and writing. A visual representation of this can be found above in the GIF of Wikimedia user XZise.
How to Defragment Your Hard Disk
Here's the good news: Unlike the old Windows XP, where you occasionally had to manually defragment your hard disk, Windows 7, 8 and 10 automatically defragment your computer on a schedule. Therefore, there is a good chance that you do not have to do anything!
However, if you want to check the schedule and make sure it is working properly, click the Start button and type "defrag". Click on Defragment and Optimize Drives, and you'll be greeted with the optimization schedule that lists all the drives in your computer (hard drives and SSDs).
The current status should be displayed next to each drive. If everything is ok, the disks should say "OK (0% fragmented)" and you can see when the drive was last defragmented. By default, it should run once a week. However, if it looks like it has not been run for a long time, you may want to select the drive and click the Optimize button to run it manually.
TRIM Your Solid-State Drive
You should note that everything above only applies to traditional, spinning hard drives applies – not for solid-state drives (SSDs). that are becoming more common. SSDs are much faster than hard drives and have no moving parts, so your computer can read blocks of data from one point in the NAND as fast as another. This means that your computer will not slow down even with countless fragmented files and defragmentation is not required.
SSDs, however, require a different type of maintenance, called TRIM, which clears old data already deleted, which speeds up the writing of files. If you have an SSD, the current status is likely to be just OK, indicating when the TRIM command was last executed. Again, you should not have to intervene, but if it has been running for a long time (or never), you can select the drive and click "Optimize".
Mostly you should not do this. No third-party tools are required to defragment your computer. Previously, they were already used. For Windows 7, 8 and 10, the integrated schedule of Windows should be sufficient. If defragmenting does not speed up your computer as much as you want, you should also perform these other maintenance tasks.