What a cache is, and why you rarely need to clear it
A cache is a stash of files an app keeps so it doesn't have to fetch or work them out again: website images, thumbnails, downloaded previews, compiled code. Deleting a cache doesn't break anything in the normal case. The app notices the files are gone and rebuilds them, which makes the next launch or page load a little slower.
That's also why clearing caches is a weak way to free space. They grow back as you use your apps. And macOS already clears caches and logs that are safe to delete when it needs space, along with things like interrupted downloads and Safari website data (Apple, Optimize storage space). In Storage settings, caches are counted as part of System Data.
There are good reasons to clear one, though: a web page that keeps showing an old version, an app that misbehaves after an update, or one app whose cache has grown to many gigabytes. Those are covered below.
Clear your browser cache
When people say "clear cache", they usually mean the browser. Clearing only the cache keeps you signed in to websites. Clearing cookies as well signs you out of most of them.
Safari
Safari has two ways, depending on what you want to remove:
- Cache, cookies and other website data: choose Safari › Settings, click Privacy, then Manage Website Data. Select sites and click Remove, or click Remove All. Apple notes this may sign you out of websites, and that removing the data in Safari may also change or remove it in other apps (Apple, Clear your cache and cookies in Safari on Mac).
- Only the cache, keeping cookies: turn on Safari › Settings › Advanced › Show features for web developers. A Develop menu appears in the menu bar; choose Develop › Empty Caches. Apple documents this in its developer tools guide rather than the Safari user guide (Apple Developer, Develop menu).
History › Clear History is a different thing: it removes the list of pages you visited, recent searches, the downloads list and similar records, and with iCloud it does so on all your devices. Apple's page for it doesn't say it clears the cache (Apple, Clear your browsing history in Safari).
Chrome
- In Chrome, click More (the three dots at the top right), then Delete browsing data.
- Choose a time range, such as Last hour or All time.
- Select Cached images and files. Select Cookies and other site data only if you also want to sign out of websites.
- Click Delete data.
If you're signed in to Chrome with sync, Google says this deletes the data from your other devices and your Google Account too (Google, Delete browsing data in Chrome). Edge, Brave and other Chromium-based browsers have the same option in their own settings.
Firefox
- Choose Firefox › Settings and open Privacy and security.
- In the browsing data section, click Clear browsing data.
- Set When to Everything, check only Temporary cached files and pages, and click Clear (Mozilla, How to clear the Firefox cache).
Clear an app's cache in your Library
Apps you install keep their caches in the Caches folder of your user Library, usually one folder per app, named after the app or its identifier (for example com.spotify.client). Apple doesn't document this folder for users, so what follows is good practice rather than an Apple procedure.
To see which caches are big, this Terminal command lists the ten largest. It only reads:
du -sh ~/Library/Caches/* 2>/dev/null | sort -h | tail -10
On one of our Macs the largest were Google's at 4.2G, then three developer tool caches (CocoaPods, pnpm and pip) between 650M and 800M each. Then, for one app at a time:
- Quit the app. An open app may be using its cache; clearing it underneath can make the app misbehave until you restart it.
- In Finder, choose Go › Go to Folder, type
~/Library/Cachesand press Return. - Find the app's folder and drag it to the Trash. Move the app's folder, not the Caches folder itself.
- Open the app and check it works. It will rebuild what it needs.
- Empty the Trash a day or two later, once you're sure nothing's wrong.
Many apps, especially chat, music and design apps, also have a "clear cache" button in their own settings. Use that when there is one: the app knows exactly what's safe to remove. Apps from the App Store usually keep their caches inside their own container in ~/Library/Containers; leave those folders alone and use the app's setting instead, since a container also holds the app's data and settings.
System caches: leave them alone
macOS keeps its own caches in places such as /Library/Caches, /System/Library/Caches and /private/var/folders. Don't delete from them. macOS manages them, removes the safe ones itself when space is needed, and some are protected by System Integrity Protection for good reason. Deleting the wrong file can stop apps or macOS from starting.
If you genuinely need macOS to clear its caches, there are two safe ways:
- Restart. It clears temporary files and gives macOS a chance to tidy up.
- Start up in safe mode, then restart normally. Apple says safe mode clears certain system caches, which are recreated as needed, and that this can free enough space temporarily to, for example, install a macOS update (Apple, Free up storage space on Mac).
Developer caches
If you write code, these are often the biggest caches on the Mac, and each tool has a proper way to clear its own:
- Xcode: DerivedData (
~/Library/Developer/Xcode/DerivedData) holds build products and indexes. Apple doesn't document it as safe to delete, but Xcode rebuilds what it needs at the cost of a slower next build. Quit Xcode first. For simulator runtimes, use Xcode › Settings › Components. - Homebrew: preview what would be removed, then remove it.
brew cleanupremoves outdated downloads and old versions of installed formulae; downloads older than 120 days go by default (Homebrew manual).
brew cleanup -n
brew cleanup
- npm: npm's own documentation says clearing its cache is "typically unnecessary", because the cache is self-healing.
npm cache verifychecks it and removes what isn't needed;npm cache clean --forceempties it if you really want to (npm Docs, npm-cache).
When clearing a cache does help
- A website looks broken or out of date in one browser but fine in another. Clear that browser's cache, or just that site's data.
- An app crashes or shows stale content after an update. Quit it, move its cache folder to the Trash, and reopen it.
- One cache is huge. Some apps let caches grow to several gigabytes. Clearing that one cache is reasonable when you need the space now, knowing it may grow back.
- Your disk is nearly full and you need room for an update. Caches are a quick, safe win, but look at the bigger wins first.
What not to do
- Don't delete your whole Library folder, or folders in it other than Caches. Application Support, Containers and Keychains hold your data, settings and saved passwords.
- Don't clear caches of apps that are open.
- Don't run cache-cleaning commands with
sudo rm -rfand wildcards, from forums or anywhere else. One typo can delete far more than caches. - Don't clear cookies by reflex. You'll be signed out of websites and lose site settings, usually for no gain.
- Don't make it a weekly routine. Clearing caches on a schedule makes your apps slower each time they rebuild them, and saves nothing for long.
How Tend helps
Tend's Clean Up page lists each app's cache in your Library with its size, for free, so you can see which ones are worth clearing. It doesn't pre-select caches of apps that are open or caches macOS uses, and with Tend Pro it moves what you choose to the macOS Trash, so you can put it back. Tend Pro's Privacy page also clears browser history, cookies, caches, the downloads list and saved form entries for Safari, Chrome, Brave, Edge, Arc and Firefox. It never touches saved passwords or bookmarks, and its files go to the Trash too, except saved form entries, which are cleared permanently; Tend tells you before it does that. What the storage list shows.
Questions
Is it safe to delete cache files on a Mac?
Your browsers' caches and your own apps' caches in ~/Library/Caches are safe to delete, one app at a time with the app quit; the app rebuilds them. Don't delete system caches in /Library, /System or /private. macOS manages those and clears the safe ones itself.
How do I clear cache and cookies on a Mac?
In Safari, choose Safari › Settings › Privacy › Manage Website Data and click Remove All. In Chrome, use More › Delete browsing data and select Cookies and other site data and Cached images and files. In Firefox, use Settings › Privacy and security › Clear browsing data. Clearing cookies signs you out of websites.
Will clearing cache delete my passwords or bookmarks?
No. Clearing the cache only removes temporary copies of web pages and app files; saved passwords and bookmarks aren't part of it. Clearing cookies does sign you out of websites, but it doesn't delete the passwords you saved. In Chrome's Delete browsing data, leave the passwords option unchecked.
Does clearing cache make my Mac faster?
Rarely. Caches exist to make things faster, so clearing them usually makes the next launch or page load slower while they're rebuilt. It can fix a misbehaving app or page, and it frees space for a while. If your Mac is slow, the cause is usually elsewhere.
How often should I clear my Mac's cache?
There's no need to do it on a schedule. macOS clears safe caches itself when space is needed. Clear a specific cache when an app or website misbehaves, or when one cache has grown very large and you need the space.
Related guides
How to free up space on your Mac, safely
The order that frees the most space for the least risk.
What is System Data on Mac?
Caches are part of it. Here's the rest.
CleanMyMac alternatives
Do you need a cleaner app at all? Free and paid options by job.
Why is my Mac so slow?
How to find the real cause, step by step.
Sources
- Apple, Optimize storage space on your Mac
- Apple, Free up storage space on Mac
- Apple, Clear your cache and cookies in Safari on Mac
- Apple, Clear your browsing history in Safari on Mac
- Apple, Change Advanced settings in Safari on Mac
- Apple Developer, Develop menu
- Google, Delete browsing data in Chrome
- Mozilla, How to clear the Firefox cache
- Homebrew, brew(1) manual page
- npm, npm-cache
See which app caches are big, before you clear anything
Tend is free to download. Pro is $1.99 a month, $12.99 a year with a 7-day free trial, or $29.99 once.