How to Delete Temporary Files on a Mac in 2026 (and Which Ones to Leave Alone)
Windows users know the temp folder as %temp%, a place to empty when the disk fills up. macOS has temporary folders too, but they are hidden, cleaned automatically, and risky to empty by hand while the Mac is running. The temporary files that pile up on a Mac are mostly created by individual apps, and that is where real cleanup happens.
Quick answer: macOS stores system and app temporary files in hidden folders (/private/tmp and a per-user folder under /private/var/folders) and removes old items automatically. The safest way to clear them is to restart your Mac. Do not delete the contents of /private/var/folders by hand. The temp files worth cleaning yourself are app-generated ones: interrupted downloads in Downloads, Final Cut Pro render files, Xcode DerivedData, and app caches in ~/Library/Caches. Disclosure: we make Space App, which groups leftover caches and temporary files by app.
Where are temporary files stored on a Mac?
Temporary files live in /private/tmp, in a per-user folder under /private/var/folders, and in each app's own cache and log folders. Terminal shows the per-user folder path in the TMPDIR variable.
| Location | What's in it | Cleaned automatically? |
|---|---|---|
| /private/tmp (also reachable as /tmp) | Short-lived files from command-line tools and system services | Yes. Items untouched for 3 days are removed daily |
| /private/var/folders/…/T | Your user account's temporary folder (what apps get when they ask for a temp folder) | Yes, at startup and periodically |
| /private/var/folders/…/C | Per-user caches used by macOS and apps | Managed by macOS |
| ~/Library/Caches | App caches | Partly. macOS removes some when space is low |
| Inside apps' own folders | Render files, scratch files, build products | No, these are up to each app |
To open your temporary folder, type open $TMPDIR in Terminal. Look, but do not clear it out.
How does macOS delete temporary files by itself?
On macOS 26.6.2, two launchd jobs do the work: tmp_cleaner clears /tmp every night, and dirhelper handles the per-user folders with a three-day setting. We read both on a test Mac.
| Location | Cleaned by | Rule | How we know |
| /private/tmp (/tmp) | com.apple.tmp_cleaner, run at midnight | Deletes regular files not accessed, modified or changed in over 3 days, and empty folders older than 3 days | Read /usr/libexec/tmp_cleaner and its launchd settings on the test Mac |
| Per-user temp folder (TMPDIR) | com.apple.bsd.dirhelper, at load and 3:35 a.m. | Setting CLEAN_FILES_OLDER_THAN_DAYS is 3 | Read the launchd settings; the dirhelper program itself was not inspected |
| Per-user cache folder (var/folders, C) | Not by either job, per community notes | No automatic cleanup reported | Community and Chromium source comments only; we did not test it |
The tmp_cleaner script is a short shell script in /usr/libexec that anyone can read. It deletes regular files in /tmp that have not been accessed, modified or changed for more than three days, and deletes empty folders older than three days. Folders that still hold files, and special files such as sockets, are left alone.
A Mac that has been up for days can still show old-looking items in /private/tmp for this reason. On our Mac, 26 of the 63 items in /private/tmp were more than three days old, which fits the script's rules because non-empty folders and sockets are skipped. We did not classify each item. The older Windows-style advice to run a daily periodic script no longer applies: the /etc/periodic/daily folder does not exist on macOS 26.6.2.
How much space do temporary files take on a Mac?
On the one Mac we measured, the temp, cache and log folders added up to about 4.5 GB, and the per-user cache folder was the largest at 2.4 GB.
The figures come from one developer Mac running macOS 26.6.2 on 2026-11-03, measured with du and no Full Disk Access, so they are lower bounds and not an average. The /private/tmp figure includes scratch files from the tools used to write this guide. The method is in the Sources.
Why does restarting clear temporary files?
Restarting closes every app that might be holding temporary files open and lets macOS run its own cleanup at startup. Restart first, before deleting anything by hand.
The same read of the launchd settings shows dirhelper is configured to run when the system loads as well as at 3:35 a.m., which fits the restart advice. Restart does not remove app-specific files such as render files and caches.
Why should I not delete /private/var/folders myself?
Running apps and system services keep files open in /private/var/folders, including caches macOS expects to exist. Deleting them on a live Mac can crash apps, lose unsaved state or force caches to rebuild from scratch.
Old forum advice makes deleting tempting, but macOS removes stale items on its own. Our measurement also shows the folder is not one tidy temp pile: the per-user cache subfolder was more than twice the size of the temp subfolder.
Which temporary files should I clean up myself?
The temp files that waste space are created by apps, and most apps do not clean up after themselves. Interrupted downloads, render files and build products are usual culprits; the last two regenerate.
| App or source | What builds up | How to remove it safely |
|---|---|---|
| Browsers | Interrupted downloads (.crdownload in Chrome, .download in Safari) | Delete them from Downloads when no download is running |
| Final Cut Pro | Render, optimized and proxy media | File → Delete Generated Library Files |
| Xcode | Build products in DerivedData | Delete ~/Library/Developer/Xcode/DerivedData; it's rebuilt on the next build |
| Photoshop and other creative apps | Scratch and temp files | Quit the app normally so it removes them; check its scratch disk settings |
| Installers | .dmg and .pkg files you've already installed | Delete from Downloads |
| App caches | Cached data in ~/Library/Caches | Quit the app, then delete the folder's contents |
Final Cut Pro is worth singling out. Render files for a single project can run to tens of gigabytes, and they are entirely regenerable. Apple's menu command removes them for an event, project or whole library and leaves original footage untouched.
How do I delete app temp files and caches?
Quit the apps, open ~/Library/Caches in Finder, sort by size, delete the contents of folders for large or uninstalled apps, then check Downloads and empty the Trash. Restart afterwards.

Quit the apps you are cleaning up after.
In Finder, press ⇧⌘G and go to ~/Library/Caches.
Turn on Calculate all sizes (List view, ⌘J) and sort by Size.
Delete the contents of folders belonging to large apps or apps you have uninstalled.
Check Downloads for old installers and interrupted downloads.
Empty the Trash and restart.
Working out which folder belongs to which app is the slow part, because many are named like com.developer.helper rather than after the app. Space App matches them for you, marks each item Safe, Review or Caution, and sends what you remove to the Trash so a clean can be undone. For a deeper look at caches, see How to Clear Cache on a Mac (App, Browser and DNS Cache).
Which Terminal commands are safe for checking temp files?
Read-only commands that list and measure files are safe: du, ls and find without a delete flag. Avoid rm with sudo or wildcards, because Terminal deletes skip the Trash and cannot be undone.
du -sh $TMPDIR
du -sh /private/tmp
find /private/tmp -type f -mtime +3 | headThe first two commands print folder sizes. The third lists up to ten regular files older than three days without deleting anything. If something looks worth removing, delete it from Finder so it lands in the Trash first.
What is the Mac equivalent of %temp% on Windows?
The closest match is the per-user temp folder that TMPDIR points to, but emptying it by hand is not recommended. Restarting and cleaning app caches are the safer habits.
| Windows | Mac equivalent |
|---|---|
| %temp% (C:\Users\you\AppData\Local\Temp) | $TMPDIR in /private/var/folders (cleaned automatically) |
| C:\Windows\Temp | /private/tmp (cleaned automatically) |
| Disk Cleanup → Temporary files | Restart; System Settings → General → Storage |
| AppData\Local caches | ~/Library/Caches |
| Prefetch | No equivalent to clear |
FAQs
Does restarting a Mac delete temporary files?
Mostly yes. Restarting closes everything using temporary files and lets macOS clean the per-user temporary folders. It will not remove app-specific files such as render files or caches.
Is it safe to delete files in /private/var/folders?
Not while the Mac is running. macOS manages that folder and removes stale items itself, and running apps keep files open there. Restart instead of deleting by hand.
Where is the temp folder on a Mac?
Each user has one inside /private/var/folders. Run open $TMPDIR in Terminal to open yours. The system-wide temporary folder is /private/tmp, which /tmp points to, and both are hidden in Finder.
Can I delete everything in /private/tmp?
Not safely while apps run. Some items there are sockets and working folders in use, and macOS already deletes files older than three days each night. Restart instead.
How much space do temporary files take on a Mac?
System temp folders are usually small. On the Mac we measured they held about 1.7 GB, while app caches and build products can reach tens of gigabytes on a developer Mac.
Are Mac log files the same as temp files?
No. Logs record what apps and the system did, and they live in ~/Library/Logs and /private/var/log. On the Mac we measured they were 0.3 GB and 0.1 GB, so logs are rarely the space problem.
Sources
Measurement: du -sk on /private/tmp, TMPDIR, the per-user cache folder, ~/Library/Logs and /private/var/log, one Mac, macOS 26.6.2, 2026-11-03, no Full Disk Access.
Read on that Mac: /usr/libexec/tmp_cleaner (script), and the launchd settings for com.apple.tmp_cleaner and com.apple.bsd.dirhelper.
Apple Developer Forums: When are /tmp and TMPDIR cleaned up in macOS?
