|

How To Defragment And Optimize Drives In Windows 11 (2026)

Windows 11 already defragments and optimizes your drives on a schedule, so most people never need to run it by hand.

To check or run it yourself, type defrag in the taskbar search and open Defragment and Optimize Drives.

This guide covers the steps, the schedule, how hard drives and SSDs are treated differently, and the defrag command.

Quick answer: open Optimize Drives

QuestionAnswer from Microsoft
Where is it?Taskbar search > type defrag > Defragment and Optimize Drives
Do I need to run it?Usually no, because Windows optimizes data drives automatically
How often does it run?Once a week by default
Hard drive (HDD)Analyze to check it, Optimize to run it now
SSDWindows trims it instead of defragmenting it

These points come from Microsoft’s support page on defragmenting and optimizing your data drives.

Open Defragment and Optimize Drives

  1. Select the search box on the taskbar.
  2. Type defrag.
  3. Choose Defragment and Optimize Drives from the results.

The tool lists your drives, and you select the one you want to work with.

Microsoft says this tool is for reviewing a drive’s status or changing the schedule, because Windows handles the work on its own.

Analyze or optimize a hard drive

  1. Open Defragment and Optimize Drives.
  2. Select the hard disk drive (HDD) in the list.
  3. Select Analyze to check whether it needs optimization.
  4. Select Optimize to run it now.

Microsoft’s page describes the Analyze and Optimize buttons for hard drives only.

If you have an SSD, the page does not give you a button to defragment it,.

What optimization does on an HDD and an SSD

DriveWhat optimization meansSource detail
Hard disk drive (HDD)Defragmentation: files are lined up together so the drive reads them more easilyMicrosoft support page
Solid state drive (SSD)Trimming: the drive is told when it can safely do cleanup work while idleMicrosoft support page

Microsoft calls both kinds of work “optimization”, which is why one tool covers both.

If you are not sure which kind of drive you have, our guide to checking SSD or hard drive health shows where Windows lists the disk type.

Change the optimization schedule

  1. Open Defragment and Optimize Drives.
  2. Under Scheduled optimization, select Change settings.
  3. Select the drive you want to change.
  4. Choose daily, weekly or monthly, or turn the schedule off for that drive.

The default is once a week.

Microsoft also says you can have the schedule run more often if a drive misses its optimization three times in a row.

How the schedule treats an SSD

The defrag command reference on Microsoft Learn gives extra detail about SSDs in the scheduled task.

SituationWhat happens
Normal scheduled run on an SSDTraditional optimization and retrim run once a month, even if the task is set to weekly
You manually defragment an SSDThe next scheduled run analyzes and retrims it but skips traditional defragmentation
Both are skippedAnalysis does not run, so Last run in Optimize Drives can be up to a month old

That last row explains why an SSD can show an old Last run date without anything being wrong.

Why the scheduled run may not finish a drive

Microsoft Learn says the maintenance task may not defragment every volume in three situations.

  • The computer is asleep and the task does not wake it.
  • The computer is running on battery power.
  • The computer resumed from idle.

A laptop that runs on battery most of the time can therefore skip optimization.

Keeping it plugged in and awake when the schedule runs gives Windows the chance to finish.

Run defrag from the command line

Open Terminal or Command Prompt as an administrator, because Microsoft says the command needs administrator rights.

defrag c: /u /v

That example from Microsoft defragments drive C and prints progress and verbose fragmentation statistics.

ParameterWhat it does
/aAnalyzes the volume
/oDoes the proper optimization for each media type
/lRetrims the volume
/uPrints the progress on screen
/vPrints verbose output with fragmentation statistics
/cRuns on all volumes
/hRuns at normal priority, instead of the default low priority
/mRuns on each volume in parallel in the background

Microsoft’s example defrag /c /h /v runs on all volumes at normal priority with verbose output.

Press Ctrl+C to interrupt a running command.

What defrag cannot work on

  • Volumes locked by the file system.
  • Dirty volumes, which need a chkdsk run first.
  • Network drives.
  • CD-ROMs.
  • File systems other than NTFS, ReFS, FAT or FAT32.

If a drive is marked dirty, run error checking first with our guide to checking and repairing drive errors.

Free space needed for a full defrag

Microsoft says a volume needs at least 15% free space for a complete defragmentation.

With less than that, defrag only partly defragments the volume.

Free up room by deleting files you do not need or moving them to another disk, as covered in our guide to freeing up disk space.

If your PC is slow

Windows already optimizes your drives weekly by default, so running it again is unlikely to be the fix for a slow PC.

Check what is using the processor, memory and disk first with the steps in our slow PC guide.

Sources

Leave a Reply

Your email address will not be published. Required fields are marked *