How to defrag your drives in Windows 11

Milan Stanojevic
by Milan Stanojevic
Windows & Software Expert
Milan has been enthusiastic about PCs ever since his childhood days, and this led him to take interest in all PC-related technologies. Before joining WindowsReport, he worked as a front-end web developer. Read more
Affiliate Disclosure
  • Windows 11 defrag is a simple process that can improve the performance of your hard drive.
  • Fragmentation is a common problem that can be easily solved by using a simple tool implemented in Windows.
  • If you have an SSD installed on your system, you don't need to defragment it but you can optimize it instead.
windows 11 defrag
To fix various PC problems, we recommend Restoro PC Repair Tool:
This software will repair common computer errors, protect you from file loss, malware, hardware failure and optimize your PC for maximum performance. Fix PC issues and remove viruses now in 3 easy steps:

  1. Download Restoro PC Repair Tool that comes with Patented Technologies (patent available here).
  2. Click Start Scan to find Windows issues that could be causing PC problems.
  3. Click Repair All to fix issues affecting your computer's security and performance
  • Restoro has been downloaded by 0 readers this month.

Defragmentation is one way to improve your performance and make your PC faster, so it’s advised that you perform it regularly.

Fragmentation is a normal process, and it will happen on every hard drive sooner or later and it’s essential to fix it.

There are several ways to defragment your hard drive, and Windows already has a couple of useful tools that can help you with that, but you can also use specialized defrag software.

Defragmentation hasn’t changed much in Windows 11, and it’s almost the same as in Windows 10, so you should feel familiar with it.

If you haven’t used defragmentation before, be sure to keep reading to find out how to perform defrag in your PC and what this procedure really means.

What does defragmentation do?

When working with files on your hard drive, pieces are stored in different sectors, and to access them, the drive needs to rotate to the specific sector so that the head of the hard drive can find it.

However, when moving or deleting the files, the sectors on the hard drive become blank, creating space between data. As a result, the hard drive needs to work more to access that specific data thus causing performance issues.

Defragmentation will reorganize the data and place them in sectors that are close to each other, so the hard drive can access them faster.

Should I defragment my SSD?

Solid-state drives don’t require defragmentation because of two reasons:

SSD has no moving parts

The main benefit of defragmentation is performance improvement. With SSDs being 10 to 20 times faster than the best hard drives and having no mechanical disks that need to be read, there’s no need for defragmentation.

This means that the data is read digitally and it can be picked up from the flash memory in a fraction of the time needed for the hard drive to move the heads.

SSD has a limited amount of write cycles

The second reason is longevity. SSDs last less than hard drives because they have a limited number of write cycles.

This means that moving the files and writing them during the defragmentation process will reduce the lifespan of your SSD by using its write cycles.

How can I defrag my Windows 11 PC?

1. Use the defragmentation tool from Windows

  1. Click the Search icon in Taskbar and type defrag. Select Defragment Optimize Drives from the list of results.
  2. When the window opens, you’ll see a list of all your drives and their current defragmentation status.
  3. Select the drive that you want to analyze, and click the Analyze button. We have a SSD installed so we didn’t actually defragment it. You should perform this procedure only on HDDs.
  4. Wait for the process to finish.
  5. If your drive is fragmented, select it and click on Optimize.
  6. Wait for the process to finish. Keep in mind that the process can take a while depending on the fragmentation level.

As you can see, using Windows 11 defrag is simple, but if you want a specialized tool, we recommend Smart Defrag for more advanced options.

2. Use the command line

  1. Press Windows Key + X and choose Windows Terminal (Admin).
  2. To analyze your drive enter the following command, but be sure to replace X with the letter of your drive:
    defrag X: /a
  3. After the scan is finished, you’ll see information about your hard drive, including the fragmentation level and a note saying whether you need to defragment your drive or not.
  4. Now enter the following command to defrag that drive:
    defrag X:
  5. Wait for the process to finish.

There are also a couple of hidden commands that might come in handy. To defrag all drives that are available on your PC, use the following command:

defrag /C

To defrag all drives except the specified ones, run this command:

defrag /E X:

How can I schedule defragmentation in Windows 11?

  1. Click on Windows Search (the magnifying glass from Taskbar), type defrag and select the Defragment and Optimize Drives app from the results.
  2. In Scheduled optimization click on Change settings.
  3. Set frequency to Weekly or Monthly.
  4. Now click the Choose button.
  5. Check the drives that you want to schedule defragmentation for and click on OK.
  6. Click OK once again to save the changes.

How can I optimize my SSD?

  1. Click on Windows Search from Taskbar, type defrag, then select the Defragment and Optimize Drives app.
  2. Click on the SSD drive to select it and clic on Optimize.

It’s not recommended to defragment your SSD but you can optimize it instead, with no risks. The procedure is called trimming, and you can access it just like on an HDD, by using the steps above.

The trim action identifies areas on the disk with unused data. In other words, the files that were deleted and are waiting to be overwritten.

That is because when you delete a file, it doesn’t get erased from the disk. They are only marked as free, available space. But after the trimming process, the data will be deleted.

It’s an active way of optimizing your SSD but it’s not as near as effective as the defragmentation procedure for an HDD.

Defragmenting your HDD once in a while or according to a schedule will actually prolong the lifetime of a hard drive as opposed to an SSD.

Of course, it also makes it run faster because the system will find the data you request a lot quicker than on a fragmented drive.

However, you should also think about upgrading your PC with an SSD because then you won’t need any fragmentation at all, and the read/write speeds are clearly superior to an HDD.

Take a look at our list including the best SSD for your PC and consider the proper option for your system. Even more, you could also consider using a laptop with both SSD and HDD for increased performance and storage.

How often do you defrag your drive for performance improvements? Let us know in the comments below.

This article covers:Topics: