How to Clear Cache on Mac: The Complete 2026 Guide
"Clear your cache" is the first thing anyone suggests when your Mac is slow, running out of space, or acting weird. But there are actually five different types of cache on your Mac, and they each live in different places.
Here's every type, where to find it, and how to clear it safely.
Quick reference
| Cache type | Typical size | Safe to delete? | Location |
|---|---|---|---|
| Browser cache | 1–10 GB | ✅ Yes | Browser settings |
| App cache | 5–50 GB | ✅ Yes | ~/Library/Caches/ |
| System cache | 2–10 GB | ⚠️ Mostly | /Library/Caches/ |
| DNS cache | Tiny | ✅ Yes | Memory only |
| Developer cache | 5–50 GB | ✅ Yes | Various |
1. Browser cache
Safari
- Open Safari → Settings (Cmd+,)
- Advanced tab → check "Show features for web developers"
- Develop menu → Empty Caches
Chrome
- Cmd+Shift+Delete
- Select "Cached images and files"
- Time range: All time → Clear data
Firefox
- Cmd+Shift+Delete
- Check "Cache" → Clear Now
Browser caches are always safe to delete. Sites will just load slightly slower on first visit.
2. App cache
This is the big one. App caches live in ~/Library/Caches/ and can easily total 20–50 GB:
open ~/Library/Caches
Common space hogs:
- Spotify — 2–8 GB of offline music cache
- Slack — 1–5 GB of message and file cache
- Google Chrome — 2–10 GB across profiles
- Microsoft Teams — 1–4 GB
- Docker — 5–30 GB of image layers
You can delete individual app cache folders. The app will recreate them — you might just need to log in again.
3. System cache
System-level caches live in /Library/Caches/ (note: no tilde). These include font caches, kernel caches, and shared framework caches.
sudo open /Library/Caches
⚠️ Be more careful here. Most items are safe, but some system caches help macOS boot faster. When in doubt, leave it.
4. DNS cache
If websites aren't loading or you're getting "server not found" errors, clearing DNS cache often helps:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
This is instant and has zero risk.
5. Developer caches
If you code on your Mac, these can be enormous:
| Tool | Location | Typical size |
|---|---|---|
| Xcode DerivedData | ~/Library/Developer/Xcode/DerivedData/ | 5–30 GB |
| npm cache | ~/.npm/ | 1–5 GB |
| Homebrew cache | ~/Library/Caches/Homebrew/ | 1–10 GB |
| pip cache | ~/Library/Caches/pip/ | 0.5–3 GB |
| CocoaPods | ~/Library/Caches/CocoaPods/ | 1–5 GB |
| Docker images | ~/Library/Containers/com.docker.docker/ | 5–50 GB |
All of these are safe to delete. Run npm cache clean --force, brew cleanup, or just delete the folders directly.
Skip the manual work
CleanDisk finds all five cache types in 60 seconds. Every item is labeled safe, review, or protected.
Download CleanDisk — Free ScanHow often should you clear cache?
For most people, once a month is enough. If you're a developer or creative professional, every two weeks is better — your caches grow faster.
Signs you need to clear cache now:
- Mac says storage is almost full
- Apps are running slower than usual
- You see "System Data" using 50+ GB in Storage settings
- You haven't cleared cache in 6+ months
Is it safe to clear all caches at once?
For user-level caches (~/Library/Caches/): yes, completely safe. The worst that happens is apps take a moment to rebuild their cache on next launch.
For system-level caches: mostly safe, but it's better to be selective. That's why CleanDisk labels every item — so you know exactly what you're deleting.
The hidden caches most guides miss
Most "clear cache on Mac" articles cover browser and app caches. But the biggest space wasters are often caches that don't live in ~/Library/Caches/ at all.
Xcode DerivedData (5–80 GB)
If you've ever opened Xcode, you have a DerivedData folder at ~/Library/Developer/Xcode/DerivedData/. It stores compiled binaries, index data, and build logs for every project you've ever opened — and Xcode never cleans it up, even after you delete the project.
du -sh ~/Library/Developer/Xcode/DerivedData/ rm -rf ~/Library/Developer/Xcode/DerivedData/*
Completely safe. Xcode rebuilds on next compile. See our complete DerivedData guide for details.
Docker images and volumes (5–100 GB)
Docker stores images, containers, and volumes in ~/Library/Containers/com.docker.docker/Data/vms/0/data/. Even stopped containers and unused images consume space. Clean up with:
docker system prune -a --volumes
This removes all stopped containers, unused images, and orphaned volumes. Active containers are not affected.
npm, pnpm, and yarn cache (1–15 GB)
JavaScript package managers cache every package you've ever installed:
# Check sizes npm cache ls 2>/dev/null | wc -l du -sh ~/.npm/ ~/.pnpm-store/ ~/Library/Caches/Yarn/ 2>/dev/null # Clean all three npm cache clean --force pnpm store prune yarn cache clean
Homebrew downloads (1–10 GB)
Homebrew keeps downloaded bottles (installers) even after installation:
brew cleanup --prune=all
This removes all cached downloads and old versions. The installed packages are not affected.
pip and conda cache (0.5–8 GB)
# pip pip cache purge # conda conda clean --all
Premiere Pro Media Cache (5–50 GB)
Adobe Premiere stores transcoded media at ~/Library/Application Support/Adobe/Common/Media Cache Files/. This persists even after you delete the Premiere project. It's one of the largest single caches we've seen — one user had 52 GB from projects deleted months ago. Clear it in Premiere: Edit → Preferences → Media Cache → Delete.
How to automate cache cleaning
Manual cleaning works, but it's easy to forget. Here are three approaches:
Option 1: Scheduled Terminal script
Create a shell script that clears the safest caches and run it monthly via cron or a calendar reminder:
#!/bin/bash # safe-cache-clean.sh rm -rf ~/Library/Caches/* rm -rf ~/Library/Developer/Xcode/DerivedData/* rm -rf ~/Library/Logs/* brew cleanup --prune=all 2>/dev/null npm cache clean --force 2>/dev/null echo "Cache cleared at $(date)"
⚠️ This script deletes everything in ~/Library/Caches/ — safe for most users, but you'll need to re-login to some apps afterward.
Option 2: Use CleanDisk
CleanDisk scans all five cache categories in 60 seconds and labels every item by safety level. It finds caches that a simple rm -rf ~/Library/Caches/* misses — like Xcode DerivedData, Premiere Media Cache, and Docker images. The scan is free; deleting requires a $2.99/month subscription.
Option 3: Use OnyX (free)
OnyX can clear system and user caches via its Maintenance tab. It's free but doesn't cover creative app caches or developer tool caches. Good for basic system maintenance. See our full comparison of Mac cleaners.
Frequently asked questions
Will clearing cache delete my passwords or logins?
Browser cache: no — passwords are stored separately from cache. App cache: some apps store session tokens in their cache folder, so you might need to log in again to apps like Slack or Spotify. Your actual passwords in Keychain are never affected.
How much space will I get back?
Based on our analysis of 50 Macs, the average user reclaimed 42 GB. General users typically get 15–30 GB back, developers 30–60 GB, and video editors 50–100+ GB. Run du -sh ~/Library/Caches/ in Terminal for a quick estimate.
Should I clear cache before or after a macOS update?
Before, ideally. macOS updates need significant free space (often 20+ GB) for the download and installation. Clearing cache before updating ensures the installer has room. After the update, old caches from the previous OS version are no longer useful — a good time to clean again.