What temporary files are and why you should delete them
Temporary files are scraps of data that Windows and your programs create while they're running — cached web pages, installer leftovers, crash reports, and partially downloaded updates. Windows stores most of these in a folder called Temp, and they pile up over time. Deleting them won't hurt anything because they're meant to be temporary; Windows will recreate them if a program needs them again.
Clearing temp files usually frees up between 500 megabytes and several gigabytes, depending on how long it's been since you last cleaned them out. This can speed up your computer slightly and is one of the easiest maintenance tasks you can do yourself.
Key Takeaways
- Windows stores temporary files in a Temp folder that you can access through Disk Cleanup or by typing %temp% into File Explorer.
- You can delete temp files while Windows is running, though some files may be locked if they're currently in use.
- Disk Cleanup is the safest method because it only removes files Windows knows are safe to delete.
- If you want to delete everything in the Temp folder, restart your computer first so no programs are using those files.
Using Disk Cleanup — the safest method
Disk Cleanup is a built-in Windows tool that identifies and removes temporary files without any risk. Open it by typing "Disk Cleanup" into the Windows search box and pressing Enter. The tool will scan your drive for a few seconds.
When the window opens, you'll see a list of file types with checkboxes. Look for "Temporary files" — it's usually already checked. You can also check "Recycle Bin" and "Temporary internet files" if you want to clear those too. Click "OK" and Windows will delete the checked items. You may see a confirmation message asking if you're sure; click "Delete Files" to proceed.
This method is reliable because Disk Cleanup only removes files that Windows has marked as safe. It won't touch anything your programs are actively using.
Manually deleting files from the Temp folder
If you want more control, you can go directly to the Temp folder and delete files yourself. Open File Explorer and type %temp% into the address bar at the top, then press Enter. This takes you straight to the Temp folder without hunting through nested directories.
You'll see a folder full of files and subfolders with names like "Low" and numbered folders. Select all of them by pressing Ctrl+A, then press Delete. Windows will delete what it can immediately. If you see a message saying some files are in use, click "Skip" for those — they're being used by running programs and can't be deleted right now.
To delete the files that were skipped, restart your computer. When Windows starts up again, no programs are using the Temp folder yet, so you can delete everything. Open the Temp folder again, select all, and delete.
Clearing the Windows temporary folder
There's a second temporary folder that Windows itself uses, separate from the one you just cleared. To access it, open File Explorer and type C:\Windows\Temp into the address bar, then press Enter. This folder contains temporary files created by Windows system processes.
Select all the files here the same way — Ctrl+A, then Delete. Again, you may see messages about files in use; skip those and restart your computer to delete them on the next startup. This folder is usually smaller than the first Temp folder, but clearing it is still worth doing.
Removing temporary internet files
Your web browser stores temporary copies of web pages, images, and other content so pages load faster when you visit them again. These cached files can add up to hundreds of megabytes. To clear them, open your browser's settings.
In Microsoft Edge, click the three-dot menu in the top right, select "Settings," then "Privacy, search, and services." Under "Clear browsing data," click "Choose what to clear." Check "Cached images and files" and any other categories you want to remove, then click "Clear now." Chrome, Firefox, and other browsers have similar options in their settings menus.
Automating temp file cleanup
If you want Windows to clean up temporary files automatically, you can set up a scheduled task. Open Task Scheduler by typing "Task Scheduler" into the Windows search box. In the left panel, click "Task Scheduler Library," then right-click in the empty space and select "Create Basic Task."
Give it a name like "Clean Temp Files," then click "Next." Choose when you want it to run — "Monthly" or "Weekly" works well. Click "Next" again, then select "Start a program." In the "Program/script" field, type cleanmgr.exe (this is Disk Cleanup), and click "Finish." Windows will now run Disk Cleanup on the schedule you set.
What to do if you can't delete a file
Sometimes Windows won't let you delete a file because a program is using it. The safest approach is to restart your computer and try again immediately after startup, before programs have time to load. If a file still won't delete after a restart, it's probably safe to leave it — Windows won't let you delete something it actually needs.
Never force-delete system files or files you don't recognize. If you're unsure whether something is safe to remove, skip it and move on. Temporary files are meant to be deleted, but if Windows is protecting a file, there's usually a reason.
Frequently Asked Questions
Will deleting temp files slow down my computer?
No. Temp files are meant to be deleted, and removing them won't harm anything. Your computer may run slightly faster because it has more free disk space, but the difference is usually small. Windows and your programs will recreate temp files as needed.
How often should I clear temporary files?
Once a month is reasonable for most people. If you use your computer heavily or install programs frequently, clearing them every two weeks is fine. There's no downside to doing it more often, so you can clean them whenever you think about it.
Is it safe to delete everything in the Temp folder?
Yes, as long as you restart your computer first. Restarting ensures no programs are actively using files in that folder. If you try to delete while programs are running, Windows will skip the files in use, which is also safe — it just means you won't delete everything.
What's the difference between %temp% and C:\Windows\Temp?
%temp% is the user temporary folder where your programs and Windows store temporary data. C:\Windows\Temp is the system temporary folder used by Windows itself. Both are safe to clear, and clearing both removes more clutter than clearing just one.
Can I delete files from the Temp folder while programs are running?
Yes, but Windows will skip any files that are currently in use. You'll see messages asking if you want to skip those files — click "Skip" and move on. To delete everything, including locked files, restart your computer first and delete immediately after startup.