How to Clear Cache on Mac (Safely, and Only What's Safe)
Clearing cache on a Mac is safe, because a cache is by definition data an app can rebuild. The risk is never in deleting a real cache; it is in blind tools and blind commands that treat everything in a Library folder as disposable and take an active profile or a preferences file along with the junk. The skill worth learning is telling cache apart from data, and then clearing only the cache.
Here is what each kind is, where it lives, and how to clear it without collateral damage.
Cache, state, and data are three different things
Everything an app keeps outside its bundle falls into one of three buckets, and only the first is safe to delete freely:
- Cache is recomputable: rendered thumbnails, compiled output, downloaded files kept for speed. Deleting it costs only a slower next launch.
- State is your session: open windows, scroll positions, drafts. Losing it is annoying but not catastrophic.
- Data is irreplaceable: your messages, your photos library, your saved logins. Deleting it is a real loss.
The folders below mix these, which is exactly why "clear all cache" tools are
risky. A folder inside ~/Library/Caches is usually cache, but not always, and
the folders next to it often are not.
Where cache lives on a Mac
~/Library/Caches/holds per-app user caches, the largest everyday group. Each subfolder is named by bundle identifier, likecom.google.Chrome./Library/Caches/holds system-wide caches./System/...is protected by System Integrity Protection and is not yours to touch. Never try.
Preferences deserve a special warning. Files in ~/Library/Preferences are your
settings, not cache, and macOS caches them in memory through a daemon called
cfprefsd. If you delete a .plist by hand while the app or cfprefsd still
holds it, the daemon simply writes it back on quit, so the deletion looks like it
did nothing. Preferences should be changed with defaults, not deleted as if they
were cache.
The caches worth clearing, and the big ones
Find your largest caches before clearing anything:
du -sh ~/Library/Caches/* 2>/dev/null | sort -h
The heaviest lines are usually:
- Browsers. Safari, Chrome, and others hold gigabytes of cached pages and media. Clear these from the browser's own settings, which is safer than deleting the folder, since it separates cache from your history and logins.
- Developer tools, which dwarf everything else on a coding Mac. Xcode's
~/Library/Developer/Xcode/DerivedDatacan reach tens of gigabytes, and package managers keep their own stores:brew cleanupclears old Homebrew downloads,npm cache clean --forceclears the npm cache, and~/Library/Caches/holds caches for Swift Package Manager, pip, and others. - QuickLook thumbnails, rebuilt on demand:
qlmanage -r cache.
Always quit the owning app first. Cache files are often open or memory-mapped while the app runs, and deleting them mid-write can corrupt the cache database the app depends on, which turns a space cleanup into a broken app.
The safer way, by category with review
Doing this by hand works but is tedious and easy to get wrong, since folder names
do not always match app names and some folders under Caches are not cache at
all. A cleaner that groups caches and shows each one's size and location before
touching anything removes the guesswork. Mole's Clean view scans across
categories (app and system caches, browsers, developer and AI tool caches, design
apps, logs, purgeable snapshots, and leftovers from uninstalled apps), lists what
it found with sizes, sends removals to the Trash so they stay recoverable, and
truncates live log files in place rather than pulling them out from under a running
app. It deliberately skips what should never be swept: browser profiles and
history, iCloud documents, local AI model stores and chat transcripts. That
skip-list is the real value over a blind rm -rf of a Caches folder.
What not to clear, even in the name of cache
- AI assistant chat history and transcripts. These sit near caches but are irreplaceable data. Never delete them for space.
- Preferences and saved logins, as opposed to disposable cache.
- Anything under
/System. - Any folder whose purpose you cannot identify.
The rule is the one that keeps every Mac cleanup safe: if you cannot tell what a file is for, do not delete it.
The short version
A cache is anything an app can rebuild, which is why clearing it is safe and why
the space slowly returns; treat it as maintenance, not a one-time fix. Learn to
separate cache from state and data, find your big caches with
du -sh ~/Library/Caches/* | sort -h, clear browsers from their own settings and
developer caches with brew cleanup and by emptying DerivedData, quit apps first,
and never delete preferences, chat histories, or anything you cannot identify.
Caches are also the largest part of the System Data
block, so clearing them well is often the biggest safe win when that number grows.