How to Defragment Your Hard Drive in Windows 10
Over time, files on your hard drive get fragmented, and your desktop or laptop slows down because it has to check multiple places on your drive for those pieces. To have your computer run more efficiently, use the built-in tool in Windows to defragment those files. Here's how and when you should do it.
Windows 10, like Windows 8 and Windows 7 before it, automatically defragments files for you on a schedule (by default, once a week). However, it doesn't always run consistently, so if you notice files are taking longer to load or you just want to double-check every month or so, you can see how fragmented the drive is in Windows.
A note about Solid State Drives (SSD): SSDs work differently than traditional mechanical hard drives. Conventional wisdom is that SSDs don't need to be defragmented and doing so can also wear down the drive. However, Windows does defragment SSDs once a month if necessary and if you have System Restore enabled. This isn't something to worry about, though, because the automatic defragmentation is meant to extend your drive's life and performance.
So with SSDs, just let Windows do its thing and don't worry about defragmentation. You can use the Optimize Drive tool below to do a general optimization of the drive, including sending the TRIM command to optimize performance. This doesn't do a traditional defrag on the SSD, though. For your mechanical drives, here's how to defragment your drive in Windows 10.
How to Defrag Your Hard Drive in Windows 10
1. Open the disk optimization tool by searching for "optimize" or "defrag" in the taskbar.
2. Select your hard drive and click Analyze. Note that if you have a SSD, this option is grayed out and not available.
3. Check the percentage of fragmented files in the results.
There's no hard and fast rule about how fragmented your drive should be before you defrag it. You might want to keep your fragmentation percentage under 5% or so, however, so that the defragmentation process doesn’t take too long to finish.
4. If you want to defragment your drive, click Optimize. It's best to do this when you don't need to use your computer for anything else, so you can let Windows defragment the drive efficiently.
When Windows is done, your drive should say 0% fragmented in the Optimize Drives utility.