How to Clean Junk Files in Windows
In this article
Over time, Windows accumulates temporary files, cache data, and leftover remnants from uninstalled programs. These junk files can consume several gigabytes of storage, slow down system performance, and even cause application errors. This guide shows you how to safely identify and remove junk files using built-in Windows tools—no third-party software required. You’ll learn both quick methods and deeper cleaning techniques, along with what to avoid deleting.
What You'll Need
- A Windows 10 or Windows 11 PC (the steps are nearly identical on both)
- Administrator account access (required for system file cleanup)
- An internet connection (optional, only if you want to clear browser cache)
Step-by-Step
- Open Storage Settings
Press Windows + I to open Settings, then go to System → Storage. This page shows a breakdown of what’s using space on your main drive. - Run Storage Sense (Windows 10/11)
In Storage settings, toggle on Storage Sense if it’s off. Click Configure Storage Sense or run it now (Windows 10) or Storage Sense (Windows 11). Under “Cleanup of temporary files,” select how often you want automatic cleanup, then click Clean now to run it immediately. This removes temporary files, recycle bin items older than the set period, and downloads folder files older than the set period. - Use the Disk Cleanup Tool (Classic)
Type Disk Cleanup in the Start menu search and open the app. Select the drive you want to clean (usually C:). The tool calculates how much space you can free. Check the boxes for Temporary files, Thumbnail cache, Recycle Bin, and Delivery Optimization Files (if present). Click OK, then Delete Files. - Clean Up System Files
In Disk Cleanup, click Clean up system files (you’ll need admin rights). This scans for Windows Update leftovers, old driver packages, and system error reports. Check Windows Update Cleanup, Device driver packages, and System error memory dump files. Click OK and confirm deletion. This often frees several gigabytes. - Clear Browser Cache
Open your browser (Edge, Chrome, Firefox). Press Ctrl + Shift + Delete to open the clear browsing data menu. Select Cached images and files (and optionally cookies, but be aware you’ll be logged out of sites). Choose “All time” as the time range, then click Clear data. - Empty the Recycle Bin
Right-click the Recycle Bin on your desktop and select Empty Recycle Bin. Confirm when prompted. This permanently deletes files you’ve previously sent there. - Remove Temporary Files via Run Command
Press Windows + R, type%temp%and press Enter. This opens the user’s temp folder. Select all files (Ctrl + A) and delete them. Some files may be in use—skip those. Also typetempin the Run dialog and delete the contents of that folder as well (this one is inC:\Windows\Tempand may require admin rights). - Uninstall Unused Apps
Go to Settings → Apps → Installed apps. Sort by size and uninstall any large apps you no longer use. This removes both the program and its associated files. - Run a Full System Scan for Junk (Optional)
While Windows built-in tools handle most junk, you can also use the Command Prompt to clean specific folders. Open Command Prompt as administrator and run:cleanmgr /sageset:1thencleanmgr /sagerun:1to run Disk Cleanup with all options pre-selected. - Restart Your PC
After cleaning, restart your computer to clear memory and finalize deletions. This also helps Windows refresh its file index.
Common Mistakes
- Deleting files from the Windows folder manually: Never delete files in
C:\Windowsby hand. Use Disk Cleanup or Storage Sense instead. - Clearing the “Downloads” folder accidentally: Storage Sense can delete files in Downloads if you set it to. Make sure you only enable that if you truly don’t need those files.
- Skipping the “Clean up system files” button: Many users miss this, leaving behind Windows Update leftovers that can be several gigabytes.
- Using third-party “registry cleaners”: These often do more harm than good and are not necessary. Stick to built-in tools.
- Running Disk Cleanup on an external drive that’s not needed: It’s fine, but you might accidentally delete files you want if you select “Recycle Bin” on a drive you use for backups.
Tips
- Set Storage Sense to run weekly: This prevents junk from accumulating in the first place.
- Use “Clean up system files” every few months: Windows Update cleanups are the biggest space savers.
- Check the “Temporary files” section in Storage settings: It shows a list of specific folders (e.g., Delivery Optimization, DirectX Shader Cache) that you can remove individually.
- Keep your Recycle Bin size small: Right-click Recycle Bin → Properties → set a smaller max size (e.g., 1 GB) so it doesn’t hold too much.
- Use the “Free up space now” option in Storage settings: This is a one-click way to remove temp files, recycle bin contents, and other junk.
Troubleshooting
- Disk Cleanup or Storage Sense hangs: Close all open applications, especially browsers and Office programs. If it still hangs, restart your PC and try again. Sometimes Windows Update is running in the background—wait a few minutes.
- “Clean up system files” button is grayed out: You need administrator privileges. Log in with an admin account or right-click Disk Cleanup and select “Run as administrator.”
- Deleting temp files gives “file in use” errors: That’s normal. Skip those files—they’re being used by running programs. They’ll be cleaned on the next reboot if you close the programs.
- After cleaning, you don’t see much space freed: If you haven’t run “Clean up system files,” that’s likely why. Also check if you have large files in your Downloads or Documents folder—those aren’t junk.
- Storage Sense doesn’t appear in Settings: Make sure you’re on Windows 10 version 1809 or later, or Windows 11. If it’s missing, run Windows Update.
- You accidentally deleted something important: Check the Recycle Bin first—if it’s not there, you can try a file recovery tool, but act quickly because the space may be overwritten.
Frequently Asked Questions
Is it safe to delete all files in the Temp folder?
Generally yes, but some files may be in use by running programs. Windows will skip those or you can skip them manually. Deleting temp files never harms your system.
How often should I clean junk files?
Once a month is sufficient for most users. If you install/uninstall lots of software or edit large videos, do it weekly.
Will cleaning junk files speed up my PC?
It can help if your disk is nearly full (less than 10% free space). If you have plenty of free space, the performance gain is minimal.
Do I need third-party cleaner apps like CCleaner?
No. Windows built-in tools (Storage Sense, Disk Cleanup) are sufficient and safer. Third-party cleaners sometimes remove registry entries or files that cause issues.
What is the difference between “Temporary files” and “System files” in Disk Cleanup?
Temporary files are user-level junk (browser cache, temp installers). System files include Windows Update backups, old drivers, and system error reports—these are typically larger and require admin rights to remove.
Can I clean junk files from the command line?
Yes. You can use cleanmgr with flags, or use PowerShell commands like Remove-Item -Path $env:TEMP\* -Recurse to clear the temp folder. But the graphical tools are easier and safer.