The longer you use your computer, the more likely it is to become slower over time, especially as you pile up more files on your drives. Filling up your hard drive can significantly downgrade performance, and one good way to help address that problem is to optimize or defragment that drive. In this article, we’ll show you how to defragment a drive on your Windows 11 PC.
What is defragmenting?
Defragmenting means that Windows will search for files split across different parts of the physical drive and put the bits in the same area, making it easier for the computer to read them sequentially. This can make a big difference on a hard disk drive (HDD) as the spinning platters take longer to locate the different parts of a file if they’re scattered throughout the drive.
However, you probably won’t see many mentions of defragmenting these days. That’s because most PCs today come with a solid-state drive (SSD) or eMMC storage, which works very differently in how files are accessed. Accessing different parts of the drive doesn’t take any longer now, and defragmenting can actually be detrimental to the lifespan of an SSD since it uses up more write cycles, which are limited on this kind of drive. This used to be a bigger problem with earlier SSDs that had particularly short lifespans, but even today, there’s no benefit to defragmenting an SSD.
Instead, Windows 11 optimizes SSD drives by doing something called trimming. This marks unused parts of the drive as being ready for use, making it faster to write new data to that segment when needed.
How to defragment and optimize your drive
The easiest way to defragment or optimize your drive is to use the built-in disk optimization tool in Windows 11. This tool automatically defragments or optimizes your drive depending on whether you have an SSD or HDD. It’s the best way to do it since it avoids wearing out an SSD with defragmentation.
- Open the Start menu and type Defragment. The first result should be Defragment and Optimize Drives. Select it.
- Select the drive you want to optimize or defragment.
- Click Analyze to check if the drive needs optimizing or defragmenting.
- If it does, click Optimize.
- The process may take a while. If you’re defragmenting an external drive, make sure it stays plugged in until the process is done.
How to schedule drive optimization
That’s all you need to do to defragment your drive once. However, you can also schedule the optimization to run regularly. The default sets a weekly defragmentation schedule for internal drives on your PC. If you want to change that, follow these steps.
- Open the Defragment and Optimize Drives window again.
- Click Change Settings under Schedule optimization.
- Enable the Run on a schedule (recommended) checkbox if it isn’t already.
- You can change the frequency of the optimization to Daily, Weekly, or Monthly.
- Click Choose to select the drives you want to be part of the scheduled optimization.
- You can choose the drives you’d like to optimize and whether you want new drives to be optimized automatically.
- Click OK and then OK again to save your settings.
And that’s about all you need to do to defragment your drive on a schedule. This is definitely the easiest way to go about it, but there are other methods.
Defragment your drive using Command Prompt
If you’d rather use the Command Prompt to run your disk defragmentation, you can do it that way, too. However, note that this method will still defragment your drive if it’s an SSD, which you don’t want.
- Search for cmd in the Start menu and select Run as administrator under Command Prompt.
- Type Defrag [Drive letter], replacing [Drive Letter] with the letter assigned to the drive you want to defragment. For your OS drive, it should be C:, so the command would be Defrag C:
- Wait for the process to finish, which may take a while.
If you’d like to optimize an SSD by trimming it, you have to use a specific command. Open Command Prompt as explained above, and then enter the command Defrag [Drive letter] /L. The /L argument specifies that you want to retrim the drive, which makes more sense for an SSD.
There are a lot of additional arguments you can use for the Defrag command for different kinds of optimizations and tasks. Adding the /A argument lets you analyze a drive to see if it needs optimization, while the /B argument lets you optimize the boot performance, for example.
That’s about all you need to know to defragment your drive on Windows 11. This can help improve the performance of your amazing PC, especially if you’ve been using it for a long time. However, Windows 11 already optimizes your drives by default, so you shouldn’t need to follow these steps too often.
If you’d like to learn more about other ways to save space or improve performance on your PC, you can also check out how to clear cache and temporary files on your PC. You can also read about how to clear the DNS cache of your PC, which can help with some internet connection issues.