Drive Sweeper
Windows 10 & 11 Buy license · $29.95
Junk files

Is It Safe to Delete Temp Files in Windows? What to Clear and What to Leave

Is it safe to delete temp files in Windows? Yes, with a few exceptions. See what temp folders hold, what happens when you clear them and how to do it.

Updated 5 minute read The Drive Sweeper team

Yes, it is safe to delete temp files in Windows. The files in your temp folders are working files that Windows and apps create while they run, and anything still in use is locked so Windows will not let you delete it. The only real risks are losing unsaved work in an app that is open while you clean, and confusing true temp folders with similar-sounding system folders that are not safe to clear. Close your apps first, delete only the contents of the temp folders, and you will not harm Windows or your programs.

What temp files actually are

Programs need scratch space. An installer unpacks itself before it runs, a photo editor saves undo history, a browser caches pieces of web pages, a document viewer extracts an attachment so it can open it. These files go into temporary folders and are supposed to be cleaned up afterwards. Often they are not: programs crash, get closed mid-task, or simply never tidy up.

Over time, the leftovers build up. On a PC that has not been cleaned for a year or two, temp folders commonly hold a few gigabytes, sometimes much more.

Where temp files live

LocationWhat it holdsSafe to clear?
%temp% (C:\Users\YourName\AppData\Local\Temp)Your apps' working files and unpacked installersYes, contents only
C:\Windows\TempWorking files for Windows and installers running as the systemYes, contents only, with administrator approval
Browser cachesImages and scripts from websitesYes, from the browser's settings
Thumbnail cachePreview images for File ExplorerYes; it rebuilds
C:\Windows\PrefetchData that helps apps start fasterHarmless but pointless; Windows rebuilds it and apps may start slower meanwhile
C:\Windows\SoftwareDistributionWindows Update working filesDo not delete by hand; use Windows Update Cleanup
C:\Windows\InstallerInstaller data for repairing and removing programsNo, never

The last three are often mentioned in cleanup guides alongside temp files, but they are not the same thing. Only the first four are true temporary data you can clear freely.

What can go wrong (and how to avoid it)

Unsaved work in open apps

Some apps keep the document you are working on, or its recovery copy, in a temp folder until you save. If you clear temp files while that app is open, Windows usually refuses because the file is locked, but not always. Save your work and close your apps before you clean.

Attachments you edited

When you open an email attachment, edit it and click Save, many mail apps save it to a hidden temporary folder rather than to your Documents. If you have done this, use Save As to put a copy somewhere permanent before you clear temp files.

Installs and updates in progress

Do not clear C:\Windows\Temp while a program is installing or Windows Update is waiting for a restart. Restart first, then clean.

Files that will not delete

Locked files are in use by something running. Choose Skip when Windows asks, and do not use unlocking tools to force them. They will usually go on a later cleanup.

Deleting temp files will not delete your documents, photos or other saved files. Those live in your library folders, not in temp folders.

How to delete temp files safely

The safest method is the one built into Windows:

  1. Save your work and close your apps.
  2. Open Settings > System > Storage > Temporary files.
  3. Tick Temporary files and any other categories you are happy to clear, such as Thumbnails and Delivery Optimization Files.
  4. Leave Downloads and Recycle Bin unticked unless you have checked them.
  5. Click Remove files.

To clear your own temp folder by hand, press Windows + R, type %temp%, press Enter, select everything with Ctrl + A and delete it, skipping any files in use. Our full guide to deleting temporary files in Windows 11 covers Disk Cleanup and every category in the list.

Shared PCs and other accounts

Every user account has its own temp folder inside its own profile, so clearing yours does not touch anyone else's. On a family or office PC where several people sign in, each account can build up its own leftovers. Either clear temp files while signed in to each account, or ask each person to turn on Storage Sense in their own Settings. C:\Windows\Temp is shared, and clearing it once covers the whole PC.

Does deleting temp files speed up your PC?

Usually not by much. Clearing temp files frees space, and that helps if your system drive was nearly full, because Windows needs room for updates and virtual memory. On a PC with plenty of free space, you are unlikely to notice a speed difference. Be skeptical of any tool that promises big performance gains from cleaning temp files or the registry.

It is also normal for temp files to return. Windows and apps create them constantly; what matters is that leftovers do not pile up for years.

One exception is worth knowing: if your system drive is completely full, clearing temp files is often the fastest way to get Windows working normally again. Apps that cannot write their working files fail in strange ways, and a few gigabytes of breathing room makes an immediate difference.

How often should you clear them?

Once a month is plenty for most PCs. The easiest approach is to turn on Storage Sense under Settings > System > Storage so Windows clears temporary files automatically on the schedule you choose.

If you want temp file cleanup as part of a wider sweep, Drive Sweeper clears Windows temporary files, update leftovers, browser caches, crash dumps and log files, and marks them safe to remove, while showing duplicates, huge files and old downloads in the same scan. It never picks Windows or program files, and it can run on a weekly or monthly schedule.

A safety net for anything you remove

Temp files are about the safest thing on your PC to delete, but cleanups rarely stop at temp files. Once you start removing downloads, duplicates or large files, a way back matters. Windows' own tools delete permanently. Drive Sweeper moves removed files to its restore area for 30 days, so you can bring anything back in one click. If something has already gone missing after a cleanup, see how to recover files deleted by Disk Cleanup, and for a wider reference, our list of what files you can delete from your C drive.

Frequently asked questions

Will deleting temp files delete my documents?

No. The temp folders hold working files created by Windows and apps, not your saved documents. The one exception to watch is unsaved work in an app that is still open.

Should I delete temp files while programs are open?

It is better to close your programs first. Files in use cannot be deleted anyway, and an app that loses its temp files mid-task may lose unsaved work.

What is the difference between %temp% and C:\Windows\Temp?

%temp% is your own temp folder inside your user profile. C:\Windows\Temp is used by Windows and installers and needs administrator rights to clear.

Get three guides like this every month, plus software update notices.Subscribe →