Apps need temporary files in order to load faster. However, if you use a lot of applications, you could be storing dozens — even hundreds — of cache and temporary files without realizing it. Eventually, they not only eat up space but also may slow down your Mac. But how do you fix it? Keep on reading, and we'll show you how to delete temp files and provide some bonus tips on how to free up space on Mac. Let's dive in!
What are temporary files
Cache and temporary files can include everything from the web browser cache and history, including cookies and passwords, messaging cache folders, partially completed downloads, app temp files and folders, and so much more, taking up space on your Mac. Check the table below for more details.
| Browser cookies | Small pieces of text browsers receive from the websites you visit to make the browsing experience more useful should you open the website again |
| Outdated system logs | Old log files containing information about system activities |
| Application cache | Files apps download to work faster so that the network is not used every time these files are needed |
| Intermediate document versions | A snapshot of a document at a specific time |
Where are temporary files stored
On a Mac, temporary files are stored in a specific folder. To locate it, you first have to quit all active apps. Then, from the Finder, select Go > Go to Folder and type in the following path: ~/Library/Caches/ — in the window that opens, you'll see all temporary files.
How to remove temporary files automatically
Clearing out unnecessary temporary and cache files will increase the amount of hard drive space available, and it should improve your Mac's overall performance and speed.
You can do this in two ways: manually — which we cover below — or using a time-saving tool, such as CleanMyMac. This smart cleaner app has a dedicated Cleanup feature that quickly finds unneeded files and lets you remove them with just a few clicks. You do not have to worry about trashing any files vital for the proper work of macOS since CleanMyMac preselects only safe-to-delete ones.
To remove temporary files automatically, follow these steps:
- Get your free CleanMyMac trial.
- Once you've installed and opened the app, go to Cleanup in the sidebar.
- Click Scan.
- After the scan is complete, you can either review the files it identified for deletion or click Clean to get rid of temporary files and other junk.
According to the developer, this app removes up to 74 GB of junk on an average Mac. Most of it is system junk, in other words, temporary files and caches. If you are overloaded with temporary files and too much cache data, it will highlight this, and you can safely delete everything, saving you time and space.
The benefits of using CleanMyMac
- On average, you'll need 12 seconds to remove junk files with the help of the Cleanup feature — 6 seconds for the scan and 6 seconds for the cleanup
- Except for removing junk files, you can use the My Clutter feature to remove duplicates and similar images: on average, users get rid of 4 duplicates and 5 similar images after the first scan
- Comes with tools to protect and optimize your Mac: on average, users find and remove 1 malware and run 4 maintenance tasks after the first scan
Try CleanMyMac for free — make Mac decluttering and maintenance hassle-free.
Another way to clear out cache files and data is to go through your files manually. Here is how you do that.
How to clear temporary files manually
Before you begin, always back up your Mac. Whether you use Time Machine, iCloud, or a third-party hard drive or cloud-based storage system, make sure you've got everything backed up. Now, let's proceed with the necessary steps.
Remove system temporary files
- Quit or close any open and active apps. To make sure this is done, Force Quit anything that hasn't closed properly. Anything that needs to be closed that way might benefit from a cache clearout.
- Go to the Finder.
- Press down the Shift-Command-G keys to pull down the Go to Folder menu.
- Type
~/Library/Caches/and press Return.
- This will show you the full range of caches and temporary files stored on your Mac. Be certain which ones you want/need to delete before sending them to the Trash.
- To send cache folders to the Trash, either right-click and select Move to Trash or drag and drop them into the Trash.
- Empty the Trash — the same way you would when removing any other files - to clear them out of your Mac.
Delete browser cache
Unless you are deleting everything with some apps, you can make these same changes in settings. For example, in every web browser, you can clear the cache, cookies, saved passwords, and browser history. This way, you may free up several gigabytes of space (if it is the first time you remove cache).
How to empty the cache in Safari
Here's how to clear caches in Safari:
- Open Safari and go to Safari Settings (Command-Comma).
- Go to the Advanced tab and select the checkbox next to the "Show Develop menu"/"Show features for web developers" option (depending on your macOS versions, you may see either of them).
- Click the Develop menu and choose Empty Caches.
How to empty the cache in Chrome
In Chrome, the process is somewhat different:
- Open Chrome and go to Settings (alternatively, type chrome://settings/ in the address bar).
- Navigate to Privacy and security and select Delete browsing data.
- Set the Time range and make sure that Cached images and files is selected.
- Click Delete from this device.
Restart your Mac
Another way to safely delete temporary files, cookies, and the cache is to restart your Mac. If you keep it running and in sleep mode for days or weeks at a time, there are a lot of automatic maintenance systems that can't operate until you restart or shut down your Mac and then start it up again. So restarting your Mac is doing it a big favor and should help it run smoother.
Additional ways to free up space on Mac
Now that you've removed temp files, there are a few more things you can do to reclaim more storage space. But first, here's a quick reminder of how to check what's eating up that space:
- Go to System Settings > General > Storage.
- Wait for the colored graph to load and see the breakdown.
- Also, check the categories below for a more detailed overview of the main space hoggers.
From here, you can take a few steps to reclaim space:
- Enable recommendations that work best for you.
- Click an i next to a specific category and delete unneeded stuff. Make sure to check iOS files to remove old iOS backups. Besides, look at Messages to remove attachments.
After you're done in System Settings, open a new Finder window and check a few extra locations:
📌 /Library/Logs and /private/var/log to remove old log files (remove only files; do not remove folders and subfolders to avoid damaging the integrity of the operating system)
📌 The Downloads and Documents folders to delete files you no longer need and the Applications folder to get rid of forgotten apps (it's a good idea to filter files by size to spot the largest ones easily)
Do not forget about checking your media files — if you do not want to delete any of them, consider moving those you rarely open to an external drive or cloud storage.
It is also a good idea to remove old Time Machine backups and snapshots. Read more on how to manage them here.
If you're comfortable with using Terminal, you can run a few commands to reclaim space and remove temp files:
rmto delete any filessudo dscacheutil -flushcache; sudo killall -HUP mDNSResponderfollowed by your admin password to flush DNS cachermdirfollowed by the location of the folder you want to delete to delete that entire folder
Important: Deletion via Terminal is final and immediate, meaning that the files are not sent to the Trash, so the only way to restore them is to use a recent backup.
Automate Mac cleanup
If you want an easy way to declutter your Mac, check out CleanMyMac. It comes with a few tools that can quickly do all of the above:
- Cleanup to remove system logs, old iOS backups, browser cache and other unneeded stuff
- Protection to delete browser data like bookies and downloads/browsing history
- My Clutter to detect duplicates, similar images, and large and old files
- Applications to completely uninstall apps with a click
- Performance to flush DNS cache and remove Time Machine snapshots
Aim for keeping 15-20% of the overall storage capacity free. It helps maintain the optimal performance of your Mac and the longevity of the drive.
The outdated system files may hold back the performance of any Mac, even the most powerful models. And that's why Mac cleaning software exists. Either you choose a manual or automatic cleanup, your Mac will thank you for it. Hope you've learned something helpful today. Come back for more Apple/Mac tips.
Frequently asked questions
Can I delete all temp files?
Generally, yes. However, it is only possible if you know the exact locations in which to look for such files. Also, remember that apps and macOS will re-generate them as they operate to work faster. So, you will need to clean them up regularly — say, quarterly.
What's the best way to clean Mac cache, temp, and log files?
There are three easy ways to remove temp and log files. The first one is using a Mac cleaner app like CleanMyMac and its Cleanup feature. If you’re not into third-party software, you can restart your Mac from time to time or boot into safe mode. Both will delete some temp files, but not all of them, so you will have to remove the remaining ones manually. Do not forget about the risks of manual deletion and back up your Mac first.
Why do temporary files build up?
It mainly happens because apps and macOS fail to delete these files when they are no longer needed. Some reasons include app and macOS crashes, improper shutdowns, and ongoing background processes — all of these prevent automatic cleanup.