What temporary files are and why they pile up
Temporary files are scraps of data your computer creates while you work — browser cache, installation leftovers, crash dumps, partially downloaded files. They exist to speed things up or help programs recover from errors. The problem is that nothing automatically cleans them out, so they accumulate until they take up gigabytes of space you could use for actual files.
Windows stores most temporary files in a folder called Temp, usually at C:\Users\[Your Username]\AppData\Local\Temp. Mac puts them in /var/tmp and /private/var/tmp. Your browser also keeps its own cache — Chrome, Firefox, and Safari all store downloaded images, scripts, and page data locally so pages load faster the next time you visit. None of this is dangerous to delete; it's designed to be thrown away.
The reason you should care: temporary files can consume 5 to 50 gigabytes depending on how long your computer has been running and what you do with it. If your drive is nearly full, deleting them can free up enough space to actually use your computer again.
Key Takeaways
- Windows and Mac both have built-in system folders for temporary files that are safe to delete without harming your programs or files.
- Browser cache — the stored images and data from websites you visit — can be cleared from your browser settings without losing passwords or bookmarks.
- The safest approach is to close all programs first, then delete temporary files, because open programs may be using them.
- You can set up automatic cleanup on Windows using Disk Cleanup or on Mac using Storage settings, so temporary files don't pile up again.
How to delete temporary files on Windows
The easiest method on Windows is the built-in Disk Cleanup tool. Open the Start menu, type "Disk Cleanup" and press Enter. A window will appear asking which drive you want to clean — select your main drive (usually C:). The tool will scan for temporary files and show you a list of what it found, with checkboxes next to each category.
Check the boxes for "Temporary files", "Recycle Bin", and "Temporary internet files". Do not check "Windows Update Cleanup" unless you are certain you do not need to roll back a recent update. Click "Delete Files" and confirm. This usually takes a few minutes and frees 1 to 10 gigabytes depending on how long it has been since you last cleaned.
If Disk Cleanup does not appear or you want more control, you can delete the Temp folder manually. Press Windows key + R, type %temp% and press Enter. A folder will open. Select all files (Ctrl + A), then delete them (Delete key). Windows will skip any files that are currently in use, so you do not have to worry about breaking anything. If you get errors on a few files, that is normal — just delete what you can and move on.
How to delete temporary files on Mac
Mac does not have a single built-in cleanup tool like Windows, but you can use the Storage settings to see what is taking up space and delete cache files. Open System Settings, click "General", then "Storage". Wait for the scan to complete — it shows you a breakdown of what is using space on your drive.
Look for "Cache Files" or "Temporary Files" in the list. Click on it and you will see a list of applications and their cached data. You can delete cache for individual apps or all of them at once. Deleting cache will not harm the apps themselves; they will rebuild it the next time you use them. You can also click "Empty Trash" from the Finder menu to permanently delete files you have already moved to trash.
For more aggressive cleanup, open Finder, press Cmd + Shift + G (Go to Folder), and type /var/tmp. Select all files and delete them. Repeat with /private/var/tmp. These are system temporary folders and are safe to empty.
Clearing browser cache without losing passwords
Your web browser stores images, scripts, and page data from every site you visit. This cache can grow to several gigabytes. The good news is that clearing it will not delete your passwords, bookmarks, or browsing history unless you specifically tell it to.
In Chrome, open the menu (three dots), go to Settings, click "Privacy and security", then "Clear browsing data". A window appears with checkboxes. Make sure only "Cached images and files" is checked. Set the time range to "All time" and click "Clear data". In Firefox, open the menu, go to Settings, click "Privacy & Security", scroll to "Cookies and Site Data", and click "Clear Data" — again, make sure only cache is selected. On Safari, open Preferences, click "Privacy", then "Manage Website Data", select all, and click "Remove".
You can also set your browser to clear cache automatically when you close it. In Chrome, go to Settings > Privacy and security > Clear cookies and site data when you quit Chrome and toggle it on. Firefox has the same option under Settings > Privacy & Security > Cookies and Site Data.
What to do if your computer is still slow after cleanup
If you deleted temporary files and your computer is still sluggish, the problem is likely something else. Check how much free space you have left: open File Explorer (Windows) or Finder (Mac) and look at your drive. If you have less than 10 percent of your total drive space free, your computer will run slowly even after cleanup. In that case, you need to delete actual files — photos, videos, old documents — or move them to external storage.
You can also check what programs are running in the background. On Windows, open Task Manager (Ctrl + Shift + Esc), click the "Processes" tab, and look at CPU and Memory usage. On Mac, open Activity Monitor (Applications > Utilities > Activity Monitor) and sort by CPU or Memory. If a program is using a lot of resources, close it or uninstall it if you do not use it.
Setting up automatic cleanup so you do not have to do this again
Windows can clean up temporary files automatically. Open Settings, go to System > Storage, and toggle on "Storage Sense". You can then set it to run automatically every day, week, or month. You can also choose whether to delete files in the Recycle Bin and Downloads folder automatically after a certain number of days.
Mac does not have a built-in automatic cleanup, but you can use the Storage settings to see what is taking up space and delete cache manually every few months. Some third-party tools like CleanMyMac or AppCleaner offer automatic cleanup, but they are not necessary — manual cleanup once or twice a year is usually enough.
Frequently Asked Questions
Will deleting temporary files break any of my programs?
No. Temporary files are designed to be deleted. Programs will recreate them as needed. The only exception is if a program is actively running and using a temporary file — Windows and Mac will skip those files automatically, so you do not have to worry about it.
Can I delete files in my Downloads folder the same way?
Yes, but be careful. Downloads folder holds files you actually downloaded, not system temporary files. Review what is in there before deleting — you might have installers or documents you still need. Disk Cleanup will not touch your Downloads folder unless you tell it to.
What if I see a file I do not recognize in the Temp folder?
It is almost certainly safe to delete. Temp folders are meant to hold only temporary data. If a program needed a file to stay around, it would not be in Temp. If you are unsure, you can search the filename online to see what created it, but deletion is the default action for anything in that folder.
How much space will I actually free up?
It varies widely. If you have never cleaned before, you might free 10 to 50 gigabytes. If you clean regularly, each cleanup might only free 1 to 5 gigabytes. Browser cache alone can be 2 to 10 gigabytes depending on how much you browse.
Do I need to restart my computer after deleting temporary files?
No. You can delete temporary files and keep working. Your computer will not notice the difference. A restart is only necessary if a program is behaving strangely, which is rare.