Optimize and Defrag Drives in Windows 11 & 10 (SSD Too)
Windows already optimizes your main drive automatically, on a weekly schedule, without you touching anything — so if you've come here worried you're behind on maintenance, you're probably not. Optimize Drives (the built-in tool, also called Disk Defragmenter in older Windows) reorganizes scattered file pieces on a traditional hard drive, or runs TRIM to keep a solid-state drive fast; Windows already decides which one your drive needs and does it in the background. Running it manually is mainly useful right after a big change to your PC — a large file move, a full drive, or a machine that's been asleep (not fully shut down) for a long stretch — or just to confirm it's working.
If you're new to this kind of thing, or you've been asked to "optimize your drive" by a family member, a repair shop, or a warning message and you're not sure what that even means: this guide is written for you specifically, with nothing assumed. Every button and menu name is explained the first time it comes up, and nothing described below can delete a file, lose a photo, or break your computer — the worst that can happen if you click the wrong thing is that you close a window and try again. If at any point a step doesn't match what you're seeing on your own screen, that's normal — Windows looks slightly different depending on which update you have, and there's always more than one way to reach the same tool.
If you're on this page because your PC feels slow, that's worth knowing too: for most people today, a full drive or a failing drive causes more slowdown than fragmentation ever does, especially if you're on an SSD, which the vast majority of PCs sold since around 2020 are. This guide covers both — how to run Optimize Drives properly, and what to check if it isn't the actual fix for what's bothering you.
Quick Answer
- Step 1 — Click Start, type defrag, open Defragment and Optimize Drives. This works identically on Windows 11 and Windows 10.
- Step 2 — Select your drive, click Analyze, then Optimize if it's needed.
- Windows already runs this weekly on its own — check the Last run column first; if it says recently, you likely don't need to do anything.
The basics: what this tool actually does
Hard drives (HDD) vs. solid-state drives (SSD)
A hard disk drive (HDD) stores data on spinning magnetic platters, physically moving a read/write head to find each piece of a file — the older, cheaper, and slower of the two technologies still in use. A solid-state drive (SSD) has no moving parts; it stores data in flash memory chips and reads any part of the drive in roughly the same time, which is what makes SSDs so much faster.
What fragmentation actually is
Think of a hard drive like a bookshelf, and each of your files like a book. When your drive is new and mostly empty, a whole book fits on one shelf in one piece, so it's quick to find and pull out. Over time, as you save, delete, and resave files, there's less continuous shelf space left — so a new "book" sometimes gets split, with a few chapters on one shelf and the rest scattered across others. To read the whole book, the drive has to visit every shelf and collect the pieces, which takes longer than grabbing one book in one place. Defragmentation is Windows going through and putting each book back together on one shelf, so the next time you open it, it's quick again.
In more technical terms: when you save, delete, and resave files over time, a single file can end up split into pieces scattered across different physical locations on an HDD. The drive then has to move its read head to each piece separately to open the file, which is slower than reading it in one continuous pass.
Why SSDs are treated differently
An SSD doesn't have this physical-distance problem, so traditional defragmentation does nothing useful for it — and repeatedly rewriting data to move it around actually uses up a small amount of the drive's limited write endurance for no benefit. Instead, Windows runs a command called TRIM on SSDs, which tells the drive which blocks of data are no longer in use so it can manage its own internal housekeeping more efficiently. The Optimize Drives tool detects which type of drive you have and automatically does the right one — you'll see "Optimize" listed for SSDs and "Defragment" for HDDs in the same window.
How to open Optimize Drives
The fastest way — works on both Windows 11 and 10
- Click the Start button — that's the Windows logo, usually in the bottom-left corner of your screen — or press the key on your keyboard with the Windows logo on it.
- Just start typing the word
defrag. You don't need to click anywhere first; a search box will open on its own and show results as you type. - You'll see Defragment and Optimize Drives appear as an option — click on it (or tap it, if you're on a touchscreen) to open it.
This is the most reliable method regardless of which Windows version or update you're on, since Settings menu paths shift between versions but this search shortcut hasn't changed. If nothing happens when you type, click once anywhere on your empty desktop first, then try again — sometimes the search box needs your screen to be "active" before it responds to typing.
Through Settings — Windows 11
- Settings → System → Storage.
- Scroll down and click Advanced storage settings.
- Click Drive optimization.
Through Settings — Windows 10
- Settings → System → Storage.
- Scroll down to More Storage Settings and click Optimize Drives.
Through File Explorer — an easy shortcut for one specific drive
File Explorer is the yellow folder icon you use to browse your files and folders — it usually sits on your taskbar at the bottom of the screen, or you can open it by pressing the Windows key and the letter E together.
- Open File Explorer and find This PC in the list on the left. Right-click the drive you want to check (usually the one labeled C: — that's almost always your main drive).
- Click Properties near the bottom of the menu that pops up, then click the Tools tab near the top of the window that opens.
- Under Optimize and defragment drive, click Optimize.
This jumps straight to that specific drive already selected, which is handy if you only want to check one drive rather than browsing the full list.
Through Control Panel, if you prefer the older interface
- Open Control Panel → System and Security.
- Under Administrative Tools (Windows 10) or Windows Tools (Windows 11), click Defragment and optimize your drives.
Analyzing and optimizing your drives
Once the Optimize Drives window is open, you'll see every drive listed with its media type (SSD or HDD), current status, and when it last ran. Nothing on this screen can hurt your computer — Analyze just looks and reports back, and even Optimize only rearranges data that's already there, so there's nothing to be nervous about here:
- Click once on the drive you want to check, so it's highlighted.
- Click Analyze (this button is only available for HDDs — SSDs skip straight to showing their optimization status, since analyzing fragmentation doesn't apply to them).
- If the analysis shows meaningful fragmentation, click Optimize.
- Let it finish — depending on drive size and how fragmented it is, this can take anywhere from a couple of minutes to over an hour on a large, heavily fragmented HDD. You can keep using your PC while it runs, though it'll be a little slower than normal. You don't need to sit and watch it — it's fine to leave it running and come back later.
Setting or changing the automatic schedule
In the Optimize Drives window, click Change settings. Here you can confirm automatic optimization is turned on (it is, by default) and choose how often it runs — Daily, Weekly (the default and the sensible choice for almost everyone), or Monthly. Daily doesn't meaningfully improve performance for typical use and adds a small amount of unnecessary drive activity, so there's rarely a reason to switch to it. You can also choose which drives are included, which matters if you have an external or secondary drive you'd rather manage manually.
Freeing up space alongside optimization
A drive that's nearly full slows down in a way optimization alone won't fix — Windows needs some free space to work efficiently, and both fragmentation and general slowness get worse as a drive fills up. Two built-in tools handle this:
Storage Sense — automatic, ongoing cleanup
- Settings → System → Storage → Storage Sense.
- Turn it on, and review what it's set to clean up — by default it does not touch your Downloads folder or files that are only in the cloud, so check its settings if you want it to be more aggressive.
Disk Cleanup — a one-time deeper sweep
- Type Disk Cleanup into Start and open it.
- Select the drive, click OK, and let it scan.
- Tick the file categories you want removed (temporary files, old Windows update files, Recycle Bin contents are usually safe choices) and click OK.
If optimization won't run or fails
"Optimization not available" or the Optimize button is greyed out
This usually means Windows can't get exclusive enough access to the drive to safely reorganize it. Close any heavy background activity — large downloads, backup software, or virtual machines using that drive — and try again. If it persists on your main system drive specifically, restart your PC first; a clean boot clears most temporary locks.
Drive analysis or optimization keeps failing partway through
Check the drive for underlying errors before trying again: open File Explorer, right-click the drive, go to Properties → Tools, and under Error checking click Check. A drive with developing file-system errors or bad sectors will often fail optimization until those are addressed — and if Check finds problems repeatedly, that's also a signal to back up that drive's data soon rather than later.
It works, but performance doesn't seem to improve
If you're on an SSD, that's expected — TRIM keeps the drive healthy long-term but rarely produces a feels-different speed boost the way defragmenting a badly fragmented HDD does. If you're on an HDD and optimization genuinely isn't helping, the bottleneck is more likely a nearly-full drive, too many startup programs, or the drive itself aging out — an HDD nearing the end of its mechanical life can show exactly these symptoms, and no amount of defragmenting fixes a dying drive.
Common misunderstandings
"I don't need to do anything for my SSD"
You're right that you should never run traditional defragmentation on an SSD — but Windows' automatic TRIM maintenance is still worth leaving on, since it's not the same operation and doesn't wear the drive the way defragmentation would. The "don't touch it" advice applies to manual defragmenting, not to Windows' automatic scheduled optimization.
"This will take forever and slow down my whole day"
For most home PCs today, a scheduled weekly run on a mostly-SSD or lightly-used HDD system finishes in a few minutes, quietly, in the background — you generally won't notice it at all unless you're specifically watching the Optimize Drives window. It only becomes a long process on a large, heavily fragmented HDD that hasn't been optimized in a long time, which is a good reason to leave the automatic schedule on rather than let it build up.
Frequently asked questions
Do I need to run this manually if the automatic schedule is on?
No, in most cases. The automatic weekly schedule is exactly why this tool rarely needs your attention. Manual runs are mainly useful right after unusually heavy drive activity, or just to confirm the schedule is actually working if you're not sure.
Will optimizing my drive delete any files?
No. Optimization only rearranges where existing data physically sits (on an HDD) or performs TRIM housekeeping (on an SSD) — it never deletes your files. Disk Cleanup, a separate tool, is the one that removes files, and only ones you've specifically selected.
How do I know if my drive is an SSD or HDD?
Open the Optimize Drives tool itself — the Media type column tells you directly for each drive listed. You can also check Settings → System → Storage → Advanced storage settings → Disks & volumes.
Is it safe to run this on a laptop running on battery?
Yes, but it's not ideal — optimization uses more disk activity than idle, which draws slightly more power. Windows' automatic schedule is generally set to skip running on battery for this reason, so if you're plugging in occasionally, it'll likely catch up then rather than draining your battery unexpectedly.
My external drive isn't showing up in the list. Why?
Some external and network drives are excluded automatically, particularly ones formatted in a non-Windows file system, or ones Windows doesn't consider safe to optimize while frequently disconnected. If it's a standard external HDD formatted as NTFS and plugged in, it should appear — try reconnecting it and reopening the tool if it doesn't.
Should I use third-party defragmentation software instead?
For the vast majority of people, no — the built-in tool handles both drive types correctly and safely on its own schedule, and that's genuinely enough. Third-party tools mostly add extra scheduling flexibility or reporting detail that typical home users don't need.
Related reading
- Enable automatic maintenance in Windows 10 and 11
Covers the wider scheduled-maintenance system that Optimize Drives runs under. - Clean up system files in Windows 10/11
A deeper cleanup pass for freeing up space beyond what's covered here. - How to find storage capacity of your PC
Useful before deciding whether space or fragmentation is your actual problem.
This post was first published in September 2015 and has been updated to reflect current Windows 11 and 10 menus and the automatic scheduling that now runs by default. If your PC still feels slow after working through this guide, the cause is very likely something other than fragmentation — and that's alright; it just means the next step is elsewhere, not that you did anything wrong here. And if all of this still feels like a lot: it's completely fine to ask a family member, friend, or repair shop to sit with you the first time — this isn't something you need to figure out entirely on your own.