> Find true byte-for-byte duplicate files on a Mac. How staged hashing works, why the same name is not enough, and how to delete copies but keep the original.

[← All guides](https://maczentra.com/blog)Check storage

# How to Find and Delete Duplicate Files on a Mac

The MacZentra team · Updated Oct 1, 2026 · 6 min read

Duplicate files, the same download saved twice, a project copied "just in case", exports that never got cleaned up, quietly add up to gigabytes. The safe way to find them is by **content**, not by name: two files are only true duplicates when their bytes match exactly, so you can delete one copy knowing the other is identical.

## Why "same name" isn't good enough

Matching on filename alone is risky in both directions. Two unrelated files can share a name (`IMG_0001.jpg` from two different cameras), and two identical files can have different names (`report.pdf` and `report copy.pdf`). The only way to be sure a copy is safe to delete is to compare the actual contents.

## How content-based duplicate detection works

Reading every byte of every file would be painfully slow on a large disk, so good tools stage the work from cheap checks to expensive ones, and only fully read files that survive each stage:

Stage | Check | What it eliminates |
1. Size | Group files by exact byte size | A file with a unique size can't have a twin, discarded immediately. |
2. Head hash | Hash only the first few KB | Same-size files that differ in their opening bytes (most large media). |
3. Probe hash | Hash head + middle + tail of large survivors | Big files that match at the start but differ later (VM disks, databases). |
4. Full hash | Full BLAKE3 of what's left | Confirms byte-for-byte identity. Only true duplicates remain. |

A file is only ever called a duplicate when it shares both an exact size **and** an exact full hash with another. That staging is why a scan of hundreds of thousands of files finishes quickly instead of reading the whole disk.

## Finding duplicates by hand

### A quick Terminal pass

You can approximate the above with a checksum. This hashes every file under a folder and lists any hash that appears more than once:

Terminal

```
# Hash every file, then show only the duplicated hashesfind ~/Downloads -type f -exec shasum -a 256 {} + \ | sort | uniq -w64 -D
```

It works, but it reads **every** byte of **every** file (no size pre-filter), so it's slow on large folders and offers no safe way to pick which copy to keep. Treat it as a spot check, not a cleanup plan.

## Skip build folders

If you develop, a whole-disk duplicate scan will drown in build-artifact "duplicates" from `node_modules`, `.git`, `build` and `target`. Those are reinstallable, not something you'd hand-delete one by one. Exclude them so the results are files you actually chose to keep. For those folders specifically, see [cleaning up node_modules](https://maczentra.com/blog/node-modules-cleanup).

![MacZentra Duplicates screen](https://maczentra.com/guides/duplicates.webp)Duplicates groups exact copies so you keep one and trash the rest.

## What about files that are nearly the same?

Exact matching won't catch a document re-exported with a tiny change, or a photo resized on the way out of an app. Those need fuzzy matching: by filename for documents, or perceptual hashing for images. See [finding duplicate and similar photos](https://maczentra.com/blog/find-duplicate-photos-mac) for the image case.

## Everything MacZentra can clean

Treemap and Sunburst disk maps, a duplicate finder, Developer Junk, a complete app uninstaller and more, in one native storage cleaner for Mac that’s 15.4 MB.

[Explore all features →](https://maczentra.com/features)

## Related guides

[![Cover image for Low-Disk Alerts from Your Mac's Menu Bar](https://maczentra.com/thumbs/alerts.webp)Check storage · 3 minLow-Disk Alerts from Your Mac's Menu BarMacZentra watches free space in the background and sends one native alert when it drops below your threshold. Run Smart Care from the tray.](https://maczentra.com/blog/menu-bar-alerts)[![Cover image for Mac App Updater: Homebrew, Sparkle, App Store](https://maczentra.com/thumbs/appupdater.webp)Check storage · 4 minMac App Updater: Homebrew, Sparkle, App StoreMacZentra's App Updater finds apps with a newer version and hands each update to Homebrew, the developer's feed or the Mac App Store. Read-only until you click.](https://maczentra.com/blog/app-updater-feature)[Check storage · 6 minMac Storage Optimization That Actually WorksWhat macOS storage optimization really cleans, what it leaves behind, and how to reclaim the rest of your disk without a subscription.](https://maczentra.com/blog/mac-storage-optimization)[![Cover image for Free Up Space on Mac: 10 Fixes, Biggest First](https://maczentra.com/thumbs/insights.webp)Free up space · 8 minFree Up Space on Mac: 10 Fixes, Biggest FirstTen ways to free up Mac storage ranked by typical space recovered. Covers hidden Library folders and leftovers macOS Storage settings never show.](https://maczentra.com/blog/free-up-space-on-mac)

Source: https://maczentra.com/blog/find-duplicate-files-on-mac
