How to clean up junk files on Mac

Apple's support pages say that removing system junk is necessary to avoid the slowing speed of your devices. Also, they recognize that freeing up storage is necessary to enhance the performance of your Mac. However, Apple don't specify what system junk is and how to get rid of it. So, we'll do it instead.

Keep reading to learn about the most common types of junk and ways to remove them. Why? Because junk not only takes up space but also slows your Mac down and causes system glitches and errors. 


What are junk files on Mac? 

System junk files may eat up gigabytes of precious Mac storage. The thing is that generating them is a normal part of the macOS operation and using apps. Over time, though, too many of these files may accumulate, and your Mac's speed and performance may drop. So, it's better to know what clutters your computer. 

The most common types of system junk files are the following: 

  • System cache: these are temporary files your macOS needs to run and maintain proper performance.
  • User cache: similar to system cache, these are temporary files the apps you use create. They are meant to make the startup of applications faster and the experience of running them more enjoyable. 
  • Browser cache: files generated by web browsers to speed up the process of loading pages.
  • System log files: files storing the activity of macOS and system applications mainly needed for debugging purposes.
  • Localization files: also known as language files, they are needed to change the language of macOS and apps interface.
  • App leftovers: remnants of the improperly or incorrectly uninstalled apps. 
  • Unused disk images (.DMGs): app installers you may have left on your Mac after downloading software.
  • Xcode junk: project index and build information left by Xcode.

How to remove unnecessary junk files on Mac?

Now as you know what system junk is, we'll show you how to get rid of these unnecessary files in two ways — automatically using a dedicated third-party app and manually. 

How to remove junk files in one click

Before proceeding with the manual removal of system junk, let us show you the easy way to remove it forever — CleanMyMac X. This universal cleaning solution for your Mac comes with many modules that can help your Mac work as good as new. It has tools for Mac optimization, malware removal, and uninstalling apps. But, most importantly, it comes with a cleaning tool that will safely delete all of the unneeded system junk files from hard-to-reach places in the system with just a few clicks. 

So, how to clean junk files on Mac with CleanMyMac X's System Junk module?

  1. Download CleanMyMac X for free here.
  2. Open it and select System Junk from the list of features on the left.
  3. Scan in progress in System Junk module of CleanMyMacX
  4. Click Scan.
  5. After the scan is complete, click Review Details to learn what will be removed.
  6. Select the boxes opposite to User Cache Files, System Cache Files, Language Files, and other items you want to delete.
  7. Hit Clean.

Now, your Mac is back in its out-of-the-box condition! CleanMyMac X deletes junk files, including user cache, system logs, downloads, and even Xcode junk files — all at once to speed up your Mac and free it from clutter.

How to delete junk files manually

If you want to try and hunt down all of the junk files manually, we've prepared some easy-to-follow steps for you, so keep reading. 

1. Clear cache files

Here, we'll show you how to get rid of three types of cache files — system cache, user cache, and browser cache. 

How to remove system cache on a Mac

These files generated by your macOS usually don't take up a lot of space. However, it's still better to clean them because they may make the system sluggish and unresponsive. Note that you should be extremely careful when removing the system cache to avoid deleting vital files. 

Here's how to clean system cache files on Mac:

  1. Open the Finder.
  2. Press Command+Shift+G.
  3. Enter the following path into the field: /Library/Caches and hit Return.  
  4. In the window that appears, you will see all your cache files.
  5. Go through all of the folders you see and remove only what's inside of them. 

How to clear user cache files

Also known as app cache, these files may eat up a lot of space, so it's better to remove them. After all, the apps will generate new files if they need more. To get rid of user cache: 

  1. Open the Finder once again. 
  2. After pressing Command-Shift-G, type the following path: ~/Library/Caches (note the ~) and hit Return.
  3. Like with the system cache, go through folders and delete what's inside. 

How to remove browser cache

Deleting what is also known as internet caches helps serve two great purposes: handling potential privacy issues by removing your digital trail and freeing up space on your Mac. The process varies for different browsers, though, so we'll show you how to do it for the three most popular ones. 

Safari: 

  1. Go to Safari > Settings > Advanced. 
  2. Make sure Show Develop menu in menu bar is selected. 
  3. Now, go to Develop > Empty Caches. 

Google Chrome:

  1. In the address bar, type chrome://settings
  2. Go to Privacy and security. 
  3. Select Clear browsing data and make sure Cached images and files is selected. 
  4. Hit clear data. 

Alternatively, click the vertical ellipsis icon > More tools > Clear Browsing Data and follow steps 3 and 4. 

Firefox:

  1. Open the application menu by clicking three horizontal lines top right. 
  2. Choose History > Clear recent history.
  3. Check Cache and hit OK. 

2. Remove user log files

When your app crashes, you usually are asked to submit a bug report. The system gathers your user logs and includes them in a report. The user log files don't contain information on user activity as it may seem. They only deal with app-level functionality.

If your Mac is old, you probably have a lot of user logs. So, it's time to clean your machine of them.

Follow the instructions to delete user log files on your Mac:

  1. Open Finder.
  2. Press Command+Shift+G.
  3. Enter the following path in the field: ~/Library/Logs and hit Return. 
  4. You will see all the user log files. You can manually move the files from folders to Trash.

If you want to declutter your Mac fully, select all user log files and delete them.

3. Delete system log files

These logs are plain text files, so they usually don't take up a lot of storage. But when you're running out of free space, deleting even such small files may help you declutter your Mac.

It's important to note, though, that cleaning system log files manually, you may accidentally delete some essential data. So, make sure to back up your data to avoid heartache when you delete something important. Using safe cleaning tools notarized by Apple, like CleanMyMac X, can help you prevent the risks of removing valuable data.

So, to clean system log files on your Mac, do the following:

  1. Open Finder.
  2. From the Go menu, select Go to folder. 
  3. Type /var/log in the field and press Return.
  4. You will see all the system log files. Select the files you want to remove and drag them to Trash.

You can also find system log files in /Library/Logs. This folder contains system application logs that aren't essential to store.

If you go to /Library/Logs/DiagnosticReports, you will find system reports. Safely delete the files to keep your Mac clean and free of clutter.


4. Remove localization files

Thanks to localization and language files, you can set your apps to the language you prefer. But once you determine the language of the app, you may delete other language files:

  1. Open Finder and go to the Applications folder.
  2. Right-click any application icon and select Show Package Contents.
  3. Find the Resources folder and open it.
  4. All subfolders ending with "lproj" are language files. Each folder contains localization information on a particular language. For example, the folder named en.lproj comprises English language files.
  5. Select the language folders and move them to Trash.

Don't forget to empty Trash when you're done removing junk files from your Mac.


5. Delete app leftovers

We know that many Mac users delete apps by sending them to Trash. However, even if you empty Trash afterward, it doesn't remove every single trace of the uninstalled application. In fact, a lot of files still clutter your system, so additional effort is needed to get rid of them. To do it, open the Finder, and from the Go > Go to Library, paste the following one by one:

  • ~/Library/Application Support
  • /Library/Caches/
  • ~/Library/Caches
  • ~/Library/Internet Plug-Ins/
  • ~/Library/
  • ~/Library/Preferences/
  • ~/Library/Application Support/CrashReporter/
  • ~/Library/Saved Application State/

    Check the folders and files containing the names of the apps you uninstalled long ago and send them to Trash. Alternatively, you can use the Uninstaller module that comes with CleanMyMac X and its Leftovers tool.


    6. Delete unused .DMGs

    Checking .DMGs — or app installers — is another way to remove junk from a Mac. These disk images are real space eaters, but they can be removed safely and rapidly. 

      1. Go to your desktop and press Command + F.
      2. Choose "This Mac" and click + on the right of the window.
      3. In the dropdown menu, choose File extension from the list.
      4. Now, type in dmg and review the results, deleting the image of any app you have already installed. 

      7. Remove large and old files 

      Except for all of the steps outlined above, it's also a good idea to get rid of the largest files and those you haven't opened for a while. You may start with the Documents or Downloads folder. In either of them, choose View > Sort by Size or Sort by Date Last Opened. Now, browse through your files and send to Trash what you no longer need. 

      If it seems like a lot of work, we have another tip for you — CleanMyMac X and its Large & Old Files module. It locates the heaviest files and sorts them by size, kind, and date accessed. The best part of using it is that you do not have to browse all of the folders manually — the tool does it for you in a matter of minutes. To run it:

      1. Open CleanMyMac X from the Applications folder. 
      2. Navigate to Large & Old Files from the sidebar. 
      3. Choose the location you want to scan — hard drive, external drive, or a particular folder. 
      4. Now, hit Scan. 
      5. After the scan is complete, review summary, choose the cleanup option that would work best for you, and press Remove (or Move). 

      8. How to remove Xcode junk?

      If you use Xcode, tons of your disk space gets hogged with old cache and junk that Xcode generates. You might not even notice it until it impacts your Mac's performance. In case you would like to go over all the libraries to remove Xcode junk manually, here's a list of paths you need:

      • ~/Library/Developer/Xcode/DerivedData
      • ~/Library/Developer/Xcode/Archives
      • ~/Library/Developer/Xcode/iOS DeviceSupport
      • ~/Library/Developer/CoreSimulator
      • ~/Library/Caches/com.apple.dt.Xcode
      • ~/Library/Application Support/MobileSync/Backup

      Important notice: we do not assume responsibility for the possible damage or loss of data that might occur when you manually clean Xcode libraries. Thus, venture this path at your own risk. Or use CleanMyMac X because it knows exactly how to clean Xcode cache, traces, and leftovers and does it neatly, leaving all the important files intact.


      Although each system file or user log doesn't seem to take much of your Mac's storage, together, they can make it difficult for your Mac to perform well. That's why it's better to scan your computer for junk files and get rid of them once in a while.

      Laptop with CleanMyMac
      CleanMyMac X

      Your Mac. As good as new.