How to Clear Cache on Mac: Safari, Chrome, System, Xcode
Short answer: to clear cache on a Mac, quit the app, open Finder, press Shift-Command-G, type ~/Library/Caches, and move that app’s folder to the Trash. Clear browser caches from the browser itself (Chrome: More › Delete browsing data › Cached images and files). Check sizes first with the read-only du -sh ~/Library/Caches, and never delete /System or the whole Library folder.
TL;DR
- Measure first:
du -sh ~/Library/Cachesonly reads sizes. It deletes nothing. - Browsers: clear cache from Safari, Chrome or Firefox settings, not from Finder.
- App caches: quit the app, then move its folder in
~/Library/Cachesto the Trash. - System caches: leave them alone. Safe mode clears certain system caches for you.
- Developers: the big wins are Xcode DerivedData, npm, Homebrew and Docker, each with its own command.
- Cache is not cookies: clearing cookies signs you out of websites.
What is cache on a Mac, and should you clear it?
Cache on a Mac is data that apps and macOS save so they can load things faster next time: web images, thumbnails, downloaded packages and build output. It is safe to clear most user caches because apps rebuild them, but clearing them rarely makes a Mac faster for long.
There are three good reasons to clear a cache:
- Something is broken. A website shows an old version, an app crashes on launch, or Xcode keeps failing a build that should pass. A corrupted cache is a common cause.
- It has grown huge. Developer caches in particular can reach tens of gigabytes. Measure before you assume.
- Your disk is nearly full. In that case caches are one part of the job; the full checklist is in how to free up disk space on a Mac.
If none of those apply, you can leave caches alone. macOS manages its own, and Apple’s guide to freeing storage on Mac does not tell you to clear caches by hand at all. It points you to System Settings › General › Storage (macOS Ventura 13 and later), emptying the Trash, removing unused apps and old iPhone backups.
How do I check how big my Mac’s cache is before deleting anything?
Run du -sh ~/Library/Caches in Terminal: it prints the total size of your user caches and changes nothing. Every command in this section is read-only, so you can run them all safely before you decide what to clear.
# Read-only: total size of your user caches
du -sh ~/Library/Caches
# Read-only: the 15 biggest app cache folders, largest last
du -sh ~/Library/Caches/* 2>/dev/null | sort -h | tail -15
# Read-only: developer caches (skip any you don't use)
du -sh ~/Library/Developer/Xcode/DerivedData
du -sh ~/.npm/_cacache
du -sh "$(brew --cache)"
docker system df
du may print “Permission denied” for a few folders that macOS protects. That is normal and harmless. If you want a visual version of the same numbers, how to check disk space on a Mac covers Storage settings, Disk Utility and analyzer apps.
How do I clear the cache in Safari, Chrome, Firefox and Arc?
Clear browser caches from inside the browser, never by deleting their folders in Finder, because each browser keeps cache, cookies and settings in different places. Here are the menu paths, checked against each vendor’s help pages as of November 2026.
| Browser | Where to clear cache | What to tick | Signs you out? |
|---|---|---|---|
| Safari | Safari › Settings › Privacy › Manage Website Data › Remove All | (removes all website data) | Yes |
| Chrome | More (three dots) › Delete browsing data | Cached images and files | Only if you also tick Cookies |
| Firefox | Settings › Privacy & Security › Cookies and Site Data › Clear Data | Temporary cached files and pages | Only if you also tick Cookies |
| Arc | Arc › Settings › Profiles › pick a profile › Clear Browsing Data | Cached images and files | Only if you also tick Cookies |
Safari
Apple’s cookie and website data guide gives the path: Safari › Settings › Privacy › Manage Website Data. Select one site and click Remove, or click Remove All. Apple warns that this “may also sign you out of websites or change website behavior.” To fix a single misbehaving site, remove only that site rather than everything.
History › Clear History is a different thing: per Apple’s history guide, it removes history, recent searches, the downloads list and site permissions. It is not the way to clear the cache on its own.
Chrome
Per Google’s Chrome help, open Chrome, click More (the three dots, top right) › Delete browsing data, choose a time range, tick Cached images and files, and click Delete data. Untick “Cookies and other site data” if you want to stay signed in.
Firefox
Mozilla’s guide uses Settings › Privacy & Security › Cookies and Site Data › Clear Data. In the dialog, tick the cache option (“Temporary cached files and pages” in recent versions) and leave cookies unticked to stay signed in. Firefox has renamed these labels between versions, so match by meaning if yours read slightly differently.
Arc
Arc’s help center routes you through Arc › Settings (Command-Comma) › Profiles, pick a profile, then Clear Browsing Data, which opens Arc’s Chromium settings where the same “Cached images and files” option lives. One caveat: The Browser Company has said Arc stops working on December 22, 2026, and it points users to its Dia browser. Clearing Arc’s cache is fine, but plan your move off Arc first.
How do I clear app caches in ~/Library/Caches?
Quit the app, open ~/Library/Caches in Finder, and drag that app’s folder to the Trash. The app recreates it on its next launch. Doing it one app at a time, instead of emptying the whole folder, keeps the damage small if something goes wrong.
- Quit the app completely (Command-Q, not just closing its window).
- In Finder choose Go › Go to Folder (Shift-Command-G), type
~/Library/Caches, and press Return. Apple’s Library folder help notes the folder is hidden by default; holding Option in the Go menu also reveals it. - Find the app’s folder. Most are named after the app’s bundle ID, such as
com.spotify.client. - Drag the folder to the Trash. Relaunch the app and check it works.
- Empty the Trash only after the app has run normally for a day or two.
Using the Trash instead of rm -rf is deliberate: if an app loses settings it should not have kept in a cache, you can put the folder back.
What about system caches in /Library/Caches?
Leave them alone. /Library/Caches (no tilde) holds caches shared by every user and by macOS itself, and some of it is in use while the Mac runs. If you suspect a corrupted system cache, start the Mac in safe mode: Apple says in the same storage article that the Mac “clears certain system caches, which are automatically created again as needed.” If your real problem is a large System Data figure in Storage settings, caches are only part of it; what System Data is and how to shrink it walks through the rest, including snapshots and logs.
How do I clear developer caches on a Mac (Xcode, npm, Homebrew, Docker)?
Each developer tool has a cache command of its own, and that command is safer than deleting folders by hand. Run the read-only size check first, then the clear command only for the tools that are actually large.
| Cache | Read-only size check | Clear it | What you lose |
|---|---|---|---|
| Xcode DerivedData | du -sh ~/Library/Developer/Xcode/DerivedData | Quit Xcode, then move the folder’s contents to the Trash | The next build of each project is a full rebuild |
| npm | du -sh ~/.npm/_cacache | npm cache clean --force | Packages download again on next install |
| Homebrew | brew cleanup -n and du -sh "$(brew --cache)" | brew cleanup | Old versions and downloads older than 120 days |
| Docker | docker system df | docker system prune | Stopped containers, unused networks, dangling images, build cache |
Xcode DerivedData
DerivedData holds Xcode’s build products and indexes, by default at ~/Library/Developer/Xcode/DerivedData. Xcode rebuilds it, so the cost of clearing it is one slow full build per project. Quit Xcode first, and do not clear it during a build or test run.
# Read-only: size per project, largest last
du -sh ~/Library/Developer/Xcode/DerivedData/* 2>/dev/null | sort -h | tail -10
Then move the folders you don’t need to the Trash in Finder. Do not delete ~/Library/Developer/Xcode/Archives the same way: archives are your shipped builds and their debug symbols, and Xcode can’t regenerate them.
npm
The npm cache docs describe the cache as self-healing and say clearing it is usually unnecessary, which is why clean requires --force. npm cache verify checks the cache and garbage-collects data it no longer needs, which is the gentler first step.
npm cache verify # checks and garbage-collects; keeps valid entries
npm cache clean --force # removes the whole cache
Homebrew
brew cleanup -n is a dry run: per the Homebrew manual, it shows “what would be removed, but do not actually remove anything.” A plain brew cleanup then removes outdated downloads, old versions of installed formulae and downloads more than 120 days old. brew cleanup --prune=all removes all cached downloads regardless of age.
brew cleanup -n # read-only dry run
brew cleanup # removes what the dry run listed
Docker
docker system df shows how much space images, containers, local volumes and build cache use, and how much is reclaimable. docker system prune removes stopped containers, unused networks, dangling images and unused build cache. Per Docker’s docs, “by default, volumes aren’t removed to prevent important data from being deleted.”
Warning:
docker system prune -aalso removes every image not used by a container, and adding--volumesdeletes volumes, which can include database data. Read the confirmation prompt before you typey.
On a Mac, Docker Desktop keeps all of this inside one disk image, so the Finder view doesn’t tell you much. Docker disk space on Mac covers that image in detail, and what’s eating a developer’s Mac disk covers node_modules, simulators and local AI models too.
What should you never delete when clearing cache on a Mac?
Never delete anything under /System, the whole ~/Library folder, or folders that hold your data rather than a cache. The table lists the folders that most often get deleted by mistake.
| Folder | Why it is not a cache |
|---|---|
/System and /Library/Caches | Used by macOS itself; protected or in use |
~/Library/Application Support | App data, databases and settings |
~/Library/Containers and ~/Library/Group Containers | Sandboxed apps’ real data and shared settings |
~/Library/Keychains | Your saved passwords |
~/Library/Developer/Xcode/Archives | Shipped builds and debug symbols |
| Docker volumes | Database and app data inside containers |
| Cookies and website data | Your logins (clearing them is safe but signs you out) |
Do you need a Mac cache cleaner app?
No. Everything above uses built-in tools, and most cache cleaner apps run the same steps with a nicer interface. A cleaner app is worth it if you want one scan across every app and tool, but read what it plans to delete before you click. If you are comparing paid cleaners, see our roundup of CleanMyMac alternatives.
We make FavTray, so weigh our take accordingly. FavTray is a macOS menu bar app with developer and productivity tools, free with daily limits on a few of them, and $4.99 once for Lifetime. Its Space tool is a read-only disk map: it names caches such as Xcode DerivedData, package caches, Docker and browser caches, ranks what comes back by itself, and opens the app that owns the data, but it never deletes a file. You do the clearing with the steps above. Free shows your totals and a blurred top 3; Pro names every item. A dedicated cleaner does more automatically; Space is for people who want to see before they delete. Plans are on the pricing page.
Frequently Asked Questions
How do I clear all cache on my Mac?
There is no single button. Clear each layer separately: your browser's cache from its settings, app caches by quitting the app and moving its folder in ~/Library/Caches to the Trash, and developer caches with their own commands (npm cache clean --force, brew cleanup, docker system prune). Leave system caches in /Library/Caches alone; macOS rebuilds them, and starting in safe mode clears certain system caches for you.
Is it safe to delete the cache folder on a Mac?
Deleting a single app's folder inside ~/Library/Caches is generally safe if the app is quit first: the app rebuilds it on the next launch, which can make that launch slower. Do not delete the whole ~/Library folder, Application Support, Containers or Keychains, and do not touch /System. Move folders to the Trash instead of using rm, so you can put them back if an app misbehaves.
Does clearing cache speed up a Mac?
Usually not for long. Caches exist to make apps faster, so clearing them often makes the next launch or page load slower while the cache rebuilds. Clearing a cache helps when one is corrupted (a site or app behaves oddly) or when it has grown large enough to matter for disk space. It does not free RAM, because cache folders are files on disk, not memory.
What is the difference between clearing cache and clearing cookies on a Mac?
Cache is stored copies of images, scripts and files so pages load faster; clearing it costs you nothing but a slower first load. Cookies and website data hold your logins and site settings, so clearing them signs you out of websites. Apple warns that removing Safari's website data may sign you out and change how sites behave. Clear cache first; clear cookies only when a specific site is broken.
How much space does clearing cache free on a Mac?
It depends entirely on what you use, so measure before you delete. Run du -sh ~/Library/Caches for app caches, du -sh ~/Library/Developer/Xcode/DerivedData for Xcode, and docker system df for Docker. All three only read sizes and change nothing. On developer Macs, Xcode, package managers and Docker usually hold far more than browser caches do.