How to clear Xcode DerivedData on Mac (and how much space it takes)

Updated 15 October 2026

DerivedData is where Xcode keeps everything it generates while building your projects. It is safe to delete, Xcode recreates it on the next build, and it is one of the first places to look when a Mac used for iOS or macOS development runs low on space.

What DerivedData is

Every time you build, Xcode writes compiled object files, build products, logs, module caches and the index that powers code completion and search into DerivedData. Each project gets its own subfolder, named after the project followed by a string of random letters, such as MyApp-bxhqwkcpzrdmtfa.

Xcode doesn't remove the folders of projects you no longer open, so they pile up. A project you deleted months ago can still have its full build output sitting here.

Where it lives

The default location is:

~/Library/Developer/Xcode/DerivedData

To confirm the location Xcode is using, open Xcode › Settings › Locations. The DerivedData row shows the path, and the small arrow next to it opens the folder in Finder. If it is set to Relative or a custom path, your DerivedData may live inside each project folder instead.

In Finder, choose Go › Go to Folder (Shift-Command-G) and paste the path. The Library folder is hidden by default, but Go to Folder still opens it.

How to check its size

In Terminal, the total:

du -sh ~/Library/Developer/Xcode/DerivedData

Each project's folder, largest first:

du -sh ~/Library/Developer/Xcode/DerivedData/* | sort -hr | head -20

In Finder, select the DerivedData folder and choose File › Get Info (Command-I). The size can take a moment to calculate.

There is no typical size. It depends on how many projects you have built, how large they are and how many Swift packages they pull in, so measure yours rather than trusting a number from a forum post.

How to delete it safely

  1. Quit Xcode. Deleting DerivedData during a build can make that build fail.
  2. Delete the folder, in Finder or Terminal.

In Finder, open the DerivedData folder, select everything inside it, move it to the Trash and empty the Trash. To clear a single project, trash only that project's subfolder.

In Terminal:

rm -rf ~/Library/Developer/Xcode/DerivedData

rm -rf deletes immediately and skips the Trash, so check the path before pressing Return. Xcode recreates the folder the next time it builds.

For a lighter clean of one project, Product › Clean Build Folder (Shift-Command-K) in Xcode removes that project's build products but leaves the rest of DerivedData alone.

Nearby folders that are not DerivedData

What happens after you delete it

DerivedData fills up again as you build. Deleting it is not a one-time fix; it is routine maintenance.

Or let SymbolSweep find it

The free scan in SymbolSweep measures ~/Library/Developer/Xcode/DerivedData and any folder named DerivedData inside your project folders, and lists them in the REBUILD tier: safe to delete, but the next build takes longer.

Download SymbolSweep for Mac

Scanning is free and never deletes anything. Deleting needs a one-time $12 license for one Mac. Requires macOS 13 or later on Apple silicon. See how it works.

FAQ

Is it safe to delete Xcode DerivedData?

Yes. It contains only files Xcode generates from your project. Quit Xcode first, then delete it. The cost is a slower first build and a re-index.

Will deleting DerivedData delete my code or settings?

No. Source files, schemes, signing settings and breakpoints live in your project folder, not in DerivedData.

How often should I clear DerivedData?

There is no need to clear it on a schedule. Clear it when you are short on disk space, or when Xcode shows stale errors or a broken index that a clean build doesn't fix.

Why is my Library/Developer folder still big after deleting DerivedData?

Check Archives, CoreSimulator and iOS DeviceSupport in ~/Library/Developer. They are separate folders and are not removed with DerivedData.

Related guides