Having computer problems? Here is how to defragment a hard drive in Windows 7, 8, and 10 so you can get your PC back in working order.

If your computer's feeling slow, it might be time to do a little maintenance. Defragmenting (or "defragging") is one of the most commonly recommended tasks in this area, alongside uninstalling programs, checking your PC's memory, and running a virus scan. Here's how it works, and what you need to know.

What Is Fragmentation?


https://assets.pcmag.com/media/image...800&height=640

Traditional hard drives (sometimes known as HDDs) use spinning platters to store data in sequential "blocks" across each platter. If you delete some data, the drive will go back and fill those blocks when you write new data—sometimes leading to files getting split apart and stored on two (or more) different sections of the platter. That means the drive's head has to navigate to multiple places in order to read the file, thus slowing things down.

Defragmenting your drive reassembles those files and combines your free space back into one block, making reading and writing faster. You can see a visual representation of this in the GIF above, from Wikimedia user XZise.

How to Defragment Your Hard Drive

https://assets.pcmag.com/media/image...800&height=450

Here's the good news: unlike the old days of Windows XP, which required you to manually defrag your hard drive once in a while, Windows 7, 8, and 10 defrags your computer automatically on a schedule. So there's a good chance you don't actually have to do anything!

However, if you want to check the schedule and make sure it's running properly, hit the Start button and type in "defrag." Click the "Defragment and Optimize Drives" option, and you'll be greeted with the optimization schedule, which lists all the drives in your computer—HDDs and SSDs alike.

Next to each drive, you should see its Current Status. If everything's running okay, your HDDs should read "OK (0% fragmented)," and you can see when the drive was last defragged. By default, it should run once a week, but if it looks like it hasn't run in a while, 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—not solid-state drives (SSDs), which are becoming more and more common. SSDs are much faster than hard drives, and don't have any moving parts, so your computer can read blocks of data just as fast from one spot on the NAND as from another. That means even if you have tons of fragmented files, your computer won't slow down—and defragmentation isn't necessary.

That being said, SSDs do require another type of maintenance called TRIM, which erases old data you've already deleted, making file writes faster. If you have an SSD, the current status will probably just say "OK" with a note about when the TRIM command was last run. Again, you shouldn't need to intervene here, but if it hasn't been run in a long time (or ever), you can select the drive and click "Optimize."

Most of the time, you shouldn't need third-party tools to defragment your computer—they had their uses back in the day, but for Windows 7, 8, and 10, Windows' built-in schedule should be enough. If defragging doesn't speed your computer up as much as you'd like, check out these other maintenance tasks as well.