What temporary files are and why you should remove them
Temporary files are copies of documents, images, and program data that your computer creates while you work — then forgets to clean up. Your browser stores them when you visit websites. Programs like Microsoft Word or Adobe Reader create them while you edit. Windows and Mac both generate system temporary files during updates and installations. These files sit on your hard drive taking up space, and they accumulate faster than you might expect.
Deleting temporary files frees up storage space, can speed up a slow computer, and removes data you no longer need. The files are safe to delete because they are copies — the originals stay in your Documents folder or wherever you saved them. Your programs will simply recreate temporary files the next time you need them.
Key Takeaways
- Temporary files live in specific folders on your hard drive and can be deleted without harming your programs or documents.
- Windows stores temporary files in the Temp folder, which you can access through File Explorer by typing %temp% in the address bar.
- Mac users can delete temporary files by opening Finder, pressing Command+Shift+G, and typing /var/tmp or /tmp to access the folders.
- You can delete temporary files manually by selecting them and pressing Delete, or use built-in tools like Disk Cleanup on Windows.
- Close all open programs before deleting temporary files to avoid errors, since some programs may be actively using files in those folders.
How to delete temporary files on Windows
The fastest way on Windows is to use the built-in Disk Cleanup tool. Press the Windows key and type "Disk Cleanup" into the search box, then click the result. A window will open asking which drive you want to clean — select your C: drive (or whichever drive holds your Windows installation). Disk Cleanup will scan for temporary files and show you how much space they take up. Check the box next to "Temporary files" and any other categories you recognize, then click "Delete Files" at the bottom.
If you want to delete temporary files manually instead, open File Explorer and click the address bar at the top. Type %temp% and press Enter — this takes you directly to your temporary files folder. Select all the files inside by pressing Ctrl+A, then press Delete. Windows will move them to the Recycle Bin. Some files may be locked (in use by a program), and Windows will skip those — that is normal and safe.
You can also reach temporary files through the AppData folder. Open File Explorer, click the address bar, type %appdata% and press Enter. Look for a folder called "Local" and open it, then find the "Temp" folder inside. Delete the contents the same way — select all, press Delete. This folder often holds more temporary data than the main Temp folder.
How to delete temporary files on Mac
On Mac, open Finder and click the "Go" menu at the top of the screen. Select "Go to Folder" from the dropdown. A text box will appear — type /var/tmp and press Enter. This folder holds temporary files created by your system and programs. Select all files by pressing Command+A, then drag them to the Trash, or press Command+Delete.
Repeat the process for the second temporary folder. Open Go to Folder again and type /tmp, then press Enter. Delete the contents the same way. These two folders hold most of the temporary data on your Mac. After you empty both folders, empty your Trash by right-clicking the Trash icon in the Dock and selecting "Empty Trash."
If you see a lock icon on any file and cannot delete it, that file is currently in use by a program. Leave it alone — it will not harm anything, and you can delete it the next time you restart your Mac. Restarting your computer before cleaning temporary files ensures that no programs are actively using them, which makes the deletion process smoother.
Using built-in tools to automate temporary file removal
Windows includes a scheduled maintenance tool that can delete temporary files automatically. Open Settings by pressing the Windows key and typing "Settings," then click the result. Go to System, then click "Storage" in the left sidebar. Scroll down and click "Storage Sense." Toggle it on, then click "Configure Storage Sense or run it now." You can set Windows to delete temporary files automatically every day, week, or month. This means you do not have to remember to clean them manually.
Mac does not have a built-in automatic cleanup tool, but you can use the Terminal to schedule deletions. This requires typing commands, which is more technical than the manual method. For most Mac users, deleting temporary files manually once every few months is sufficient. If you prefer automation, third-party tools exist, but the manual method through Finder is free and takes only a few minutes.
What to do if you cannot delete a temporary file
If you see an error message saying a file is "in use" or "locked," a program is actively using that file. Close all open programs and try again. If the error persists, restart your computer — this closes everything running in the background and releases the lock on the file. After restart, the temporary file should delete without problems.
On Windows, if a file still will not delete after restart, it may be a system file that Windows needs. Do not force-delete it. Instead, skip that one file and delete everything else in the folder. On Mac, files with a lock icon can usually be deleted by opening Get Info (Command+I), clicking the lock icon at the bottom, and entering your password. If that does not work, restart your Mac and try again.
How much space temporary files actually take up
The amount of space temporary files consume depends on how long your computer has been running and what you use it for. A computer that has been in use for several years might have gigabytes of temporary files. A newer computer or one that is regularly cleaned might have only a few hundred megabytes. Browsers are often the biggest culprit — they cache images and data from every website you visit to load pages faster next time.
If your hard drive is nearly full, deleting temporary files can free up enough space to make a noticeable difference in performance. If your drive has plenty of free space, cleaning temporary files is less urgent but still a good maintenance habit. You can check how much space temporary files are using before you delete them — Disk Cleanup on Windows shows the size, and Finder on Mac shows file sizes when you select them.
Frequently Asked Questions
Will deleting temporary files break my programs or documents?
No. Temporary files are copies created by programs while they work. Your actual documents and program files remain untouched. Programs will recreate temporary files the next time you use them. The only exception is if you delete a temporary file while a program is actively using it — which is why closing programs first is important.
Can I delete temporary files while programs are open?
You can try, but some files will be locked and will not delete. It is safer to close all programs first, especially your web browser, which constantly creates temporary files. After closing everything, the deletion process is faster and cleaner because no files are in use.
How often should I delete temporary files?
Once every few months is typical for most users. If your hard drive is nearly full or your computer feels slow, delete them more often. If you have plenty of free space and your computer runs well, you can clean them less frequently. There is no harm in deleting them weekly if you prefer.
Do I need to empty the Recycle Bin or Trash after deleting temporary files?
Not immediately, but you should empty it eventually to fully free up the space. On Windows, right-click the Recycle Bin and select "Empty Recycle Bin." On Mac, right-click the Trash icon in the Dock and select "Empty Trash." Until you do, the files still occupy space on your drive.
What is the difference between the Temp folder and the AppData folder on Windows?
The Temp folder (%temp%) holds temporary files created by Windows and most programs. The AppData folder holds settings and cached data specific to individual programs. Both can be cleaned safely. The Temp folder usually contains more files and frees up more space, but cleaning both is more thorough.