What temporary files are and why you should remove them

Temporary files are data your computer creates while you work — copies of documents you have open, browser cache, installation leftovers, and fragments from programs that crashed. Your system stores these in specific folders so it can work faster and recover if something goes wrong. The problem is that temporary files accumulate over time and can consume gigabytes of storage space, especially if your computer has been running for months without cleanup.

You can safely delete most temporary files without harming your system or losing your actual work. The files Windows, macOS, and Linux create for temporary use are meant to be disposable. However, you should close all open programs before you delete them — if a program is actively using a temporary file and you remove it, that program may crash or behave unexpectedly.

Key Takeaways

  • Temporary files live in specific system folders and can be deleted safely once all programs are closed.
  • Windows stores temp files in C:\Users\[YourUsername]\AppData\Local\Temp and C:\Windows\Temp; macOS uses /var/tmp and /tmp.
  • The built-in Disk Cleanup tool on Windows and Storage settings on macOS handle temporary file removal without manual folder navigation.
  • Clearing your browser cache separately removes temporary web data and can improve browsing speed.
  • Scheduling regular cleanup every month or two prevents temporary files from consuming large amounts of disk space.

Deleting temporary files on Windows using Disk Cleanup

The easiest method on Windows is the built-in Disk Cleanup tool, which identifies and removes temporary files without you having to navigate folders manually. Open the Start menu, type "Disk Cleanup" into the search box, and select the Disk Cleanup application. When it opens, it will scan your system and show you a list of file types it can remove, including Temporary files, Recycle Bin contents, and browser cache.

In the Disk Cleanup window, check the box next to "Temporary files" — you can also check "Temporary Internet Files" if you want to clear browser cache at the same time. Do not check "Recycle Bin" unless you are certain you do not need anything you have deleted recently. Click the "Delete Files" button at the bottom. Windows will ask you to confirm; click "Delete" again. The process usually takes a few seconds to a minute depending on how many temporary files exist.

If Disk Cleanup does not appear in your search results, you may be using an older version of Windows or a system where it has been disabled. In that case, you can delete temporary files manually by opening File Explorer, typing %temp% into the address bar at the top, and pressing Enter. This opens your user temporary folder directly. Select all files in this folder (Ctrl+A), then press Delete. Some files may be locked by running programs and will not delete — that is normal, and you can skip those.

Removing temporary files on macOS

macOS does not have a built-in tool equivalent to Windows Disk Cleanup, but you can use the Storage settings to see what is taking up space and remove cache files. Open System Settings (or System Preferences on older macOS versions), click "General," then select "Storage." macOS will scan your drive and show you categories like Applications, Documents, and System Data. Look for "Caches" or items labeled as taking up significant space.

To manually delete temporary files on macOS, open Finder and press Command+Shift+G to open the "Go to Folder" dialog. Type /var/tmp and press Enter. This opens the temporary folder. Select all files (Command+A) and move them to Trash (Command+Delete). Repeat this process with the folder /tmp. Empty your Trash afterward by right-clicking the Trash icon in the Dock and selecting "Empty Trash."

Be aware that some of these files may be in use by running applications. If you see a message that a file cannot be deleted, leave it alone — it means the system or a program still needs it. Deleting only the files that move to Trash successfully is safe.

Clearing browser cache and temporary web files

Your web browser stores temporary copies of images, scripts, and web pages you visit so they load faster on your next visit. Over time, this browser cache can grow to hundreds of megabytes or more. Clearing it is separate from deleting system temporary files but is worth doing at the same time.

In Chrome, open the menu (three dots in the top right), select "Settings," then click "Privacy and security" in the left sidebar. Choose "Clear browsing data." A window will appear with options for what to delete. Make sure "Cached images and files" is checked, set the time range to "All time" if you want a complete cleanup, and click "Clear data."

In Firefox, open the menu (three horizontal lines), select "Settings," then click "Privacy & Security" on the left. Scroll down to "Cookies and Site Data" and click "Clear Data." Check both "Cookies and Site Data" and "Cached Web Content," then click "Clear." In Safari, open the menu, select "Settings," click the "Privacy" tab, and click "Manage Website Data." Select all sites and click "Remove."

Understanding what is safe to delete and what to avoid

System temporary files — those created by Windows, macOS, or individual applications during normal operation — are safe to delete. These include installer caches, crash dumps, and work files that programs create while you use them. Once you close the program, these files serve no purpose.

Avoid deleting files in system folders like C:\Windows or /System unless you are absolutely certain what they are. If you are manually browsing folders rather than using Disk Cleanup or Storage settings, stick to the obvious temporary folders: C:\Users\[YourUsername]\AppData\Local\Temp on Windows and /var/tmp on macOS. Do not delete files from Program Files or Applications folders, as these contain actual program code.

If you use cloud storage like OneDrive, Google Drive, or iCloud, be careful not to delete the sync folder itself — only delete the temporary cache files within it. When in doubt, leave a file alone. Temporary files are meant to be deleted, but your actual documents and program files are not.

Setting up regular cleanup to prevent buildup

Rather than waiting until your disk is nearly full, schedule temporary file cleanup every month or two. On Windows, you can set Disk Cleanup to run automatically. Open Task Scheduler (search for it in the Start menu), click "Create Basic Task" on the right side, give it a name like "Monthly Temp Cleanup," and set it to run monthly. In the "Action" section, set the program to cleanmgr.exe with the argument /sagerun:1. This will run Disk Cleanup automatically on your schedule.

On macOS, you can use a third-party tool like CleanMyMac or Onyx to schedule automatic cleanup, though these are optional — manual cleanup every few months is sufficient for most users. Alternatively, set a calendar reminder to run the manual cleanup process yourself.

Regular cleanup prevents temporary files from accumulating to the point where they noticeably slow your system or consume most of your available disk space. Most users see a noticeable improvement in available storage after their first cleanup, especially if they have not done it in over a year.

Frequently Asked Questions

Will deleting temporary files slow down my computer?

No — deleting temporary files typically makes your computer faster or keeps it at the same speed. Temporary files take up disk space and can make your system work harder to manage storage. Removing them frees space and can improve performance. You might notice slightly slower loading the first time you open a program after cleanup, since it will rebuild its cache, but this is temporary.

What if I see "access denied" when trying to delete a temporary file?

This means a program is actively using that file. Close all open programs and try again, or restart your computer and run the cleanup immediately after startup before programs have time to create new temporary files. Using Disk Cleanup or Storage settings instead of manual deletion usually avoids this problem because these tools know which files are safe to remove.

Can I delete temporary files while programs are running?

You can attempt to, but it is not recommended. Close all programs first, including background applications and browser windows. If a program is using a temporary file when you delete it, that program may crash or behave unexpectedly. Restarting your computer before cleanup ensures nothing is actively using temporary files.

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

This varies widely depending on how long your computer has been running and what you use it for. Users who have not cleaned up in over a year often free up 1 to 5 gigabytes. Regular users might free up 100 megabytes to 1 gigabyte per cleanup. Browser cache alone can range from 100 megabytes to several gigabytes depending on your browsing habits.

Is it safe to delete files in the AppData folder?

Only delete files in AppData\Local\Temp. Do not delete other AppData folders, as they contain program settings and data you may need. The Temp subfolder is specifically designed for temporary files and is safe to clear. If you are unsure whether a folder contains temporary files or important data, use Disk Cleanup instead of manual deletion.