APFS compression on a Mac: Xcode takes 3.9 GB for 9.8 GB of files, Chrome takes 1.5 GB for 1.5 GB, and cp undoes the saving
Finder says Xcode is 9.8 GB of files and the disk holds 3.9 GB of it. Chrome says 1.47 GB and takes 1.48 GB. Both are right: Xcode's files are stored compressed by the file system and Chrome's are not. Here are the numbers for Apple's apps and five others, the one-line check for any file, and two ways a copy quietly loses the saving.
What we measured
- One Apple M4 Mac mini, macOS 27.0.1, APFS, 20 November 2026. Read-only measuring of installed apps, plus copy tests in a scratch folder under
/tmp(deleted afterwards). - A small Python script walked each folder and, for every regular file counted once (hard links are not double-counted), added the logical size (
st_size) and the space actually allocated (st_blocksx 512). A file is compressed when its flagUF_COMPRESSEDis set, the same flagls -lOprints ascompressed. - MB means 1,048,576 bytes. One machine and one macOS build: the share of compressed files changes between macOS versions and between versions of an app.
What it is
APFS inherits a feature from HFS+ called transparent file compression (the <code>decmpfs</code> scheme). The data is stored compressed and every program that opens the file reads it as if nothing had happened. Nothing is turned on in System Settings and nothing slows the Finder down: Apple's installers and updaters write files this way, and your own files are never compressed behind your back. That is why the same macOS gives you wildly different savings for different apps.
Apple's own apps: about half the space
| Folder | Files | Logical MB | On disk MB | Saved | Compressed files |
|---|---|---|---|---|---|
/System/Applications | 13,867 | 1,220.9 | 634.1 | 48.1% | 10,793 |
/System/Library/Frameworks | 23,983 | 1,696.0 | 921.3 | 45.7% | 13,022 |
Music.app | 2,733 | 110.9 | 64.8 | 41.6% | 1,989 |
Maps.app | 92 | 79.2 | 46.9 | 40.8% | 88 |
Photos.app | 418 | 40.2 | 21.4 | 46.8% | 381 |
Mail.app | 353 | 26.5 | 12.7 | 52.1% | 311 |
/usr/share/man | 2,757 | 33.3 | 20.4 | 38.7% | 2,440 |
Inside those folders the files that are compressed shrink a lot more than the average shows: in <code>/System/Applications</code> the 10,793 compressed files hold 1,094.2 MB of logical data in 497.6 MB, a 54.5% saving. The rest are files too small or too incompressible to bother with.
Xcode: 5.8 GB that never reaches your disk
| App | Source | Logical MB | On disk MB | Saved | Compressed files |
|---|---|---|---|---|---|
Xcode.app | Apple, Mac App Store | 9,773.7 | 3,937.7 | 59.7% | 26,608 of 125,860 |
GarageBand.app | Apple, Mac App Store | 1,313.2 | 1,016.6 | 22.6% | 3,479 of 37,655 |
Keynote.app | Apple, Mac App Store | 701.3 | 524.4 | 25.2% | 1,439 of 34,520 |
Google Chrome.app | Developer ID download | 1,468.7 | 1,484.6 | -1.1% | 0 |
Visual Studio Code.app | Developer ID download | 1,594.7 | 1,603.5 | -0.6% | 0 |
Firefox.app | Developer ID download | 525.9 | 526.2 | -0.1% | 0 |
Docker.app | Developer ID download | 2,196.8 | 2,197.1 | 0.0% | 0 |
Pilotbase.app | Developer ID download | 572.7 | 581.4 | -1.5% | 0 |
Xcode shows how concentrated it is: only 21% of its files are compressed, but they hold 8,689.3 MB of its 9,773.7 MB (88.9%) and take 2,621.3 MB on disk, a 69.8% saving. The five third-party apps total 6,358.8 MB of files and take 6,392.8 MB, 34 MB <em>more</em>, because every file is rounded up to the file system's 4 KB blocks. We saw no compressed file in any of them.
We did not find a rule published by Apple for which files get compressed. In what we measured, the compressed files are the large, compressible kinds (frameworks, resources, man pages, dictionaries), and the Store apps and macOS itself have them while the downloaded apps have none. Treat that as an observation on this Mac, not a guarantee.
Check any file in one command
<code>du</code> reports what is allocated, so it already shows the compressed figure. The Finder's Get Info shows both: Size (the logical total) and, in brackets, Size on disk. The logical one is the one that matters for the next section.
Two ways a copy loses the saving
We copied Mail.app, which is 26.5 MB logical and 12.7 MB on disk, out of <code>/System/Applications</code>:
| Copy method | Compressed files | On disk MB |
|---|---|---|
| original | 311 | 12.7 |
cp -R | 0 | 27.7 |
cp -Rc (clone) | 0 | 27.7 |
ditto --hfsCompression over the cp -R copy | 0 | 27.7 |
Plain <code>cp</code> writes ordinary data, so the copy takes 2.18 times the space, and the clone flag does not help because a compressed file has no ordinary data to share. <code>ditto</code> with no options keeps the compression: copying <code>/usr/share/man</code> with it gave 2,422 compressed files and 20.3 MB on disk, against 20.4 MB for the original. We tried to compress the plain copy again with <code>ditto --hfsCompression</code> and it compressed nothing on this Mac; we did not find out why, so we cannot recommend it as a way to shrink your own folders. It also refused to copy Mail.app itself (<code>Operation not permitted</code>), because some of its files are protected by the system.
The second place the saving disappears is any other drive. A drive formatted exFAT or FAT does not do this compression, and Xcode's 3.9 GB takes 9.8 GB there. If you plan to move apps or a developer folder off the Mac, size it by the logical figure; <a href="https://zofle.com/articles/external-drive-format-mac-apfs-exfat-tested">our external-drive format test</a> covers which format keeps what, and <a href="https://zofle.com/articles/apfs-clone-files-du-double-count-cp-c-free-space-measured">the clone article</a> covers the other copy that does not cost what <code>du</code> suggests.
Your own files are not compressed
As a control we wrote 500 text files of about 13 KB each (6.3 MB of text) and 50 files of 200 KB of random data (9.5 MB). Neither set had a single compressed file afterwards, the text took 7.8 MB on disk (24% more, from the 4 KB rounding) and the random data 9.6 MB. So on APFS today the saving is something you get from what Apple and the Store ship, not something that grows with your own folders; for those, space comes from deleting, moving or sharing clones.
What to do on your Mac
- When Finder and
dudisagree on an app, trustdufor what it occupies and Finder's Size for what it needs elsewhere. - Do not copy an Apple app or the Xcode folder with
cp -Rto keep a spare: a duplicate costs twice the space. Usedittowithout options if you must copy. - Before moving a folder to an external drive, check
ls -lOon a few of its big files. If they are compressed, budget the logical size on the destination. - Do not hunt for a switch that compresses your disk: we found none in macOS 27, and the one tool flag we tried did nothing.
Zofle lists apps and developer folders by size on disk, so Xcode appears at its real 3.9 GB, and moves your picks to the Trash with Undo.
Zofle shows what each app and folder really occupies and moves your picks to the Trash with Undo.
Download Zofle for MacSources and method
- Run on 20 November 2026 on an Apple M4 Mac mini, macOS 27.0.1 (APFS, sealed system volume). Folder totals came from a Python 3 script using
os.lstat, counting each inode once, withst_blocksx 512 as allocated space andst_flags & 0x20(UF_COMPRESSED) for compression. Copy tests usedcp -R,cp -Rcanddittoin a scratch folder under/tmp, deleted afterwards. The two test file sets were generated for the article (fixed random seed). - Apps measured: the copies already installed on the machine (Xcode, GarageBand and Keynote from the Mac App Store; Chrome, VS Code, Firefox, Docker and Pilotbase as downloads). The statement that Apple's installers write compressed files is our reading of the results, not a quote from Apple; macOS version and app version change the numbers.
ditto --hfsCompressioncompressed nothing on this Mac; we did not investigate whether a permission or the OS release is the cause. Background on the scheme: Apple'sdittomanual page (man ditto) lists the--hfsCompressionand--preserveHFSCompressionoptions.
Zofle Pro news
People signing up now will get Zofle Pro, with more features, for free when we launch it.