In this article
This distinction matters when a disk image appears larger than the storage it seems to consume. The file can be valid: some parts of its addressable contents may not require allocated data blocks. But do not diagnose every size mismatch as a sparse file.
Compare the same file with native tools
Find the exact file in Finder first. Confirm that you are inspecting the file itself, rather than an alias, an app bundle or its parent folder. In Terminal, run these read-only commands with its actual path:
ls -ln "/path/to/example-file"du -k "/path/to/example-file"stat -f 'logical=%z bytes; allocated=%b blocks of 512 bytes' "/path/to/example-file"
The long ls listing includes the file’s logical length in bytes. du -k reports disk usage in units of 1,024 bytes. The stat format makes the two quantities explicit, although its allocation count needs multiplying by 512 to express bytes. The Mac’s built-in man ls, man du and man stat describe those fields and options.
Keep the units beside your notes. A value of 32 from du -k means 32 KiB in this comparison, not 32 bytes. Also record the time: an app may be writing to its disk image between measurements. These commands do not pause that app or produce a coordinated snapshot.
What a sparse region means
A sparse file has logical regions that do not need ordinary allocated data blocks. Reading a hole supplies zero bytes. The logical length still includes that region, so an application can address positions far beyond the data actually stored.
Apple’s About Apple File System documentation describes APFS sparse-file support and gives an example involving writes separated by a seek. It identifies disk images and database dumps as potential beneficiaries.
That is different from a download being incomplete. It is also different from a cloud placeholder that must fetch its contents. Do not move or delete an unfamiliar app-managed image just because its two size figures differ.
Nor does writing zero bytes automatically prove that the filesystem left holes. The sequence of operations and filesystem behavior matter. A measurement is more useful than inferring allocation from what you expect the contents to be.

Source: Apple Developer — About Apple File System, captured November 4, 2026. The diagram explains the mechanism; our measurements below are a separate test.
Our APFS test: 64 MiB in 32 KiB of reported storage
On November 4, 2026, we created two disposable files on an APFS volume using macOS 15.7.5. No personal documents or existing app images were involved.
For each file, a Python script wrote 4,096 A bytes at the beginning, sought forward, and wrote 4,096 B bytes at the end. It flushed the writes and synchronized the file before measuring. The only intended difference was the final logical length: 16 MiB versus 64 MiB.
| Measurement | 16 MiB fixture | 64 MiB fixture |
|---|---|---|
| Logical length | 16,777,216 bytes | 67,108,864 bytes |
| Reported allocated blocks | 32,768 × 512 bytes | 64 × 512 bytes |
du -k result | 16,384 KiB | 32 KiB |
| 4 KiB read from the middle | All zero bytes | All zero bytes |
The larger file showed the sparse-file distinction clearly: 64 MiB of logical length, 32 KiB of reported allocation. We wrote only 8 KiB of explicit data, but the reported allocation was 32 KiB. Even a controlled example does not justify equating payload bytes with allocated bytes.
The smaller file was equally instructive. Its reported allocation matched its full logical length, despite the same write–seek–write pattern and zero-filled middle. We preserved this result rather than assuming the method always produces a small allocation.
These are observations from one volume and OS build, not a universal size threshold for APFS. We did not inspect physical extents or measure exactly how much whole-volume free space deletion would return. The experiment supports a narrower practice: measure the file you have.
A common example: an app’s virtual disk
Docker’s current Mac disk-image FAQ distinguishes the maximum size of its disk image from the storage it actually consumes. Its settings expose both, and some other tools can emphasize the larger figure.
For a Docker-managed image, begin with Docker Desktop’s own disk-image information under Settings → Resources → Advanced. That provides application context which a bare filesystem number lacks. The documentation also warns against moving the image directly in Finder, because Docker can lose track of it.
This is an example of why ownership matters, not a claim that every large .raw file is Docker data or that every virtual disk is sparse. Use the app’s current instructions before changing its storage. Reducing a configured limit can have very different consequences from inspecting it.
Keep three other explanations separate
A small allocation relative to logical length is useful evidence, but filenames and size figures do not tell the complete creation history.
| Mechanism | Different question to investigate |
|---|---|
| Sparse regions | Which logical ranges require allocated blocks? |
| APFS clones | Do separate files share data blocks? |
| App bundles and related files | Are the tools counting the same collection of files? |
Our APFS clone experiment concerns shared data between independent files. It explains why adding per-file allocation figures can still overstate exclusive storage. The Mac app-size checklist instead helps when Finder and Storage are measuring different scopes.
If a deleted file still appears to occupy storage, investigate retention separately. An open file handle can outlast its directory entry; a sparse region does not explain that behavior.
Record evidence before choosing cleanup
For a useful report, save the exact path, owning app, logical bytes, allocated units, volume format and observation time. Note whether the app was actively using the file. Avoid including private filenames when sharing that report publicly.
Then decide whether you still need the data. Use the owning app’s supported removal or storage controls where appropriate, and keep a suitable backup. Do not delete a disk image to test whether the larger number disappears.
The practical benefit of understanding sparse files is a better interpretation of storage evidence. A large logical length can coexist with a small allocation, while neither number alone establishes what is safe to remove.


