Home › Mac Guides › Remove Duplicate Files
How to find and remove duplicate files on your Mac
Duplicates are quietly expensive: the same photo imported twice, a download saved in two folders, a project folder copied before a risky edit. The difficulty is finding them reliably, because copies get renamed — which means matching by content rather than filename. Here is how to do that, free or fast.
Updated 2026-08-02 · Written by the CleanerMac team · macOS 13–15 tested
Why duplicates are so hard to find by hand
Duplicates rarely announce themselves. The same photo gets imported from a camera and again from a phone backup. A document is copied into a second project folder "just in case". A download finishes twice and macOS appends a number. An entire folder gets duplicated as a manual backup before a risky edit, and then stays forever.
Sorting by filename catches almost none of that, because copies get renamed: IMG_4821.jpg, IMG_4821 copy.jpg, beach-final.jpg and beach-final-v2.jpg can all be byte-for-byte identical. Sorting by size gets you closer but produces false positives, since unrelated files often share a size.
The only reliable test is comparing content. That means hashing each file — computing a fixed-length fingerprint such as SHA-256 from the bytes themselves — and grouping files whose fingerprints match. Identical content produces an identical hash regardless of name, location, or modification date.
Three kinds of "duplicate"
Being precise here matters, because tools that blur the distinction delete things you wanted.
- Exact duplicates — byte-identical files. Safe to reduce to one copy, and the only category any tool should delete without hesitation.
- Similar files — the same photo at different resolutions, a JPEG and its HEIC original, a document and its exported PDF. These are not duplicates. They may still be worth pruning, but only you can judge that.
- Hard links and clones. On APFS, copying a file within the same volume often creates a clone that shares storage until one copy changes. Two files can look like 2 GB each while occupying 2 GB in total. Deleting the "duplicate" frees nothing. This is a common reason cleanup reclaims less than expected.
Finding duplicates with Terminal (free)
You can do content-based duplicate detection with tools already on your Mac. This command hashes every file in a folder, then prints only the hashes that appear more than once:
find ~/Downloads -type f -exec shasum -a 256 {} + | sort | uniq -w64 -D
Read it as: find every regular file, compute a SHA-256 for each, sort so identical hashes land together, then print only lines whose first 64 characters (the hash) are duplicated. The output groups the copies for you. Swap ~/Downloads for ~/Documents, ~/Desktop, ~/Pictures or ~/Movies.
Two practical notes. Hashing every file in a large folder takes time, since every byte must be read — restrict the scope, or pre-filter by size with find ~/Pictures -type f -size +1M so you only hash files large enough to be worth reclaiming. And never pipe this straight into a delete command; review the list yourself.
Finder can help with the review: press ⇧⌘G to jump to a path, or ⌘F to search This Mac with a size filter. To measure what a folder is costing you before you start, du -sh ~/Pictures gives a total.
Where duplicates actually accumulate
| Location | Typical cause | Worth checking |
|---|---|---|
~/Downloads | Re-downloaded files, numbered copies | Always — highest hit rate |
~/Desktop | Working copies never cleaned up | Always |
~/Documents | Files copied between project folders | Yes, but review carefully |
~/Pictures | Multiple imports of the same shoot | Yes — usually the biggest win |
~/Movies | Duplicate exports and renders | Yes — largest per-file savings |
~/Music | Re-imported albums | Sometimes |
| Photos library | Duplicate imports | Use Photos' own Duplicates album |
~/Library | App caches with repeated assets | No — clean caches instead |
Skip ~/Library for duplicate hunting. Apps legitimately keep identical files in separate cache directories, and removing one breaks the app's assumptions. Clear caches properly instead — see how to clear cache on Mac.
Photos, iCloud and other special cases
The Photos app has handled this natively since macOS Ventura: open Photos and look for Duplicates in the sidebar under Utilities. It detects duplicates within the library and offers to merge them, keeping the highest-quality version and combining keywords and favourites. Use that before pointing any external tool at your library. Detail in deleting duplicate photos.
Never delete files from inside a .photoslibrary package by hand — the library is a database, and removing files behind its back corrupts it.
Two more special cases are worth knowing. Music and video files that were downloaded from a streaming service are often protected or account-bound; deleting a "duplicate" of one may leave you with a copy you cannot play. And any file inside a package — anything Finder shows as a single item but which is really a folder, such as .app, .photoslibrary, .logicx or .fcpbundle — should be treated as off-limits. Bundles routinely contain repeated resources by design, and removing one copy breaks the bundle rather than saving space.
Time Machine backups are another false positive. Every backup contains copies of your files, so a duplicate scan that reaches a mounted backup drive will report enormous numbers of matches. Unmount the backup volume, or exclude it from the scan, before you start.
For iCloud Drive, be aware that a "duplicate" may be a file that is not downloaded locally (shown with a cloud icon). Hashing forces a download of every such file, which is slow and consumes space temporarily. Deduplicate before enabling Optimise Mac Storage, not after.
The faster route
The Terminal method is genuinely usable and costs nothing. Its weakness is the review step: a list of hashes and paths tells you two files match, but not which one to keep, and you cannot see what you are deleting.
CleanerMac's duplicate finder does the same SHA-256 content matching across Downloads, Documents, Desktop, Pictures and Movies, then presents each group visually — thumbnails, full paths, sizes and dates side by side — with one copy pre-selected to keep. You confirm per group or across all groups, and the copies you remove go to the Trash rather than being erased, so an accidental deletion is recoverable. It runs entirely on-device with nothing uploaded, is a native menu-bar app for macOS 13 and later on Apple Silicon and Intel, ships in 20 languages, and is a one-time $24.99 purchase with a 3-day free trial.
Keeping duplicates from coming back
- Empty Downloads weekly. It is where duplicates breed. Anything you want to keep belongs somewhere else.
- Move, don't copy. Hold ⌘ while dragging in Finder to move a file between folders instead of copying it.
- Use aliases or tags instead of a second copy when a file needs to appear in two places.
- Import photos from one source only. Choosing either the phone or the camera backup, not both, prevents most photo duplication.
- Stop making manual backup copies. Time Machine and version history already do this without filling the disk.
Fold a duplicate scan into a wider monthly pass — see freeing up space on a Mac, finding large files, and the overall routine in the Mac cleaner guide. If you are comparing paid tools for the job, the CleanMyMac alternative comparison covers the trade-offs.
Reclaim the space duplicates are using
Content-matched, shown side by side, recoverable from the Trash.
Download CleanerMac — free for 3 daysmacOS 13+ · Apple Silicon & Intel · $24.99 once, no subscription
Frequently asked questions
How do I find duplicate files on my Mac for free?
Use Terminal: find ~/Downloads -type f -exec shasum -a 256 {} + | sort | uniq -w64 -D lists every group of byte-identical files in that folder. Swap in Documents, Desktop, Pictures or Movies. For photos specifically, the Photos app has a built-in Duplicates album in the sidebar under Utilities since macOS Ventura.
Does macOS have a built-in duplicate file finder?
Only for photos. The Photos app detects duplicates within its library and offers to merge them, keeping the best version. Finder has no duplicate detection for general files, so you need either the Terminal hashing approach or a third-party tool for Downloads, Documents and the rest of your disk.
Is it safe to delete duplicate files?
Deleting extra copies of byte-identical files is safe, provided you keep one and send the rest to the Trash rather than erasing them. Be careful with anything a tool labels similar rather than identical — different resolutions or formats of the same image are not duplicates. Also check that the files are not inside an app bundle or a Photos library package.
Why did deleting duplicates free less space than expected?
Usually APFS cloning. When you copy a file within the same volume, macOS often creates a clone that shares the underlying storage until one copy is modified, so two apparent 2 GB files may occupy 2 GB in total. Deleting one frees nothing. Duplicates that came from separate downloads or imports are real copies and do free space.
Should I look for duplicates in the Library folder?
No. Apps deliberately keep identical resources in separate cache and support directories, and removing one can break the app or force an expensive re-download. Clear caches through the normal process instead, quitting each app first, and keep duplicate scanning to your Downloads, Documents, Desktop, Pictures and Movies folders.
How does content matching find renamed copies?
A hash such as SHA-256 is computed from a file's actual bytes, so the filename, folder and modification date are irrelevant. Two files with the same hash have the same content, full stop. That is why content matching finds beach-final.jpg and IMG_4821 copy.jpg as duplicates while a name-based search misses them entirely.