Common Junk Files Safe to Delete on Mac
Your Mac has been faithfully running for a year or two, and suddenly that familiar warning pops up: “Your startup disk is almost full.” You glance at your storage graph in System Settings and see a sea of grey labelled “Other” or “System Data.” It’s frustrating because you haven’t saved any new movies or gigantic files — so where did all that space go?
The answer, almost always, is junk files. Cache folders, build artifacts, old backups, downloaded packages, and stale logs quietly pile up in the background while you focus on real work. Most of them are safe to remove. Here’s what to look for and what you can safely toss.
Browser Caches
Every time you visit a website, your browser saves images, scripts, and other assets locally so the page loads faster on your next visit. Over months and years, these saved files add up fast.
- Safari:
~/Library/Caches/com.apple.Safari/ - Chrome:
~/Library/Caches/Google/Chrome/ - Firefox:
~/Library/Caches/Firefox/
Each of these folders can easily grow to several gigabytes. You can delete these without worry — your browser will rebuild its cache automatically as you browse. You won’t lose passwords, bookmarks, or history. The only side effect is that pages may load slightly slower for a day or two until the cache fills back up.
To clear Safari’s cache directly: go to Safari → Settings → Advanced, enable the Develop menu, then choose Develop → Empty Caches. For Chrome, open Settings, search for “Clear browsing data,” and select Cached images and files.
System and App Caches
Beyond browsers, every application on your Mac stores its own cache in ~/Library/Caches/. Spotify caches album art, Xcode caches compiler data, Slack caches message assets — it all ends up here. Open the folder in Finder with Go → Go to Folder (⌘⇧G) and type ~/Library/Caches/.
You can safely delete the contents of individual app subfolders — but do not delete the Caches folder itself. Apps recreate their cache files the next time they run. If you see folders for apps you no longer have installed, those are leftover orphans and are dead weight.
On a typical Mac used for a couple of years, this folder can contain 5–15 GB of data.
System and App Logs
macOS and every app you run generate log files for debugging purposes. These live in two main places:
- User logs:
~/Library/Logs/ - System logs:
/var/log/
Log files are text records of events — crashes, network activity, app launches. They’re useful when you’re trying to diagnose a problem, but old logs from months ago are worthless. You can safely delete any log files you find in ~/Library/Logs/. The system will create new ones as needed.
System logs in /var/log/ are managed by macOS and generally compressed automatically. If you see very old .log files in there, you can remove them — macOS will create fresh ones on its own.
Xcode DerivedData
If you’re a developer who uses Xcode, this one alone might reclaim more space than everything else combined. Xcode stores all its build artifacts — compiled objects, indexes, and intermediate files — in:
~/Library/Developer/Xcode/DerivedData/
For an active developer working on multiple projects, this folder can grow to 20–50 GB without you ever noticing. Every time you build a project, Xcode adds more data here.
The good news: nothing bad happens if you delete the entire DerivedData folder. Xcode will simply rebuild from source the next time you open a project and hit Build. Your code, settings, and projects are completely untouched.
You can also clean it from within Xcode: go to Xcode → Settings → Locations and click the arrow next to the Derived Data path, then delete the contents from Finder.
iOS Device Backups
If you’ve ever backed up an iPhone or iPad to your Mac using Finder (or iTunes on older systems), those backups are stored in:
~/Library/Application Support/MobileSync/Backup/
A full iPhone backup can be anywhere from 5 GB to 30 GB depending on what’s on your phone. And if you’ve upgraded your phone a few times, you might have old backups from devices you no longer own sitting here, taking up space for no reason.
Before deleting, check the dates. Open Finder, use Go → Go to Folder, paste the path above, and look at when each backup folder was last modified. Any backup from a device you no longer own, or from more than a year ago, is a safe candidate for removal.
The safest way to manage these is through Finder → [your iPhone name] → Manage Backups, which shows you each backup with its date and size.
Homebrew Cache
Homebrew, the popular package manager for macOS, downloads packages before installing them and keeps those archives in a local cache so you don’t have to re-download them. By default, the cache lives at:
~/Library/Caches/Homebrew/
(You can confirm the exact path by running brew --cache in Terminal.)
Old downloaded archives pile up here even after the packages are installed or upgraded. Run this command to safely clean everything Homebrew doesn’t need:
brew cleanup
Add --prune=all to also remove packages that are no longer installed. On a machine where Homebrew has been in use for a year or more, this can free several gigabytes.
npm, yarn, and pnpm Caches
JavaScript developers accumulate a second layer of package caches. Every npm install or yarn add downloads packages and saves them to a local cache to speed up future installs.
- npm: Run
npm cache clean --force - yarn: Run
yarn cache clean - pnpm: Run
pnpm store prune
The npm cache alone can easily reach 3–5 GB on an active development machine. These commands won’t touch your installed packages or node_modules folders. The cache will be rebuilt the next time you install packages.
Docker Images and Volumes
Docker accumulates space aggressively. Every image you pull, every container you run, and every volume created sticks around until you explicitly clean it up. All of this data is stored inside Docker’s VM disk image, which can quietly grow to 30–60 GB.
The fastest way to reclaim this space:
docker system prune
This removes all stopped containers, unused networks, dangling images, and build cache. To also remove unused volumes (be careful — make sure you don’t need the data):
docker system prune --volumes
Check what’s using space first with docker system df — it breaks down images, containers, and volumes by size so you know what you’re dealing with.
.DS_Store Files
macOS creates .DS_Store files in virtually every folder you open in Finder. These tiny files store view preferences for the folder — icon positions, view mode, and similar metadata. They’re harmless but clutter your directories (and can cause minor annoyances in version control repositories).
To remove them from your current directory and all subdirectories:
find . -name '.DS_Store' -delete
Or, to remove them system-wide (be careful running this on the whole drive):
sudo find / -name '.DS_Store' -delete
This is cosmetic cleanup — .DS_Store files take up almost no space, but they’re a good habit to clear when you notice them.
Empty the Trash
This one sounds obvious, but it’s easy to forget: files in the Trash still count against your disk space until you empty it. macOS doesn’t free that space automatically.
Click and hold the Trash icon in your Dock and select Empty Trash, or open the Trash and press ⌘⌫. If you have a lot of large files in there, the space reclaimed can be surprising.
Some apps also have their own internal “trash” that doesn’t use the system Trash — iPhoto and Logic, for instance. Check each app’s settings or File menu for a way to empty or clear deleted items.
Keeping Your Mac Clean Going Forward
Junk files are inevitable — they’re a side effect of using a computer. The trick is to address them periodically before they build up into a storage crisis.
A few habits help: run brew cleanup monthly, clear your browser caches every few months, and check for old iOS backups whenever you upgrade your phone.
Tired of hunting through folders manually? DiskCopilot scans your entire drive, finds the biggest space hogs, and uses AI to tell you what’s safe to delete. Download DiskCopilot for free and reclaim your storage in minutes.