How to Trim an SSD in Windows 11

To trim an SSD in Windows 11, select Search on the taskbar, type defrag, open Defragment and Optimize Drives, select the SSD, and select Optimize. Windows 11 already does this on a weekly schedule, so a manual trim is only needed now and then.

Applies to: Windows 11 (the same tool is in Windows 10). Checked against Microsoft Support and Microsoft Learn on October 7, 2026.

What trimming an SSD means

When you delete a file, Windows marks the space as free, but a solid-state drive (SSD) does not know that on its own. Trim is the message that tells it. Microsoft describes trimming as telling the drive where it can safely do cleanup work when it is not busy saving or loading your files.

Trim is not defragmentation. Microsoft’s explanation is that hard disk drives are defragmented, which means the pieces of each file are lined up so the drive can read them more easily, while SSDs are trimmed. Both jobs are called “optimization” in Windows, and the same tool does both. It picks the right one for each drive.

There are two kinds of trim in Windows, and it helps to know the difference:

  • Delete notifications. Each time a file is deleted, Windows tells the drive which space was freed. Microsoft’s documentation says this is turned on by default for drives formatted with NTFS, the file system that Windows uses for its own drive.
  • Retrim. This sends the trim message again for all the unused space on a drive in one pass. It is what the Optimize button does for an SSD, and what the weekly schedule runs.

Before you start

  • You do not need to back up or close anything to run Optimize. Trim does not delete the files you can see, and it does not change the free space shown for the drive.
  • The command methods further down need an administrator account. Microsoft states that membership in the local Administrators group is the minimum needed to run the defrag command.
  • If you deleted a file by accident and hope to get it back, do not trim the drive first. Trim tells the SSD that the space is no longer needed, and the drive may clear it. Look into recovery before you run any maintenance.

Trim an SSD with Defragment and Optimize Drives

This is the method Microsoft documents for Windows 11, and it is the one most people should use.

  1. Select the Search bar on the taskbar and type defrag. A list of results appears.
  2. Select Defragment and Optimize Drives in the results. A window opens that lists the drives on your PC.
  3. Select the SSD you want to trim. The row is highlighted.
  4. Select Optimize. Windows runs the trim, and the information for that drive updates when it is done.
Illustration of the path to trim an SSD in Windows 11: Search, defrag, Defragment and Optimize Drives, select the SSD, Optimize
Illustration: the path from Search to the Optimize button in Defragment and Optimize Drives.

The window also has an Analyze button. Microsoft’s instructions mention it for hard disk drives, where it checks whether the drive needs to be optimized. For an SSD, you can go straight to Optimize.

Check or change the automatic schedule

Windows optimizes your drives automatically, and Microsoft says the default schedule is weekly. If that schedule is on, you do not need to trim by hand on a regular basis.

  1. Select Search, type defrag, and open Defragment and Optimize Drives.
  2. Under Scheduled optimization, select Change Settings. A small settings window opens.
  3. Choose how often it runs: Daily, Weekly, or Monthly. You can also turn the schedule off here, choose which drives it applies to, and set it to run more often if it misses three scheduled runs in a row.
  4. Confirm the change to save it.

For most PCs, Weekly is the right choice. Microsoft’s defrag documentation notes that the scheduled task does not run while the computer is on battery power, so a laptop that is rarely plugged in may go longer between runs. That is a good reason to select Optimize yourself once in a while.

Trim an SSD with PowerShell

PowerShell can run the same retrim and show more detail while it works. Use this method if you like commands or the window above will not open.

  1. Press the Windows key + X to open the Quick Access menu, and select the Terminal entry marked (Admin). Microsoft’s documentation lists it as Windows Terminal (Admin). Approve the prompt that asks for permission.
  2. Make sure the tab is a PowerShell tab, then type this command and press Enter. Replace C with the letter of your SSD:
    Optimize-Volume -DriveLetter C -ReTrim -Verbose
  3. Wait for the command to finish. The -Verbose part makes PowerShell print what it is doing, so you can see the retrim take place.

Microsoft’s reference for this command says -ReTrim tells the storage that all currently unused space on the volume is no longer needed. If you leave -ReTrim out, Optimize-Volume chooses the job by drive type: a retrim for an SSD that supports trim, and analysis plus defragmentation for a hard disk drive.

Trim an SSD with the defrag command

The defrag command works in Command Prompt or PowerShell, as long as the window was opened as an administrator.

  1. Open the admin Terminal as described above.
  2. Type one of these commands and press Enter, using your own drive letter:
    • defrag C: /L performs a retrim on the drive.
    • defrag C: /O performs the proper optimization for the type of drive, which is the safer choice if you are not sure what kind of drive it is.
  3. Wait for the report. To watch progress, add /U to the end of the command. To stop early, press Ctrl + C.

Do not run the plain defrag C: command on an SSD. Without a switch it performs a traditional defragmentation, which is meant for hard disk drives. Also, the command and the Defragment and Optimize Drives window cannot work at the same time. Microsoft says that if one is running, the other fails.

Check whether trim is turned on

If you want to confirm that Windows is sending delete notifications at all, one command shows the setting.

  1. Open the admin Terminal.
  2. Type fsutil behavior query DisableDeleteNotify and press Enter.
  3. Read the result. It includes a line such as NTFS DisableDeleteNotify = 0.

The name of the setting is the confusing part, because it is worded as “disable.” Use this table to read it:

Result What it means
DisableDeleteNotify = 0 Trim is turned on. This is the normal setting for NTFS.
DisableDeleteNotify = 1 Trim is turned off.
is not currently set Nobody has changed the setting, so Windows uses the default for that file system.

You may also see a line for ReFS, a different file system that most home PCs do not use. If the NTFS line shows 1, turn trim back on with this command:

fsutil behavior set DisableDeleteNotify 0

Microsoft’s documentation says this change does not need a restart. To undo it, run the same command with 1 at the end. Microsoft notes that some devices can perform worse with delete notifications turned on, which is the only reason the off setting exists. Leave it at 0 unless the maker of your drive tells you otherwise.

How to confirm the trim worked

  • In the window: after you select Optimize, the status and last-run information for the drive in Defragment and Optimize Drives updates.
  • In PowerShell: the -Verbose output reports the retrim, and the command returns to the prompt without an error.
  • With defrag: the command prints a report when it finishes and returns to the prompt.

Do not worry if the last-run date in the window is older than a week. Microsoft’s defrag documentation explains that the scheduled task sometimes skips its analysis step for an SSD, and when that happens the last-run time is not updated. It can be up to a month old even when the schedule is working.

You will probably not see a jump in speed. Trim keeps an SSD working the way it should over time. It does not repair a failing drive, and it does not free up space. If your drive is nearly full, check how much drive space is left in Windows 11 and clear some room instead.

Troubleshooting

The SSD is not in the list, or nothing happens when you optimize it

Windows only sends trim to storage that reports that it supports trim. Microsoft’s Optimize-Volume reference lists “no operation” for an SSD without trim support and for drives whose type Windows cannot identify. This can happen with some external enclosures and RAID setups, because another device sits between Windows and the drive. Check with the maker of the drive, enclosure, or PC. Do not format the drive to try to fix this.

A drive cannot be optimized at all

Microsoft lists several kinds of drives that the tool cannot work on: network drives, CD-ROMs, drives that are locked by the file system, drives that Windows has marked as having errors, and drives that are not formatted as NTFS, ReFS, FAT, or FAT32.

The command reports a permission error

The Terminal was not opened as an administrator. Close it, press the Windows key + X, and pick the entry marked (Admin). On a work or school PC, you may not have administrator rights, and your IT department may manage this setting for you.

The command fails while the window is open

Close Defragment and Optimize Drives, or wait for it to finish, and run the command again. The two cannot run at once.

The schedule does not seem to run

Open Change Settings under Scheduled optimization and make sure the schedule is turned on and your SSD is included. On a laptop, plug it in, because the task does not run on battery power.

Frequently asked questions

How often should I trim my SSD?

You usually do not need to do it yourself. Windows 11 optimizes drives weekly by default, and it sends delete notifications as you delete files. Run a manual trim after you delete a very large amount of data, or if the schedule has been off.

Will trimming delete my files?

No. Trim only covers space that Windows already treats as free. Your documents, photos, and apps are not touched. It can make files that you already deleted harder to recover.

Should I defragment an SSD?

No. Use Optimize and let Windows choose. Microsoft’s guidance is that hard disk drives are defragmented and SSDs are trimmed. The same advice applies to older PCs, and our guide on how to defrag and optimize drives in Windows 10 covers that version.

Does trim work on an external SSD?

It depends on whether the drive reports trim support to Windows through its enclosure and cable. If it does, the drive can be optimized like an internal one. If it does not, Windows performs no operation on it.

Do I need a third-party tool to trim an SSD?

No. The built-in Defragment and Optimize Drives tool, PowerShell, and the defrag command all send the same retrim. Software from your SSD’s maker is not needed for trim.

Does trim make my SSD faster?

It helps the drive keep its normal speed as it fills and empties over time. It is maintenance, not a speed boost, so do not expect a visible change after one run.

For the official steps, see Microsoft’s instructions for optimizing drives in Windows, and the Microsoft Learn references for Optimize-Volume, defrag, and fsutil behavior. Next, open Change Settings and confirm that your SSD is on the weekly schedule so you do not have to think about trim again.

Related: how to wipe an SSD in Windows 11.

Get Our Free Newsletter

How-to guides and tech deals

You may opt out at any time.
Read our Privacy Policy