Where Windows 11 stores temporary files and why they pile up
Windows 11 creates temporary files constantly — when you install programs, run updates, browse the web, or edit documents. These files sit in folders like C:\Users\[Your Username]\AppData\Local\Temp and C:\Windows\Temp, and they accumulate because Windows doesn't always clean them up automatically. Over weeks or months, these folders can hold gigabytes of data that serves no purpose once the task that created it is done.
Temporary files exist because programs need a place to work on data without cluttering your main folders. A video editor might create dozens of temporary clips while you're working. A Windows update might extract files to a temp folder before installing. Once the work is done, these files should disappear — but often they don't, especially if a program crashes or an update fails partway through.
Deleting old temporary files won't break anything. Windows and your programs will create new ones as needed. The main reason to delete them is to free up disk space, which can improve performance if your drive is nearly full.
Key Takeaways
- The Temp folder in AppData\Local and the Windows\Temp folder hold most temporary files, and both are safe to empty.
- Storage Sense, built into Windows 11 Settings, can delete temp files automatically on a schedule you choose.
- Disk Cleanup is an older tool that still works and shows you exactly what it will delete before you confirm.
- Close all open programs before deleting temp files, because Windows may not be able to remove files that are currently in use.
- If you cannot delete a file, restart your computer and try again — some temp files lock until the next startup.
Using Storage Sense to delete temp files automatically
Storage Sense is the easiest method because it runs on its own schedule and requires almost no setup. Open Settings, go to System, then Storage. Toggle Storage Sense on if it is not already enabled.
Once Storage Sense is on, click Cleanup recommendations or scroll down to Automatic cleanup. You will see options to delete temporary files, recycle bin contents, and downloads that have not been opened in a certain number of days. Set the frequency — Every day, Weekly, or Monthly — and Windows will run cleanup on that schedule without you having to do anything.
If you want to delete temp files right now instead of waiting for the schedule, go back to Storage and click Temporary files under the cleanup recommendations section. Windows will show you how much space these files use and give you a button to delete them when ready.
Manually deleting the Temp folder through File Explorer
If you prefer to see exactly what you are deleting, you can open the Temp folder directly. Press Windows key + R to open the Run dialog, type %temp%, and press Enter. This opens your user Temp folder at C:\Users\[Your Username]\AppData\Local\Temp.
Select all files and folders inside (press Ctrl + A), then press Delete. Windows may tell you that some files are in use and cannot be deleted — this is normal. Click Skip for those files and delete the rest. The files that are in use will be deleted the next time you restart your computer.
You can also delete the Windows system Temp folder, but this requires administrator permission. Press Windows key + R, type C:\Windows\Temp, and press Enter. Select all and delete the same way. If you get permission errors, restart your computer and try again — some system temp files cannot be deleted while Windows is running.
Using Disk Cleanup for a guided approach
Disk Cleanup is an older Windows tool that walks you through what it will delete before you confirm. Press Windows key + R, type cleanmgr, and press Enter. Windows will scan your drive and show you a list of file types it can delete, including temporary files, recycle bin contents, and old Windows updates.
Check the boxes next to the items you want to remove. Temporary files are usually labeled Temporary files or Temp files. You can also check Temporary Internet Files if you want to clear your browser cache. Click OK and then Delete Files to confirm.
Disk Cleanup shows you the total space that will be freed before you commit to anything, which makes it useful if you want to know exactly how much room you will gain. It is slower than Storage Sense but gives you more control over what gets deleted.
What to do if you cannot delete a file
If Windows says a file is in use and will not delete, close all open programs and try again. Some temporary files stay locked as long as the program that created them is running. If closing the program does not work, restart your computer — this releases all file locks and usually allows deletion on the next startup.
If a file still will not delete after a restart, it may be a system file that Windows needs. Leave it alone. Deleting a few stubborn temp files will not noticeably affect your disk space, and forcing deletion of a locked system file can cause problems. Storage Sense and Disk Cleanup are designed to skip files they cannot safely remove, so if they skip something, it is probably important.
How much space you can expect to free up
The amount of space temporary files use varies widely depending on what you do with your computer. A user who mostly browses the web and checks email might have 100 megabytes to 500 megabytes of temp files. Someone who edits video, installs programs frequently, or runs large updates might accumulate several gigabytes. If your drive is nearly full, deleting temp files can make a real difference in performance.
You can see how much space temp files are using before you delete them. In Storage Sense, click Temporary files and Windows will show the total size. In Disk Cleanup, the scan results show the space each category uses. If the number is small — under a gigabyte — deleting temp files alone probably will not solve a storage problem, and you may need to look at larger files like old backups or video files.
Preventing temp files from piling up in the future
The best way to avoid a buildup of temporary files is to turn on Storage Sense and set it to run weekly or monthly. This way, old temp files are deleted automatically and you never have to think about it. Storage Sense also cleans up other things like old recycle bin contents and downloads you have not opened in a while, so it handles multiple cleanup tasks at once.
If you prefer manual control, set a reminder to run Disk Cleanup once a month. This takes only a few minutes and keeps temp files from accumulating to the point where they affect your drive space or performance. Either approach is fine — the goal is to delete temp files regularly rather than waiting until your drive is full.
Frequently Asked Questions
Will deleting temp files break Windows or my programs?
No. Temporary files are meant to be deleted once they are no longer needed. Windows and your programs will create new ones as required. The only exception is if you delete a temp file that is currently in use by a running program, which is why you should close all programs before deleting.
Can I delete files in the Windows\Temp folder?
Yes, but you need administrator permission. Right-click the folder, select Properties, go to the Security tab, and check that your account has full control. If you still cannot delete files, restart your computer first — some system temp files lock until the next startup.
What is the difference between Storage Sense and Disk Cleanup?
Storage Sense runs automatically on a schedule you set and requires no action from you. Disk Cleanup is a manual tool that shows you exactly what will be deleted before you confirm. Both are safe; Storage Sense is more convenient, and Disk Cleanup gives you more control.
Should I delete temporary internet files?
Yes, if you want to free up space. Temporary internet files are cached web pages and images that your browser stores to load websites faster. Deleting them frees space but means websites will load slightly slower the first time you visit them after deletion. You can delete these through Disk Cleanup or through your browser settings.
How often should I delete temp files?
If you have Storage Sense set to run weekly or monthly, you do not need to do anything manually. If you prefer manual deletion, once a month is usually enough unless you work with large files like video or do frequent software installations, in which case every two weeks is reasonable.