How to clear cache on a Mac
Clearing the cache on a Mac frees space and rarely changes speed. Measure the folders first, delete inside one app's cache at a time with that app closed, and leave the system's own cache alone. Apps rebuild what you remove, so the cost is a slower first launch, not lost data.
What a cache is, and why it grows
A cache is a copy of something an app already worked out or downloaded: thumbnails, web pages, compiled code, map tiles, search indexes. The app reads the copy instead of repeating the work. Caches grow because few apps ever trim them, and some browsers and editors keep gigabytes.
macOS keeps caches in three places. The one you can act on is your user cache folder.
~/Library/Cachesholds one folder per app, named likecom.apple.SafariorGoogle. Everything here is yours to measure and clear./Library/Cachesis shared by all users and needs an admin password to change. Most Macs have little in it./System/Library/Cachesand the folders under/private/var/foldersbelong to macOS. It trims them itself, and a restart clears most of the latter. Leave them.
Step 1: measure before you delete
Open Terminal and run these two commands. The first gives the total, the second lists the 15 biggest app folders.
du -sh ~/Library/Caches
du -sh ~/Library/Caches/* 2>/dev/null | sort -h | tail -15
A typical Mac shows a few hundred megabytes to a few gigabytes. If the total is under 1 GB, clearing it will not change how much room you have. Look elsewhere first: the guide on freeing up space on a Mac lists the places worth checking in order.
Step 2: clear one app's cache safely
- Quit the app, including any menu bar item it runs.
- In Finder, choose Go, then Go to Folder, and enter
~/Library/Caches. - Open the app's folder and move its contents to the Trash. Leave the folder itself.
- Empty the Trash. Space returns to Storage only after that.
- Open the app. It rebuilds what it needs.
Do not select the whole Caches folder and delete everything at once. Some apps keep downloaded content there that is slow or impossible to fetch again, such as offline music or video you saved for a flight. Deleting it means downloading it again.
Browser caches
Safari. Open Safari, choose Settings, Advanced, and tick Show features for web developers. A Develop menu appears. Choose Develop, then Empty Caches. This clears cached pages and images but keeps your history, passwords and logins.
Chrome. Open Settings, Privacy and security, Delete browsing data. Choose the Advanced tab, set the time range to All time, tick only Cached images and files, and confirm. Leave cookies unticked unless you want to sign in to every site again.
Firefox. Open Settings, Privacy and Security, find Cookies and Site Data, and choose Clear Data. Tick only Cached Web Content.
Expect sites to load a little slower on the first visit after clearing. A browser cache that has grown past a few gigabytes is worth clearing every few months. A small one is doing its job.
Developer caches are bigger than app caches
If you build software, the largest caches are not in ~/Library/Caches at all. They are in tool folders, and each tool has its own safe cleanup command.
- Xcode keeps build products in
~/Library/Developer/Xcode/DerivedData. See how to clear Xcode DerivedData. - Homebrew keeps downloaded bundles.
brew cleanup -sremoves old ones. See the Homebrew cache guide. - npm keeps a cache in
~/.npm.npm cache verifychecks it, andnpm cache clean --forceempties it. - pip keeps wheels.
pip cache purgeempties them. - Docker keeps images and build cache. See why Docker takes space on a Mac.
Will it make my Mac faster?
Usually not. A cache exists to save work, so removing it forces the work to happen again. The cases where clearing helps are narrow: an app that misbehaves after an update because of a corrupt cache, a browser showing an old version of a page, or a disk with almost no free space where macOS has nothing left to write to. For general slowness, check memory pressure first. The guide on freeing up memory on a Mac explains how.
Doing it with Spotless
Spotless scans ~/Library/Caches and your browser caches, then lists every folder with its size and a plain sentence about what it is and whether it rebuilds. Nothing is ticked. You tick what you want, review the exact paths, and the items go to the Trash where you can restore them from Recently Deleted. Items marked Safe are the ones that rebuild on their own. Items marked Review are the ones worth a closer look, like offline downloads. See how Spotless works as a Mac cleaner.
Keep going
- See what is filling your Mac with the space map: The Map page in Spotless draws every folder as a block sized by the space it uses, so you can find what fills your Mac and open it.
- Storage by type: see which kind of file fills your Mac: Spotless groups the files in your home folder by type and age, from app data and developer files to videos, with the biggest files in each group.
- How to find large files on your Mac: Find the biggest files on a Mac with Finder, find, du and Spotlight, and why the sizes disagree for sparse files, packages, clones and iCloud placeholders.
- Is it safe to delete Library caches on Mac?: Which Library cache folders on a Mac are safe to delete, which are not, where sandboxed apps hide theirs, and how to measure before you remove anything.