How to find duplicate files on a Mac: 5 free ways

Extra copies of photos, downloads and documents waste gigabytes without you noticing. Here is how to find duplicate files on a Mac for free, and how to remove them without losing the one you need.

Last updated

Every method below works on any MacBook Air, MacBook Pro, iMac, Mac mini or Mac Studio. The menus match macOS Ventura and later.

The short answer

  1. For photos and videos, open Photos and choose Duplicates in the sidebar.
  2. For songs, open Music and choose File, then Library, then Show Duplicate Items.
  3. For every other file, run the Terminal command below. It matches copies byte for byte.

Which method should you use?

MethodFindsExact match?Skill level
1. Photos Duplicates albumPhotos and videosYes, plus near-copiesBeginner
2. Music duplicate viewSongsBy title and artistBeginner
3. Finder size sortAny file typeNo, you compare by eyeBeginner
4. TerminalAny file typeYes, byte for byteAdvanced
5. Duplicate finder appAny file typeYes, in most appsBeginner

What counts as a duplicate?

A true duplicate has exactly the same contents as another file, whatever its name. Two files with the same name aren’t always copies, and two copies rarely share a name. Know which kind you have before you delete anything:

TypeExampleWhat to do
Exact copyreport.pdf and report copy.pdf with identical contentsKeep one, delete the rest
Same name, different contentTwo versions of budget.xlsx saved weeks apartOpen both before you decide
Similar photoFive burst shots or an edited and an original versionKeep the best, but check edits first

Find duplicate photos on a Mac with the Photos app

1. Use the Duplicates album

  1. Open Photos and click Duplicates under Utilities in the sidebar.
  2. Review each set. Photos shows the copies side by side with their size and date.
  3. Click Merge next to a set, or select several sets and click the Merge button at the top of the window.

Merging keeps the highest-quality version and moves the rest to Recently Deleted, where they stay for 30 days. Empty that album to get the space back right away.

Clean up burst photos

The Duplicates album skips burst shots, because each frame is slightly different. Open a burst, click Make a Selection, tick the frames you like and click Done. Photos offers to keep only your picks.

If you don’t see the Duplicates album

Photos only shows the album when it has found copies, and it scans in the background. After a large import, leave your Mac on and Photos open for a few hours, then check again.

Find duplicate songs in the Music app

2. Show duplicate items

Open Music and choose File, then Library, then Show Duplicate Items. Music lists songs with the same title and artist. Hold the Option key before you open the menu to choose Show Exact Duplicate Items instead, which also matches the album and version.

Delete the extras with the Delete key, then click Done to return to your full library. Live and remastered versions often share a title, so check the album before you delete.

Find duplicates with Finder

3. Sort files by size

Finder has no duplicate search, but copies always share a size, so sorting puts them next to each other.

  1. Open the folder you want to check, such as Documents, and press Command-F.
  2. Click the folder’s name next to Search so Finder searches only that folder.
  3. Click the Kind menu, choose Other, then File Size, and set it to is greater than 1 MB.
  4. Switch to list view and click the Size column.

Files with the same size and a similar name are probably copies. Press the Space bar to preview each one and confirm before you delete it.

Search for copy names

Type copy in the Finder search field to find files that Finder duplicated, such as “Invoice copy.pdf”. Then search for (1) to catch files that your browser downloaded twice.

Check the Mail Downloads folder

Mail saves a copy of every attachment you open, even if you already saved it elsewhere. Choose Go, then Go to Folder, and enter ~/Library/Containers/com.apple.mail/Data/Library/Mail Downloads. Files here are safe to delete once you have saved the ones you need.

Save it as a Smart Folder

Click Save under the search field, name the search and tick Add To Sidebar. The folder updates itself, so you can check for new copies in one click.

Find duplicate files on a Mac with Terminal

4. Compare file fingerprints

This is the most reliable free method. Terminal calculates a unique fingerprint, called a checksum, for every file. Two files with the same checksum are identical, even if their names differ.

  1. Open Terminal, type cd followed by a space, drag a folder into the window and press Return.
  2. Run this command:find . -type f -size +1M -exec shasum {} + | sort | awk '$1==h{if(!s)print l; print; s=1; next}{h=$1; l=$0; s=0}'

Terminal prints each group of identical files together, with the checksum at the start of each line. It only lists files and never deletes anything. The -size +1M part skips files under 1 MB, which saves time and rarely matters.

Read the results

Each group shares the long code at the start of the line, so every file in a group is a copy of the others. To see one in Finder, type open -R followed by a space, paste the file’s path in quotes and press Return.

Scan an external hard drive

Drag the drive from the Finder sidebar into Terminal after cd, then run the same command. A large drive can take several minutes, because Terminal reads every file.

Fix “Operation not permitted”

Open System Settings, then Privacy & Security, then Full Disk Access, and turn it on for Terminal.

Use a duplicate finder app

5. Choose an app that compares contents

An app saves time when you have years of files across many folders. Before you pick one, check that it:

  • Compares file contents, not just names or sizes.
  • Lets you choose which copy to keep in each group.
  • Moves files to the Trash instead of deleting them outright.
  • Works on your Mac without uploading your files.

dupeGuru is a free, open-source option that meets most of these.

How to delete duplicate files safely

Finding copies is the easy part. To remove duplicate files without losing the one you need, follow these rules:

  • Keep the copy in the right place. Delete the one in Downloads or Desktop, and keep the one in the folder where it belongs.
  • Use the app for app libraries. Remove photos inside Photos and songs inside Music. Never delete files from inside the Photos Library or Music folder in Finder.
  • Check iCloud Drive first. If Optimize Mac Storage is on, some files exist only in iCloud, and Terminal can’t read them until you download them.
  • Use the Trash and back up. Run a Time Machine backup, move copies to the Trash and empty it only when you’re sure.

How to stop duplicates from coming back

  • When Photos warns that an import contains duplicates, choose Don’t Import.
  • Make an alias instead of a copy when you need a file in two places.
  • Sync each folder with one cloud service, not two.
  • Clear your Downloads folder once a month.

Duplicates are only one cause of a full disk. Our guide on how to free up space on a Mac covers caches, apps and backups too.

Find every duplicate in one scan with MyMacStorage

MyMacStorage matches duplicates byte for byte, not just by name, across every folder on your Mac. You keep one copy of each file, and the rest move to the Trash.

Scanning and matching happen entirely on your Mac, and Undo puts back anything you remove. Learn more about MyMacStorage, the disk cleanup app for Mac. It costs $19.99 once, with no subscription.

Frequently asked questions

Is it safe to delete duplicate files on a Mac?

Yes, as long as the copies match byte for byte and you keep one. Move extras to the Trash rather than deleting them in Terminal, so you can put back anything you removed by mistake.

Can Finder find duplicate files on its own?

No. Finder has no duplicate search. You can sort files by size or search for names that contain copy, but you still need to compare the files yourself.

What is the best free way to find duplicates on a Mac?

Use the Photos Duplicates album for photos and videos, and the Terminal command in this guide for every other file type. Both are free, built in and match exact copies.

Does merging duplicates in Photos lose anything?

No. Photos keeps the highest-quality version and combines relevant details, such as captions, keywords and albums, into it. The extra copies go to Recently Deleted for 30 days.

Why do I have so many duplicate files?

Downloading the same file twice, importing photos more than once, copying folders between drives and syncing with more than one cloud service all create copies. Over a few years, they can add up to many gigabytes.