Skip to content
NexaFile

Guide · 8 min read

How to find duplicate files on a Mac, free or with an app

macOS has no general duplicate file finder, but it can find some duplicates for free. For photos and videos, open Photos and click Duplicates under Utilities. For songs, use Music's File › Library › Show Duplicate Items. For other files, make a Finder Smart Folder and sort it by name or size to spot likely copies, then confirm they're identical with a checksum in Terminal. For whole folders of documents and downloads, an app such as NexaFile for Mac compares every file by content and makes removal undoable.

Updated · From the team that makes NexaFile for Mac

The short answer

  1. 01

    Photos: open the Duplicates album. In Photos, click Duplicates under Utilities in the sidebar, select the copies and click Merge. The extra copies go to Recently Deleted for 30 days.

  2. 02

    Music: show duplicate songs. In Music, click Songs, then choose File › Library › Show Duplicate Items. Hold Option to choose Show Exact Duplicate Items instead.

  3. 03

    Finder: make a Smart Folder. Choose File › New Smart Folder, add a rule such as Kind is Document, switch to list view and sort by Name or Size to see likely copies side by side.

  4. 04

    Terminal: confirm with a checksum. Files with the same checksum (md5 -r file) have identical content. The command further down lists every set of identical files in a folder without changing anything.

  5. 05

    Use an app for whole folders. To compare thousands of files by content and remove copies with an undo, use a duplicate finder such as NexaFile for Mac.

Find duplicate photos and videos in Photos

The Photos app finds duplicate photos and videos in your Photos library by itself, in macOS Ventura 13 and later, including Sonoma, Sequoia and Tahoe. Open Photos and click Duplicates under Utilities in the sidebar. Merging keeps one copy in your library and moves the others to Recently Deleted, where you can recover them for 30 days.

Photos fills the Duplicates album after it has analysed your library, which can take a while for a large library, and the album doesn't appear if it has found none. It only looks inside the Photos library: photos saved as files in Finder folders, such as Downloads or an exported folder, are not checked.

  1. Open Photos and click Duplicates under Utilities in the sidebar. If you don't see it, hover over Utilities and click the arrow to show it.
  2. If you use an iCloud Shared Photo Library, choose Both Libraries from the Library pop-up menu in the toolbar.
  3. Select the duplicates to merge, in one row or several rows. Press ⌘A to select them all.
  4. Click Merge, then confirm. One copy stays in your library; the rest go to Recently Deleted.

Find duplicate songs in Music

The Music app can list duplicate songs in your library. Click Songs in the sidebar, select a song, and choose File › Library › Show Duplicate Items. To see only exact duplicates (the same song, artist, album and version), hold Option and choose File › Library › Show Exact Duplicate Items. Click Done, or choose Show All Items, to go back to the full library.

Show Duplicate Items is broad: the same song on an album and on a compilation, or a live and a studio version, can appear together. Check the album and version columns before you delete anything, or use Show Exact Duplicate Items when you only want to remove accidental double imports. If you use iCloud Music Library or Sync Library, deleting a song from your library can remove it from your other devices too.

Spot likely duplicates in Finder

Finder can't compare file contents, but a Smart Folder sorted by name or size puts likely copies next to each other. Choose File › New Smart Folder, set where to search and what to look for, then switch to list view (View › as List) and click the Name or Size column heading. Files with the same size, or names like "report copy.pdf" and "report (1).pdf", are candidates to check.

A matching name or size is only a hint. Two different files can share a name or size, and a renamed copy won't sort next to the original. Before deleting anything you can't afford to lose, confirm the files are identical with the Terminal check in the next section.

  1. In Finder, choose File › New Smart Folder. Click This Mac, or the name of the folder you were in, to set where to search.
  2. Click the Add button (+) below the search field and choose a rule, such as Kind is Document or Kind is Image. To narrow it to large files, choose Other from the first pop-up menu, tick File Size, and add a rule such as File Size is greater than 100 MB.
  3. Choose View › as List and click the Size column heading, then the Name heading, to put matching files side by side.
  4. Select a file and press Space to preview it with Quick Look, or press ⌘I to see its size in bytes and compare it with the other copy.
  5. Click Save to keep the Smart Folder in the sidebar for next time. It updates by itself as files change.

Confirm duplicates with a checksum in Terminal

To check whether two files are identical, compare their checksums: open Terminal (in Applications › Utilities), type md5 -r and drag both files onto the window, then press Return. If the two long codes match, the files have the same content. To list every set of identical files in a folder, the command below reads each file and prints matching checksums together. It only reads: it never moves or deletes anything.

Reading every file takes time on a large folder, and in folders kept in iCloud Drive it can make macOS download files that are stored only in iCloud. Run it on one folder at a time, preferably on files that are already on your Mac.

  1. Open Terminal from Applications › Utilities.
  2. Paste this command, replacing ~/Downloads with the folder you want to check (you can type find and drag the folder onto the window instead): find ~/Downloads -type f -size +0 ! -name .DS_Store -exec md5 -r {} + | sort | awk '{ if ($1 == h) { if (!shown) print last; print; shown = 1 } else shown = 0; h = $1; last = $0 }'
  3. Press Return. Each line shows a checksum and a file path; lines that share a checksum are copies of the same file. Empty files and .DS_Store files are left out.
  4. To be certain about a pair before deleting one, run cmp "first file" "second file". It prints nothing if the files are identical.
  5. Delete copies in Finder by dragging them to the Trash, so you can still put them back. Don't paste commands that delete files, such as rm or fdupes -d: they skip the Trash and can't be undone.

Find and remove duplicates with NexaFile for Mac

NexaFile for Mac does the checksum comparison for a whole folder and lets you remove the copies safely. It compares files by size and a SHA-256 fingerprint of their content, so renamed copies are found, lists groups by how much space they waste, and sends removed copies to the Trash with an entry in Undo History that puts them back. It is coming soon to the Mac App Store.

Scanning and removing duplicates one group at a time are free. A one-time purchase, not a subscription, unlocks cleaning up every group at once, organising folders, applying Smart Rename, PDF dates and audio tag editing. NexaFile for Mac finds exact duplicates only, not similar photos or duplicate folders, scans one folder (with its subfolders) at a time, and leaves the Photos and Music libraries to those apps.

  1. Click Choose Folder (⌘O) and pick a folder, such as Downloads, Documents or a folder on an external drive. The app only sees folders you choose.
  2. The scan starts on its own (press ⌘R to scan again). Duplicates are grouped by content, biggest savings first. Filter by file type if the list is long, and preview any copy with Quick Look.
  3. Use Smart Select to keep the oldest or newest copy, the one with the shortest path or name, or the copy in folders you prefer, and review the groups.
  4. Confirm. Each copy is checked again just before it moves, files inside apps and libraries are never touched, and the copies go to the Trash. Open Undo History to put them back.

Which method should you use?

Use Photos and Music for duplicates inside their own libraries: they are free and handle the library safely. Use a Finder Smart Folder to spot a few obvious copies, and the Terminal checksum to prove two files are identical. For whole folders of documents, downloads or backups, a duplicate finder app saves the manual checking.

Ways to find duplicate files on a Mac, compared in November 2026
Photos / MusicFinder Smart FolderTerminal checksumNexaFile for Mac
FindsDuplicates inside the Photos or Music libraryFiles with similar names or sizes, to check by handEvery set of identical files in a folderEvery set of identical files in a folder, grouped
Compares contentPhotos: decided by Photos. Music: by song detailsNoYes (MD5)Yes (SHA-256), checked again before removal
Removing copiesMerge or delete in the appBy hand in FinderBy hand in FinderChoose the copy to keep with Smart Select, then confirm
Getting them backPhotos: Recently Deleted for 30 daysTrashTrash, if you deleted in FinderTrash and Undo History
CostFree, built inFree, built inFree, built inFree to remove group by group; one-time purchase for the rest

How to delete duplicates safely

The safe way to delete duplicates is to keep a backup, check that the copies really are identical, and move them to the Trash rather than deleting them outright, so you can change your mind. A few cases need extra care:

  • Back up first. A recent Time Machine backup means even an emptied Trash isn't the end.
  • Never delete files from inside the Photos Library, Music folder or an app's package in Finder. Use the app itself, or the library can break.
  • Deleting a file in iCloud Drive deletes it on all your devices, not just this Mac.
  • Keep the copy in the place other apps expect. A project, a website folder or a music library may break if its copy goes and a copy elsewhere stays.
  • Empty the Trash only after you've checked that everything still opens.

Common questions

Does a Mac have a built-in duplicate file finder?

Not for all files. Photos finds duplicate photos and videos in its library (Duplicates under Utilities, in macOS Ventura 13 and later), and Music can show duplicate songs (File › Library › Show Duplicate Items). For documents and other files you need a Finder Smart Folder, a Terminal checksum or a duplicate finder app.

How do I find duplicate files on a Mac for free?

Use the Duplicates album in Photos for photos and videos, Show Duplicate Items in Music for songs, and a Finder Smart Folder sorted by name or size for other files. To prove two files are identical, compare their checksums with md5 -r in Terminal.

Can Finder find duplicate files?

Not directly. Finder can't compare file contents, but a Smart Folder (File › New Smart Folder) in list view, sorted by name or size, puts likely copies next to each other for you to check.

How do I find duplicate files using Terminal?

Run find ~/Downloads -type f -size +0 -exec md5 -r {} + | sort to print a checksum next to every file in the folder, sorted so identical files are next to each other. The command in this guide also hides files that have no copy. Both only read files; delete copies in Finder so they go to the Trash.

Is it safe to delete duplicate files on a Mac?

Yes, if the files are truly identical, you keep the copy other apps expect, and you move the extras to the Trash instead of deleting them outright. Never delete files from inside the Photos or Music library in Finder, and keep a backup of anything important.

Does Photos find duplicates of photos stored in Finder folders?

No. The Duplicates album only covers photos and videos inside your Photos library. Image files in Finder folders, such as Downloads, need a Finder search, a Terminal checksum or a duplicate finder app.