How to clear cache on a Mac (browsers, apps and system)
Clearing cache on a Mac means one of four things: your browser's cache, your apps' caches, system caches, or the DNS cache. Each lives in a different place and each fixes a different problem. Here's how to clear every one — the steps are the same on a MacBook Air, MacBook Pro, iMac or Mac mini.
Not sure whether you should? Read is it safe to delete cache files on a Mac? first. Short version: caches are safe to clear, but apps are slower until they rebuild them, and you may be signed out of some websites.
Clear the Safari cache
Safari hides its cache button in the Develop menu:
- Open Safari › Settings › Advanced and turn on Show features for web developers.
- Choose Develop › Empty Caches, or press ⌥⌘E.
This clears cached pages and images but keeps your history, cookies and logins. To remove those too, use History › Clear History… — that also deletes cookies and website data for the period you pick.
Clear the Chrome cache
- In Chrome, press ⇧⌘⌫ (Shift-Command-Delete), or open Settings › Privacy and security › Delete browsing data.
- Pick a time range — "All time" for a full clear.
- Tick only Cached images and files if you want to stay signed in to websites, then click Delete data.
Edge, Brave, Arc and other Chromium-based browsers use the same shortcut and a near-identical screen.
Clear the Firefox cache
- Open Firefox › Settings › Privacy & Security.
- Under Cookies and Site Data, click Clear Data….
- Tick Cached Web Content (untick cookies to stay signed in) and click Clear.
Clear app caches
Apps keep their caches in your user Library. This is usually where the gigabytes are.
- Quit the apps whose caches you'll clear.
- In Finder, press ⇧⌘G, type
~/Library/Cachesand press Return. - Switch to list view (⌘2), open View › Show View Options, turn on Calculate all sizes, then sort by Size.
- Open the biggest folders and move their contents — not the folders themselves — to the Trash.
- Restart your Mac, check your apps work, then empty the Trash.
App Store apps are sandboxed and keep their caches inside their containers instead: ~/Library/Containers/app name/Data/Library/Caches. The same rules apply.
Some apps have their own button, and it's the better choice: Spotify (Settings › Storage › Clear cache), Slack (Help › Troubleshooting › Clear Cache and Restart), Microsoft Teams, Adobe apps and Lightroom all have one. Use it before deleting files by hand.
Clear system caches
System-wide caches live in /Library/Caches (no tilde). Most of what's in there belongs to macOS or to software installed for every user, and macOS cleans much of it itself. If you want to clear it anyway:
- Safe mode is the safest way. Starting up in safe mode clears some system caches automatically. On Apple silicon, shut down, hold the power button until you see startup options, select your disk, then hold ⇧ and click Continue in Safe Mode. On Intel, hold ⇧ while the Mac starts. Then restart normally.
- Never touch
/System/Library/Cachesor/private/var/folders— macOS manages those, and restarting is how you clear them.
Clear the DNS cache
If a website won't load on your Mac but works on your phone, or you've just changed a domain's DNS, flush the DNS cache. Open Terminal and run:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
Enter your admin password when asked. Nothing is printed when it works. This frees no disk space — it only makes macOS look up web addresses again.
Developer caches
If you write code, your biggest caches probably aren't in ~/Library/Caches at all: Xcode's DerivedData, npm, Gradle, Homebrew and Docker can each use tens of gigabytes. See deleting Xcode DerivedData and other Xcode junk, and run brew cleanup or npm cache clean --force for those tools.
"Clear RAM" is a different thing
Memory (RAM) isn't a cache you need to empty. macOS fills spare memory with data it may need again and frees it the moment an app asks. Apps that "clean RAM" mostly force apps to reload what they had. If your Mac is slow, quit the apps using the most memory in Activity Monitor › Memory, or restart.
See how big your caches are first
SpaceSweep measures your user cache, app caches and logs for free, alongside the Trash, Xcode junk and Mail downloads, so you can see whether clearing them is worth it.
Scan your Mac freeQuestions
What is the shortcut to clear cache on a Mac?
In Safari, press Option-Command-E after turning on Show features for web developers in Safari's Advanced settings. In Chrome, Edge and Brave, Shift-Command-Delete opens the Delete browsing data screen.
Does clearing cache delete passwords?
No. Clearing only the cache keeps your saved passwords and usually your logins. Clearing cookies or website data as well signs you out of websites, but saved passwords in your keychain or browser stay.
How do I clear all cache on my MacBook at once?
There's no single built-in button. Clear your browser cache from its settings, then delete the contents of the folders in ~/Library/Caches with the apps quit, and restart. A cleaner app such as SpaceSweep can measure and clear user caches and logs in one step.
Will clearing cache speed up my Mac?
Rarely. It frees disk space and can fix a misbehaving app or website, but apps are briefly slower while they rebuild what was cached.