How to Find Duplicate Files on a Mac
To find duplicate files on a Mac without installing anything, sort a Finder list by size and name, or compare checksums in Terminal, which is the only way to prove two files are byte-for-byte identical. For photos, the Photos app has its own Duplicates album. A free app such as dupeGuru does the checksum work with a window around it. Before you delete anything, check two things this guide covers: whether the copy is a cloud-only iCloud placeholder, and whether it is an APFS clone, because deleting a clone frees almost nothing.
Start with Finder
Finder cannot detect duplicates, but it can put likely ones next to each other.
- Open the folder you suspect, such as Downloads or Documents, and choose View › as List.
- Turn off View › Use Groups if it is on.
- Choose View › Show View Options and make sure Size is shown, then sort by Size.
- Files with the same size and a similar name, such as
report.pdfandreport copy.pdforIMG_2041 (1).jpg, are candidates.
To search the whole Mac, choose File › New Smart Folder, pick This Mac, and add a rule such as Kind is Document or a file size above a limit. Sorting that result by name puts files with the same name together, wherever they are.
Same name and size is a hint, not proof. Two exports of one document can match in both and still differ.
Prove it with checksums in Terminal
A checksum reads every byte of a file and turns it into a short fingerprint. Two files with the same SHA-256 fingerprint have the same contents. This command lists groups of identical files over 1 MB in one folder, and it only reads:
find ~/Documents -type f -size +1M -exec shasum -a 256 {} + \
| sort \
| awk '{h=substr($0,1,64)} h==p{if(!shown)print prev; print; shown=1; next} {p=h; prev=$0; shown=0}'
Each block of lines with the same fingerprint is one set of duplicates. A few notes:
- Change
~/Documentsto the folder you want, and keep the scope small. Hashing a whole disk reads every file and takes a long time. - The
-size +1Mfilter skips small files, which save little space anyway. Without it, every empty file matches every other empty file. - Keep it away from
~/Library, app bundles and photo libraries. Files there are often meant to exist twice, and removing one by hand can break the app that owns them.
The command deletes nothing. Decide in Finder which copy to keep.
Use the duplicate finders Apple already ships
Photos. Since macOS Ventura, Photos collects duplicate photos and videos in Duplicates under Utilities in the sidebar. After a merge, one original stays where the duplicates were, and the others go to Recently Deleted, where you can recover them for 30 days (Apple's guide). Do not hunt for photo duplicates inside the Photos library package with Terminal; let the app do it.
Contacts. Choose Card › Look for Duplicates… in Contacts. Export a Contacts Archive first; the contactsd guide covers the steps.
Free and paid apps
| App | Price | What it checks | Notes |
|---|---|---|---|
| dupeGuru | Free, GPL-3.0 | File names or contents, with separate music and picture modes | Latest release 4.3.1 (July 2022) has a macOS build; the repository is still active |
| Gemini 2 | Paid, from $1.95 a month on MacPaw's site | Exact duplicates and similar files | Lets you compare similar files before removing them |
| Photos | Built in | Photos and videos in the library | Merged items go to Recently Deleted |
Whichever app you use, review its list rather than accepting "select all duplicates". These apps can tell you two files match. They cannot tell you which location an app or a project expects.
Two kinds of duplicate that free no space
iCloud placeholders
With Optimize Mac Storage turned on for iCloud Drive, some files exist on the Mac only as placeholders, and their contents live in iCloud (Apple's guide). Deleting a placeholder frees almost no local space, and it deletes the file from iCloud Drive itself, not just from this Mac; deleting from iCloud Drive is how Apple says to free iCloud storage (support.apple.com/108922). If you only want local space, Control-click the item and choose Remove Download. A checksum needs the contents, which a placeholder does not have on the Mac, so download the folder first or leave iCloud Drive out of the search. More in iCloud Drive taking up space.
APFS clones
When you copy a file within the same APFS volume, macOS usually makes a clone: a second file that shares the original's data on disk until one of them changes (Apple's WWDC 2016 APFS session). Finder, du and checksums all report a clone as a full-size, identical copy. On the Mac used for this page, a 500 MB file and its clone made with cp -c:
du: 500 MB + 500 MB = 1.0 GB
free space before and after the clone: unchanged
SHA-256: identical
So a "duplicate" that a tool says saves 500 MB may save nothing, because the data stays as long as one copy remains. Nothing in Finder shows which files are clones. If the free space does not move after you delete a set of duplicates, this is a likely reason. Hard links work the same way: ls -li shows the same inode number for both names, and only one copy of the data exists. See deleted files not freeing space for the other reasons.
Before you delete
- Keep the copy in the place an app or project expects, and delete the stray one, often in Downloads or the Desktop.
- Move duplicates to the Trash and use the Mac for a few days before emptying it.
- Make sure Time Machine or another backup is current, since syncing to iCloud is not a backup.
Where Mole fits
Mole does not find duplicate files, and it has no duplicate scan or checksum comparison. What it does instead is show where space actually goes. Analyze draws the disk as a treemap and has a Largest Files list, so you can see that a folder of video exports or old installers is the real problem before you hunt for copies, and Move to Trash sends what you pick to the Trash. When it adds up a folder, Analyze counts an unchanged APFS clone once, so cloned copies don't inflate that folder's size the way they do in du. Clean lists caches and other files that rebuild on their own, which is often more space than duplicates ever were. Related: how to find large files on Mac and using a treemap to find space.
FAQ
Does macOS have a built-in duplicate file finder?
Not for general files. Photos has a Duplicates album for photos and videos, and Contacts has Look for Duplicates…. For other files, sort a Finder list by size or compare checksums in Terminal.
How do I find duplicate files on Mac with Terminal?
Use find with shasum -a 256 on one folder and group the identical fingerprints, as shown above. The command only reads files and deletes nothing.
Is dupeGuru safe to use on Mac?
It is open source under GPL-3.0 and its latest release has a macOS build. Like any duplicate finder, review the matches yourself and keep files inside app bundles and libraries out of the scan.
Why didn't deleting duplicates free any space?
The copies may have been APFS clones or hard links sharing the same data, or iCloud placeholders with no local contents. Space also stays used until you empty the Trash.
Does Mole find duplicate files?
No. Mole's Analyze shows the largest folders and files and Clean removes caches, but neither looks for duplicates.