You Can Defrag Your Hard Drive In Windows 11. Here's How

Imagine the following: you create a word document and save it. The document is split into tiny bits and accessed as such. At first, the bits are stored next to each other — the file is saved in a single neighboring space on the disk. Later on, you reaccess the file, make changes, and save it again. This time, either the file is too big to store in a contiguous space or there's no space because free storage has been overwritten. The bits (after they've been split) spread out to different areas on the disk wherever storage is available.

The computer has to read bits from many different clusters on the drive where the fragments moved, so it takes longer to read and open that file. The more often it's edited and updated, the more fragmented the document becomes. When fragmentation happens to every file on the computer, the performance takes a hit. Disk defragmentation solves the issue. The feature is designed to shuffle around the bits scattered across the drive and bring them together. The files, once sorted, end up in continuous blocks again. In the process, defragging also speeds up your computer since it takes less time to search for and read a given file. Windows 11 comes with a user-friendly defragging tool to do just that.

Getting ready to defrag a hard drive on Windows 11

Before we lay out the simple steps to a smoother, faster hard drive, take note of the following caveat. Only consider defragging a drive if it's a standard hard disk drive (HDD), which has moving parts that physically jump around the disk to read it. In comparison, modern solid-state drives (SSDs) don't have moving components; reading and writing data is instant, and defragging does nothing to improve their performance.

In fact, defragging an SSD can worsen performance. Solid-state drives have a limited lifespan, and defragging wears them out by needlessly chipping away at the limited number of lifetime write cycles. With that said, Windows offers a way to speed up solid-state drives that shouldn't be defragged called TRIM; it is featured in the Windows defragging tool and optimizes solid-state drives without wearing them out. 

Secondly, your Windows 11 machine has likely been quietly defragging your drives in the background. You can set it to automatically defrag drives as needed if the option isn't already enabled. Lastly, if you're on a laptop, make sure it's plugged in or has plenty of charge. Defragging can take some time, depending on how long it has been since the last optimization.

How to defrag a hard drive on Windows 11

The defragging tool in Windows is called "Defragment and Optimize Drives". It not only lets you optimize all your drives but also shows you their level of fragmentation. To start, log into Windows 11 with an account that has administrator privileges, then follow these steps:

  1. Search "defragment" in the Start menu.
  2. Click Defragment and Optimize Drives. The tool opens with a short description of what it can do, along with a list of all available drives.
  3. Select one of your drives.
  4. Click "Analyze disk."
  5. Grant permissions and enter the Administrator password if requested.
  6. Windows will estimate the current fragmentation status in percentage.
  7. Click Optimize if needed.

It can take a few minutes to a few hours to defrag the HDD based on the size of the drive and its current fragmentation status. The defragging automation works through the Task Scheduler. As Microsoft details it, to schedule the optimization process or confirm the already set schedule:

  1. Click Change Settings at the bottom of the Optimize Drives tool.
  2. Select Run on a schedule.
  3. Pick your preferred frequency from the drop-down menu — daily, weekly, or monthly. Read our guide on how often you need to defrag.
  4. Check "Increase task priority, if three consecutive scheduled runs are missed."
  5. Next to Drive, click the Choose button.
  6. Enable select all.
  7. Check "Automatically optimize new drives."
  8. Click OK.

You can set and forget when it comes to defragging on Windows 11; the OS will quietly handle it in the background for you. But if you ever open the tool again, you'll notice it also displays when the last defragging routine was run.