How to Clear Cache on Your Mac
Updated · MintDisk team
A cache is a copy of data that an app keeps so it can load faster next time: web pages and images in a browser, thumbnails in a photo app, downloaded packages in a developer tool. Caches can be rebuilt, which is why clearing them is usually safe. It is also why the space comes back as you use your apps again.
This guide shows how to clear cache on Mac in three groups, browsers, apps and developer tools, using each tool's own option first. Clear a cache when you need the space or when an app misbehaves; there is no benefit in doing it every week.
Each section starts with the safest option, the one built into the app, and only then shows where the files live, so you can stop at the level you are comfortable with.
Before you start
- Quit the app whose cache you want to clear. An app that is running can recreate files while you delete them, or crash.
- Expect a slower first launch. The app has to download or rebuild what was cached.
- Caches are not your data. Never delete folders in
~/Libraryother thanCachesunless you know what they hold: Application Support, Containers and Preferences contain settings and documents.
macOS already clears some caches that are safe to delete on its own, including Safari website data and interrupted downloads. Starting up in Safe Mode clears certain system caches too.
Clear the Safari cache
Safari keeps its cache option in the Develop menu, which is hidden by default.
- Choose Safari > Settings, click Advanced and select Show features for web developers.
- Choose Develop > Empty Caches in the menu bar.
Emptying caches keeps your history and cookies. To remove website data as well, choose Safari > Settings > Privacy > Manage Website Data, then Remove or Remove All. To clear browsing history, choose History > Clear History and pick a time range.
Removing website data or cookies can sign you out of websites and reset site preferences. With iCloud for Safari turned on, clearing history removes it on all your devices.
Clear the Chrome and Firefox cache
Google Chrome
- Click the More menu (three dots) at the top right and choose Delete browsing data.
- Choose a time range, such as All time.
- Select Cached images and files. Leave Cookies and other site data unchecked unless you also want to sign out of websites.
- Click Delete data.
If you are signed in to Chrome with sync, Google notes that deleting browsing data also removes it from your other synced devices.
Mozilla Firefox
- Open Firefox Settings and go to Privacy & Security.
- Under Cookies and Site Data, click Clear Data.
- Keep only Temporary cached files and pages selected and click Clear.
Clear app caches in Library/Caches
Apps store their caches in the Caches folder inside your Library. Apple's developer guidelines describe this folder as data that can be regenerated as needed, and tell apps never to rely on cache files being there.
- Quit the app you want to clean up.
- In Finder, choose Go > Go to Folder (Shift-Command-G) and enter
~/Library/Caches. - Switch to list view and sort by size. Folders are usually named after the app's identifier, such as
com.example.app. - Move the folder of that app to the Trash. Open the app to check that it works, then empty the Trash.
Delete the cache of one app at a time, and only inside ~/Library/Caches. Don't empty the whole Caches folder while apps are running, and don't touch /Library/Caches or /System: those belong to macOS and other users.
Many apps also have a clear-cache option in their own settings, for example chat and design apps. Using it is the safest choice, because the app knows exactly which files are disposable.
Clear developer caches
Package managers and build tools keep their own caches, often several gigabytes each. Use their own commands; they know what is safe to remove.
| Tool | Command | What it does |
|---|---|---|
| npm | npm cache verify | Checks the cache and garbage-collects data it no longer needs |
| npm | npm cache clean --force | Deletes the whole npm cache; npm downloads packages again when needed |
| pnpm | pnpm store prune | Removes packages that no project uses any more |
| Homebrew | brew cleanup | Removes old downloads and outdated versions; add -n to preview |
| pip | python3 -m pip cache purge | Removes pip's wheel and HTTP caches |
| Cargo | cargo clean | Run inside a project: deletes that project's target build folder |
npm's own documentation says that clearing its cache should never be necessary except to reclaim disk space, because the cache is self-healing. Cargo also cleans its download cache automatically: files it would need the network to recreate are deleted after three months unused.
Xcode, Docker and local AI models usually take even more space than package caches. They have their own guides: Xcode DerivedData, Docker disk usage, Ollama storage, Gradle cache and Python cache.
When not to clear a cache
- Right before you go offline. Apps that work offline, such as maps, music or developer tools, need their caches without a network.
- On a slow or metered connection. Everything cleared has to be downloaded again.
- As a routine. Caches that come back within a day bring no lasting space; clear them when space is tight or an app misbehaves.
Questions and answers
Does clearing cache make my Mac faster?
Usually not. Caches exist to make apps faster, so the first launch after clearing is often slower. Clearing helps when an app shows outdated content or misbehaves, and when you need the disk space.
Why did the space come back after a few days?
Because the apps rebuilt their caches as you used them. That is expected; the space you gain lasting is the cache of apps you no longer use.
Can I delete the whole ~/Library/Caches folder?
It is not recommended. Apps that are running can misbehave when their cache disappears, and you lose the speed benefit for every app at once. Clear the caches of specific apps instead, with each app closed.
Is clearing a browser cache the same as clearing history?
No. The cache holds copies of pages and images; history is the list of sites you visited; cookies keep you signed in. Each browser lets you clear them separately.
Where is the cache of one specific app?
Usually in ~/Library/Caches under the app's bundle identifier. To find the identifier, run osascript -e 'id of app "AppName"' in Terminal, replacing AppName with the app's name as it appears in Applications.
Does Safe Mode clear caches?
Apple says starting up in Safe Mode clears certain system caches, which macOS recreates as needed. It is mainly a troubleshooting step, and a temporary way to free space, for example for a macOS update.
Is clearing cache the same as Optimize Storage?
No. Optimize Storage removes watched Apple TV content and old mail attachments, and Store in iCloud moves files to iCloud Drive. Neither touches app caches; macOS clears those it considers safe on its own.
Review caches before you clear them
MintDisk's deep cleanup scans system, browser, app and developer caches with a read-only scan, explains each item, and pre-selects only the ones rated safe. You confirm the plan before anything is removed. Note that cleaned caches are deleted permanently, not moved to the Trash, which is why only caches that apps rebuild are listed.
Related
Sources
- Apple Support: Free up storage space on your Mac
- Apple: Clear your cache and cookies in Safari on Mac
- Google Chrome Help: Clear cache & cookies
- Mozilla Support: How to clear the Firefox cache
- Apple: macOS Library directory details
- npm Docs: npm cache
- pnpm: pnpm store
- Homebrew: Manpage (brew cleanup)
- pip: pip cache
- The Cargo Book: Configuration (cache cleanup)
First published . Commands and menu paths were checked against the sources above on the update date.