What temporary files are and why you should remove them

Temporary files are small pieces of data your programs create while they're running, then forget to clean up when they close. Your web browser stores them while you browse. Microsoft Word creates them while you edit a document. Windows itself generates them during updates and installations. Most of the time you never see them — they sit in hidden folders taking up disk space.

Deleting them won't break anything. These files are meant to be temporary. Once a program finishes using them, they serve no purpose. Removing them frees up storage space, can speed up a slow computer, and reduces clutter on your hard drive. You can safely delete temp files without losing any documents, photos, or settings you actually care about.

Key Takeaways

  • Windows stores temporary files in a hidden Temp folder that you can access through File Explorer or the Disk Cleanup tool.
  • The fastest method is using Disk Cleanup, which removes temp files in a few clicks and shows you how much space you'll recover.
  • You can also manually navigate to the Temp folder and delete files directly, but close all open programs first to avoid errors.
  • Mac users can delete temp files through the Library folder or use the Finder's Empty Trash feature after moving files there.
  • Temporary files accumulate over time, so running Disk Cleanup once a month keeps your computer running smoothly.

Using Disk Cleanup on Windows (the easiest method)

Disk Cleanup is a built-in Windows tool that finds and removes temporary files automatically. Open the Start menu, type "Disk Cleanup" into the search box, and press Enter. A window will appear asking which drive you want to clean — select your main drive (usually C:) and click OK.

Windows will scan your drive for a few seconds. When the Disk Cleanup window opens, you'll see a list of file types it can remove. Look for the box labeled "Temporary files" and make sure it's checked. You can also check "Recycle Bin" and "Temporary Internet Files" if you want to remove those too. Click "Delete Files" at the bottom, and Windows will remove everything you selected. The whole process takes about a minute.

Disk Cleanup shows you exactly how much space you're freeing up before you confirm. This is the safest method because Windows only removes files it knows are safe to delete, and you can see what's happening at each step.

Manually deleting temp files through File Explorer

If you prefer to see the files yourself before deleting them, you can navigate to the Temp folder directly. First, close all open programs — this prevents Windows from locking files you're trying to delete. Then open File Explorer and click the address bar at the top (where it shows your current folder path).

Type this path exactly: %appdata%\Local\Temp and press Enter. File Explorer will take you to the Temporary Files folder. You'll see hundreds of files and folders with names like "tmp" followed by numbers. Select all of them by pressing Ctrl+A, then press Delete. Windows will move them to the Recycle Bin. If any files are locked and won't delete, Windows will skip them — that's normal, and it means a program is still using them.

You can also reach this folder by typing C:\Users\[YourUsername]\AppData\Local\Temp into the address bar, replacing [YourUsername] with your actual Windows username. Both paths lead to the same place.

Clearing temporary files on a Mac

Mac stores temporary files in a hidden Library folder. Open Finder and click "Go" in the menu bar at the top. Hold down the Option key on your keyboard — a new menu item called "Library" will appear. Click it. Navigate to the Caches folder, then look for folders related to programs you use (like "Google" for Chrome, or "Firefox"). You can delete these cache folders safely.

A simpler approach is to restart your Mac and hold down Command+Shift+Delete while it boots up. This empties the temporary file cache automatically. You can also use the Finder's Empty Trash feature: move files you don't need to the Trash, then right-click the Trash icon in the Dock and select "Empty Trash".

What to do if you get an error message

If Windows says a file is "in use" or "locked," it means a program is still using it. Close all open programs and try again. If the error persists, restart your computer and run Disk Cleanup or File Explorer again immediately after startup — fewer programs will be running, so fewer files will be locked.

Never force-delete a file that Windows says is in use. Doing so can cause programs to crash or behave unexpectedly. The locked files are usually small anyway, so skipping them won't significantly impact your storage space. You can always try again later.

How often you should delete temporary files

Running Disk Cleanup once a month is a good routine. If your computer feels slow or you're running low on storage space, run it more often — even weekly. There's no downside to cleaning temp files regularly. Some people set a calendar reminder on the first of each month as a habit.

If you notice your computer slowing down noticeably between cleanups, you might want to increase the frequency. Temporary files accumulate faster on computers that run many programs or stay on for days without restarting. A quick Disk Cleanup takes less than five minutes and can noticeably improve performance.

Frequently Asked Questions

Will deleting temp files cause me to lose documents or photos?

No. Temporary files are separate from your actual documents, photos, and settings. They're only used while programs are running. Deleting them won't affect any files you've saved intentionally.

What if I delete a temp file and a program stops working?

Restart the program. It will recreate the temporary files it needs. If a program crashes after you delete temp files, close it completely and open it again — this almost always fixes the problem. If the issue continues, restart your computer.

Can I delete temp files while programs are running?

You can try, but Windows will skip any files that are currently in use. Close all open programs first for the best results. This takes only a minute and ensures you can delete everything safely.

Is it safe to delete files in the AppData folder?

The Temp subfolder inside AppData is safe to delete. Don't delete the entire AppData folder or other subfolders like "Roaming" — those contain settings and data your programs need. Stick to the specific Temp path shown in this guide.

How much space will I free up by deleting temp files?

It varies widely depending on how long your computer has been running and which programs you use. Disk Cleanup will show you the exact amount before you confirm. Most people free up between 100 megabytes and several gigabytes.