How to clear cache on Mac (and when it's not worth it)

How big is your Mac's cache?: a Finder window titled Caches, with the first row of folders in focus: Adobe, Adobe Camera Raw 2, Animoji, ARFileCache, and askpermissiond.

Before deleting anything, find out how big your caches really are. Open Terminal and run:

du -sh ~/Library/Caches/* 2>/dev/null | sort -h | tail -20

That lists your 20 largest app cache folders, biggest last. If the total is a few hundred megabytes, clearing it won't fix a full disk, and you can skip to where the space actually is. If one folder is many gigabytes, you've found what to deal with.

The rest of this guide covers how to clear each kind of cache, which ones come straight back, and which folders that look like caches you should leave alone.

What a cache is, according to Apple

Apple tells developers that the Caches folder is for "app-specific support files that your app can re-create easily", and that an app "does not require cache data to operate properly, but it can use cache data to improve performance" (Apple File System Programming Guide).

Two things follow from that:

Not every large cache lives in ~/Library/Caches. Browsers, Electron apps and developer tools keep big rebuildable folders elsewhere, often next to data you do want to keep. Both are covered below.

When clearing a cache actually helps

When it doesn't help, or hurts

How to clear app caches in ~/Library/Caches

  1. Quit the app whose cache you want to clear. A running app keeps writing to the folder.
  2. In Finder, choose Go > Go to Folder (Shift-Command-G), type ~/Library/Caches and press Return.
  3. Switch to List view, choose View > Show View Options, turn on "Calculate all sizes", then sort by Size.
  4. Move the app's folder (or its contents) to the Trash. Don't trash the Caches folder itself.
  5. Open the app and check it works. Then empty the Trash; until you do, you get no space back (Apple Support).

Use the Trash rather than rm -rf. If an app misbehaves afterwards, you can put the folder back.

Leave the Caches folder itself in place: delete what's inside it, not the folder. Some com.apple.* folders in there belong to background services that are always running, so they can be recreated or locked while you work. If Finder says an item is in use, skip it or restart first.

How to clear browser caches

Use the browser's own controls. Browsers keep an index of what's cached, and the built-in button clears both.

Chrome's other big folder

Chrome keeps its ordinary page cache under ~/Library/Caches/Google/Chrome, but your profile (history, settings, site data) lives in ~/Library/Application Support/Google/Chrome (Chromium docs). Inside the profile, websites' service workers (the scripts that make sites work offline and send notifications) keep their own storage in:

~/Library/Application Support/Google/Chrome/Default/Service Worker/CacheStorage

It can get large: one user on Reddit reported 41 GB in this folder (r/MacOS). That's a single report, not a typical figure, so check your own with du -sh on that folder.

It isn't purely cache: sites can use it for offline content, so clearing it may make some sites slower or sign you out of web apps that rely on it (Super User).

To clear it, quit Chrome fully and delete the contents of CacheStorage, not anything above it. Or remove one site's data from inside Chrome: Settings > Privacy and security > Third-party cookies > See all site data and permissions, search for the site and click Delete (Chrome Help). That also removes the site's cookies, so you'll be signed out of it.

Where the space actually is

On many Macs, especially ones used for development, the biggest rebuildable data isn't in ~/Library/Caches at all. Measure these too:

du -sh ~/Library/Developer/Xcode/DerivedData \ ~/Library/Developer/Xcode/iOS\ DeviceSupport \ ~/Library/Developer/CoreSimulator \ ~/Library/Caches/Homebrew \ ~/.npm/_cacache ~/Library/Caches/pip ~/Library/Caches/Yarn \ ~/Library/Containers/com.docker.docker \ ~/Library/Application\ Support/MobileSync/Backup \ 2>/dev/null | sort -h

Folders you don't have just won't show up. Then use each tool's own clean-up command, which knows what's safe to remove:

WhatWhereHow to clearRegrows?Safe?
Xcode build data~/Library/Developer/Xcode/DerivedDataQuit Xcode and delete the folder's contentsYes, on the next build of each projectYes; it's generated at build time, so the next build of each project is a full one and re-indexes (Stack Overflow)
iOS DeviceSupport~/Library/Developer/Xcode/iOS DeviceSupportDelete folders for iOS versions you no longer debug onYes; Xcode copies the support files from the device again when you connect itYes (Ask Different)
Simulator runtimesManaged by XcodeXcode > Settings > Components, click the information button next to a runtime, then Delete (Apple)Only if you download it againYes; Xcode shows how much space each frees
Simulator devices~/Library/Developer/CoreSimulatorxcrun simctl delete unavailable deletes devices "not supported by the current Xcode SDK" (from xcrun simctl help delete)Only if you create new onesDeletes permanently, including any apps and data inside those simulators
Homebrew downloads~/Library/Caches/Homebrewbrew cleanup --prune=all (Homebrew docs)Yes, on each install or upgradeYes. Homebrew already removes downloads older than 120 days on its own
npm~/.npm/_cacachenpm cache clean --force (npm docs)Yes, on next installYes. npm says its cache is self-healing, so only clear it for space; it never shrinks on its own
pip~/Library/Caches/pippython3 -m pip cache purge (pip docs)YesYes
Yarn (classic, v1)~/Library/Caches/Yarnyarn cache clean; yarn cache dir shows where it is (Yarn docs)Yes, "the next time yarn or yarn install is run"Yes
DockerDocker Desktop's disk imagedocker system prune (Docker docs)Yes, as you pull and buildRemoves stopped containers, unused networks, dangling images and build cache. -a also removes all unused images. Volumes are kept unless you add --volumes, which prunes unused anonymous volumes
iPhone/iPad backups~/Library/Application Support/MobileSync/Backup (Apple)In Finder, connect the device by USB, select it, and on the General tab click Manage Backups; right-click a backup and choose Delete (Apple)Yes, on next backupNot a cache. Delete only backups you're sure you don't need
Chrome service workerssee abovesee aboveYesMostly; may sign you out of some web apps
Apps built on Electron (many chat and code-editor apps)By default ~/Library/Application Support/AppName, in Chromium's Cache and GPUCache subfoldersQuit the app, delete those subfolders onlyYesYes for those; the same folder also holds cookies and local storage, so leave the rest (Electron docs)

Paths vary by app version and install method, and some apps store data elsewhere; check with du before deleting. Electron's documentation says apps' data folder sits under ~/Library/Application Support by default and that Chromium creates its own Cache and GPUCache subfolders there, next to "localStorage, cookies, disk cache, downloaded dictionaries, network state, DevTools files and compiled GPU shaders" (Electron docs). Only the cache folders are safe to remove.

Leave these alone

What "purgeable" space means

In Finder or Disk Utility you may see "available" space that's larger than "free" space. The difference is purgeable space: data, such as disk caches, that macOS can remove on its own when it needs room. Apple says "disk space might be both available and used at the same time" (Apple Support), and Disk Utility's help says "You can't manually remove the files that are designated purgeable, but macOS removes them as space is required" (quoted in Apple Community).

Howard Oakley, who has traced this in macOS logs, found that the figures come from a macOS service called CacheDelete, which purges registered caches (such as Quick Look thumbnails and Mail caches) first and Time Machine local snapshots last (Eclectic Light, Eclectic Light). Two practical points from his testing:

So if most of your "used" space is purgeable caches, there's nothing to clear by hand. Snapshots are the exception worth acting on.

Doing it with an app

If you'd rather not run commands, Purge is a free, open-source Mac cleaner (source on GitHub) that scans ~/Library/Caches, sandboxed app caches and developer caches like Xcode, Homebrew, npm, Yarn and Docker Desktop, and shows sizes before you delete anything. It moves files to the Trash, so you can restore them. The exceptions are iOS simulators and Time Machine local snapshots, which can't go to the Trash and are deleted permanently. Everything it does, you can also do by hand with the steps above.

Quick answers

Is it safe to delete everything in ~/Library/Caches?

Mostly, if the apps are quit and you delete the contents rather than the folder. Expect slower first launches and possibly some sign-outs. It's rarely the best place to get space back.

Why did my caches come back?

Because apps rebuild them as you use them. That's normal and is what they're designed to do.

Will clearing cache speed up my Mac?

Usually not. It can fix a specific app or website that's misbehaving.

How do I clear the system cache?

Start up in safe mode, then restart normally (Apple Support).

You may see "Safe Boot" in red at the top right of the login window. To leave safe mode, choose Apple menu > Restart.