Diskflag / Guides / What's safe to delete on Windows 11
What's safe to delete on Windows 11
You can safely clear temp files, the Recycle Bin, Windows Update leftovers (through Disk Cleanup), browser and app caches, developer package caches, Windows.old if you won't roll back, and Downloads installers you've checked; shrink hiberfil.sys, pagefile.sys, restore points and WinSxS only through Windows settings or DISM; and never delete System32, WinSxS, Program Files folders, your user profile or ProgramData by hand.
Windows 11 keeps a lot of space in places that look deletable but aren't. On my own 1 TB C drive the biggest items were a 65 GB page file, a 12.8 GB hibernation file, a 20 GB npm cache and 102 GB of restore points hidden from apps. Each one had a different safe way to shrink it.
This page gives a verdict for each location. For the order to work in, follow the step-by-step C drive guide.
Which Windows files and folders are safe to delete?
The table uses three verdicts.
- Yes: Windows or the app rebuilds it. Deleting it costs you nothing but a slower first run.
- Only through Windows: the file is in use or tied to a feature. Change the setting or run the command named in the table. Don't delete it in File Explorer.
- No: deleting it by hand can break Windows or an app, or destroy your data.
| Location or file | What it is | Safe to delete? | How to remove it |
|---|---|---|---|
%TEMP% and C:\Windows\Temp | Scratch files that apps and Windows leave behind. | Yes | Settings > System > Storage > Temporary files, or delete the contents. Files in use are skipped. |
| Recycle Bin | Deleted files held until you empty it. | Yes | Right-click the Recycle Bin and choose Empty Recycle Bin. Check it first. |
C:\Windows\SoftwareDistribution\Download | Windows Update download cache. | Yes | Disk Cleanup > Clean up system files > Windows Update Cleanup. |
Windows.old | Your previous Windows installation, kept for rollback. | Yes, if you won't roll back | Disk Cleanup > Clean up system files > Previous Windows installation(s). |
hiberfil.sys | Hibernation file. Stores memory when the PC hibernates. | Only through Windows | powercfg /h off in an administrator terminal. See below. |
pagefile.sys | Page file. Windows uses it as virtual memory. | Only through Windows | System Properties > Advanced > Performance Settings > Advanced > Virtual memory. |
swapfile.sys | Small swap file used by Windows apps. Managed with the page file. | Only through Windows | Leave it alone. Windows manages it through the same virtual memory settings. |
System Volume Information (restore points) | System Restore data. Hidden from most apps. | Only through Windows | System Protection > select drive C > Configure. Lower the limit or delete old restore points. |
C:\Windows\WinSxS | The component store. Windows uses it for updates and repairs. | Only through Windows | DISM /Online /Cleanup-Image /StartComponentCleanup as administrator, or Disk Cleanup > Windows Update Cleanup. |
C:\Windows\Installer | Cached installer files Windows needs to repair, update and uninstall apps. | No | Never delete by hand. Uninstall apps from Settings > Apps. |
Crash dumps: MEMORY.DMP, Minidump, LiveKernelReports | Diagnostic data written after a crash. | Yes | Disk Cleanup > Clean up system files > System error memory dump files. |
| Delivery Optimization files | Cached Windows Update pieces that Windows can share with other PCs. | Yes | Disk Cleanup > Clean up system files > Delivery Optimization Files. |
| Browser caches (Chrome, Edge, Firefox) | Saved copies of site images and scripts. | Yes | In the browser, Clear browsing data > Cached images and files. Leave cookies unticked to stay signed in. |
| NVIDIA and DirectX shader caches | Compiled graphics shaders that games and drivers reuse. | Yes | Disk Cleanup > DirectX Shader Cache. Games rebuild it on the next launch. |
| npm, pnpm, Yarn, pip and NuGet caches | Downloaded packages kept for faster installs. | Yes | The cache commands below. They download again when needed. |
node_modules in old projects | Installed dependencies for a project. | Yes | Delete the folder. Run the install command to recreate it. |
Docker and WSL .vhdx files | Virtual disks that hold your containers, images and Linux distros. | No | Never delete the file. Run docker system prune, then compact the disk. Steps are in the C drive guide. |
Downloads | Your downloaded files and installers. | Yes, after you check it | Open it, sort by size and delete installers you no longer need. |
AppData\Local | Per-user app data. Holds caches, Temp and some large app folders. | No | Don't delete the folder. Clear the cache and Temp folders inside it. |
AppData\Roaming | App settings, sign-ins and saved data. | No | Don't delete it. Uninstall the app, or use its own clear-cache option. |
C:\ProgramData | Settings and data shared by installed apps. Hidden by default. | No | Don't delete it. Uninstall the app that owns the data. |
C:\Program Files and Program Files (x86) | Installed apps. | No | Uninstall from Settings > Apps. Deleting the folder leaves a broken app behind. |
C:\Windows\System32 | Core Windows files. | No | Never. Deleting anything here can stop Windows from starting. |
Sizes vary by PC. Windows.old is often 20 GB or more, but treat that as typical, not measured. Check your own drive before you decide what's worth clearing.
Can I delete hiberfil.sys?
Not by hand, but you can have Windows remove it. Open Terminal as administrator and run powercfg /h off. The file disappears and so do Hibernate and Fast Startup.
To keep Fast Startup and shrink the file, run powercfg /h /type reduced. Reduced mode drops full hibernation. Mine was 12.8 GB. Run powercfg /h on to turn it back on.
Can I delete pagefile.sys?
Not directly, and you shouldn't turn it off completely. The page file is virtual memory. Windows uses it when RAM runs short, and some apps expect it to exist.
To shrink or move it, open System Properties > Advanced > Performance Settings > Advanced > Virtual memory. Untick automatic management, set a custom size or choose another drive, then restart. Mine was 65 GB.
Can I delete Windows.old?
Yes, if you don't plan to go back to the earlier version of Windows. It holds your previous installation so you can roll back after an upgrade.
Open Disk Cleanup, click Clean up system files and tick Previous Windows installation(s). You can find the same item under Settings > System > Storage > Temporary files. Deleting the folder in File Explorer usually fails with permission errors, so use these tools instead.
Is it safe to delete temp files?
Yes. Both %TEMP% (your user's Temp folder) and C:\Windows\Temp are scratch space. Apps recreate what they need.
Close your apps first. Files still in use are skipped, which is fine. The easiest route is Settings > System > Storage > Temporary files. On my drive, four stray 1 GB .tmp files sat at the drive root. Those are worth checking for too.
Can I delete the WinSxS folder?
No. WinSxS is the component store that Windows uses to install updates, repair itself and roll back. Deleting files from it can leave Windows unable to update or boot.
It also looks bigger than it is, because many of its files are hard links shared with other Windows folders. To shrink it, run DISM /Online /Cleanup-Image /StartComponentCleanup as administrator, or use Disk Cleanup's Windows Update Cleanup.
Why is my AppData folder so big?
AppData holds per-user app data. AppData\Local is where caches, Temp and large app folders pile up. Browsers, Discord, Slack, VS Code, NVIDIA shader caches and package managers all store data there. Docker and WSL disks can sit there too.
Don't delete AppData or its Roaming folder, because they hold settings and sign-ins. Find the biggest subfolders, then clear only the caches inside them. On my drive that included Chrome's 4 GB built-in AI model.
How do I clear the npm cache?
Run npm cache clean --force. The cache sits in %LocalAppData%\npm-cache and downloads again when needed. Mine was 20 GB. Other package managers have their own commands:
| Tool | Command |
|---|---|
| npm | npm cache clean --force |
| pnpm | pnpm store prune |
| Yarn | yarn cache clean |
| pip | pip cache purge |
| uv | uv cache clean |
| NuGet | dotnet nuget locals all --clear |
| Go | go clean -modcache |
How do I find what's large before I delete anything?
Start with Settings > System > Storage. It shows usage by category and lists cleanup recommendations. It stops at categories, so it won't tell you which folder is the problem.
A disk space analyzer shows every folder by size. Diskflag maps your whole drive as a treemap and marks safe items in pink, items worth reviewing with pink stripes, and items Windows manages with a dashed outline. Free tools such as WinDirStat and WizTree show sizes without those markings. See the best disk space analyzers for Windows or WinDirStat alternatives to compare.
Diskflag only moves items to the Recycle Bin, and only after you confirm. It refuses Windows system folders, Program Files, the drive root and your main profile folders.
See the verdicts on your own drive.Diskflag is a disk space analyzer for Windows 10 and 11. It maps your whole drive, flags what's safe to clear in pink, and only ever moves things to the Recycle Bin. $8, once.
See how it worksQuestions
What can I safely delete to free up space on my C drive?
Temp files, the Recycle Bin, Windows Update leftovers cleared through Disk Cleanup, browser and app caches, developer package caches and Windows.old if you will not roll back. Check Downloads before you delete installers from it.
Will deleting Windows.old break Windows?
No. Windows.old only holds the previous version of Windows. Removing it with Disk Cleanup means you can no longer roll back to that version, but the current install is not affected.
What happens if I turn off hibernation?
Windows deletes hiberfil.sys and removes the Hibernate option. It also turns off Fast Startup. Run powercfg /h on in an administrator terminal to bring it back.
Can I move pagefile.sys to another drive?
Yes. In the Virtual memory dialog, set a custom size for another drive and remove it from C. Windows recreates the file there after a restart. Do not turn the page file off completely.
Can I delete C:\Windows\Installer?
No. It holds installer files that Windows needs to repair, update or uninstall apps. Uninstall apps from Settings and Windows tidies up for you.
Is it safe to delete crash dump files like MEMORY.DMP?
Yes. They only matter for diagnosing a crash. Use Disk Cleanup and tick System error memory dump files, or delete MEMORY.DMP and the Minidump folder contents from an administrator session.
Is it safe to delete Delivery Optimization files?
Yes. They are cached Windows Update pieces that Windows can download again. Clear them with Disk Cleanup under Clean up system files, or from Settings, System, Storage, Temporary files.
Will clearing the browser cache sign me out?
Not if you only tick cached images and files. Cookies hold your sign-ins, so leave cookies unticked. Pages load a little slower the first time while the cache refills.
Is it safe to delete node_modules?
Yes, for projects you no longer work on. Run npm install (or your package manager's install command) in the project to recreate the folder. Keep the lock file and the source code.
Can I delete System Volume Information?
No. Windows locks it and uses it for System Restore. To free the space, open System Protection, select drive C, click Configure and lower the maximum usage or delete old restore points.