How to Delete Temp Files on Windows, Mac, and More

Temporary files are created constantly in the background of your device — by your operating system, browsers, apps, and installers. Most of the time, they serve a purpose: speeding up processes, storing session data, or holding partial downloads. But they don't always clean themselves up, and over time they can quietly consume gigabytes of storage.

Here's exactly how temp file deletion works, where these files live, and what factors determine how aggressively you should approach clearing them.

What Are Temp Files, Actually?

Temporary files are short-lived data files that software creates during normal operation. They fall into a few categories:

  • System temp files — created by Windows or macOS during updates, installations, or routine processes
  • App cache files — stored by browsers, media players, and productivity apps to speed up future access
  • Installer leftovers — residual files from software setup processes that didn't self-clean
  • Crash dumps and logs — diagnostic files saved when apps or the OS encounter errors

Most are harmless to delete once they're no longer actively in use. The risk is deleting a temp file that an active process still needs — which is why timing and method matter.

How to Delete Temp Files on Windows 🗂️

Using Disk Cleanup (All Windows Versions)

  1. Press Windows + S, type Disk Cleanup, and open it
  2. Select the drive you want to clean (usually C:)
  3. Check Temporary files, Temporary Internet Files, and any other categories you want
  4. Click OK, then Delete Files

Using the %temp% Folder Directly

  1. Press Windows + R to open the Run dialog
  2. Type %temp% and press Enter
  3. Select all files (Ctrl + A) and delete them
  4. Skip any files that show an "in use" error — Windows will flag these automatically

This folder typically lives at C:Users[YourUsername]AppDataLocalTemp.

Using Storage Sense (Windows 10 and 11)

Storage Sense is a built-in automation tool that can delete temp files on a schedule:

  1. Go to Settings → System → Storage
  2. Toggle Storage Sense on
  3. Click Configure Storage Sense to set how frequently it runs and what it targets

Storage Sense can also be configured to clear the Recycle Bin and the Downloads folder on a timer — useful if you want ongoing maintenance rather than one-off cleaning.

How to Delete Temp Files on macOS

macOS manages many temp files automatically, but manual clearing is still possible and sometimes necessary.

Using Finder

  1. Open Finder, click Go in the menu bar, then Go to Folder
  2. Type /private/var/folders and browse for cache subdirectories
  3. Alternatively, type ~/Library/Caches to access user-level cache files
  4. Delete folders for apps you no longer use or that have grown unusually large

Using Terminal

The command sudo rm -rf /private/var/folders/ clears system temp folders — but use this only if you're comfortable with Terminal and understand what you're removing. A restart after clearing is recommended to let macOS rebuild necessary cache structures.

macOS also performs some automated temp file cleanup during restarts and system maintenance windows (typically scheduled overnight when the device is idle but plugged in).

Browser-Specific Cache and Temp Files

Browsers maintain their own separate cache systems, independent of OS-level temp folders. These can grow significantly — sometimes several hundred megabytes — and are worth clearing independently.

BrowserHow to Clear Cache
ChromeSettings → Privacy and Security → Clear Browsing Data
FirefoxSettings → Privacy & Security → Cookies and Site Data → Clear Data
SafariDevelop menu → Empty Caches (enable Develop menu in Advanced settings)
EdgeSettings → Privacy, Search and Services → Clear Browsing Data

Clearing browser cache removes locally stored versions of web pages and assets. Pages may load slightly slower on first visit afterward, but storage is recovered.

What Factors Determine How Often You Should Delete Temp Files

Not everyone needs to run temp file cleanup on the same schedule. Several variables shape the right approach:

Storage capacity — On a device with 256GB or less, temp file accumulation has a more noticeable impact than on a 1TB or 2TB drive.

Usage patterns — Heavy users of browsers, video editing software, or development tools generate significantly more temp data than casual users. IDEs and compilers, in particular, can produce large build caches.

OS version — Newer versions of Windows and macOS have improved automatic cleanup, reducing (but not eliminating) the need for manual intervention.

Technical comfort level — Manually navigating temp folders and using Terminal commands gives you more control but introduces more risk of accidentally deleting the wrong files. Built-in tools like Disk Cleanup or Storage Sense are safer starting points.

SSD vs. HDD — On a solid-state drive, unnecessary writes have a minor long-term effect on drive health (though modern SSDs handle this well). On a traditional hard drive, performance degradation from a cluttered drive is more noticeable.

What You Should Avoid Deleting 🚫

  • Prefetch files — Windows uses these to speed up app launches; deleting them causes a one-time slowdown as they rebuild
  • Active session files — If an app is open, its temp files may be in use; force-deleting them can cause crashes or data loss
  • System restore points — These are sometimes stored in locations that appear to be temp data but serve a recovery function

Third-party cleanup tools will often flag these as safe to delete — but they're not always right. Understanding what each category contains is more valuable than blindly running a cleaner.

The Variables That Make This Personal

Temp file management sits at the intersection of your storage situation, how you use your device, your OS version, and your tolerance for manual maintenance. Someone running a low-storage laptop with heavy browser use faces a very different situation than someone on a high-capacity desktop with automated cleanup already configured.

The mechanics are consistent — the folders, the tools, the commands. What varies is how frequently your setup actually requires intervention, and which method carries the right balance of control and safety for your comfort level.