Hopp til innhold
Dropit
Last ned

How to find and delete duplicate files on a Mac

What counts as a duplicate, how content hashing actually works, and how to decide which copy to keep without breaking an app.

8 minutters lesing · Oppdatert 8. september 2026

Artiklene våre skrives bare på engelsk. Appen og resten av nettstedet er fullt oversatt.

What a duplicate actually is

The only definition worth acting on is byte-identical: two files whose contents are exactly the same, regardless of name, date or location. Same-name-different-content files are not duplicates, and same-content-different-name files are — which is why searching Finder for "copy" finds almost nothing useful.

Photos deserve a separate note. Two exports of the same photo at different resolutions are not byte-identical, so a file-level duplicate finder will not flag them. Visual-similarity matching is a different problem and belongs in Photos, which has a built-in Duplicates album for exactly this.

Duplicates on a Mac usually come from four places: downloading the same file twice, restoring from a backup into a new folder, syncing a folder into iCloud Drive as well as keeping a local copy, and exporting the same project repeatedly with different names.

How a duplicate finder works

Hashing every file on a drive would take hours, so any competent tool does it in three narrowing stages.

First, group by size. Files of different sizes cannot be identical, and this alone eliminates the overwhelming majority of candidates with no reading at all — the size is already in the directory entry.

Second, hash the first few kilobytes of each file in a size group. Files that differ near the start — which is most near-misses, since headers differ — drop out after one small read.

Third, hash the full contents of whatever survives, and only then declare a match. A modern hash such as BLAKE3 runs at gigabytes per second, and the file is memory-mapped rather than copied, so the last stage is bound by disk throughput.

That staging is why a good tool scans a full drive in minutes rather than hours. It is also why "found 40,000 duplicates" is usually a bad sign: it means the tool matched on name or size alone.

Doing it without any tool

For a single folder you can do this from the terminal. The command below hashes every file under a directory, groups by hash and prints only the groups with more than one member. It is read-only.

It is fine for ~/Downloads or a project folder. Run it against your whole home directory and it will hash tens of gigabytes, which is exactly the work the three-stage approach exists to avoid.

find ~/Downloads -type f -print0 \
  | xargs -0 shasum -a 256 \
  | sort \
  | awk '{ if ($1 == prev) { if (!shown) print pline; print; shown=1 } else shown=0; prev=$1; pline=$0 }'

Choosing which copy to keep

This is the part where people lose data, so decide before you delete rather than during.

Prefer the copy in the location you would look for it in a year — the project folder, not Downloads. Prefer the oldest file when the modification date is the only difference; it is the original, and the newer one is the copy. Prefer the copy outside any synced folder if you are deleting to save local space, because deleting the iCloud Drive or Dropbox copy deletes it for every device.

And never delete every member of a group. Any tool worth using enforces this — the last remaining copy must not be selectable.

  • Never delete both copies of a group. Keep exactly one.
  • Do not delete duplicates inside application bundles (.app) or library packages (.photoslibrary, .musiclibrary). Identical files in there are usually meant to be there.
  • Do not delete duplicates inside node_modules, .git, vendor/ or Pods/ — package managers deduplicate on their own terms and a "duplicate" file is often a hard link or a required copy.
  • Be careful in synced folders: iCloud Drive, Dropbox and Google Drive propagate the deletion everywhere.
  • Trash first, empty later. Give yourself a week.

Hard links are one file with two names. Deleting one name frees nothing, and a tool that counts hard-linked copies as duplicates will overstate what you can reclaim.

The four places duplicates come from, and how to stop them

Deleting duplicates is treating a symptom. Each of the common sources has a fix that stops them recurring.

Download duplication — the same file fetched twice, arriving as "report.pdf" and "report-1.pdf" — is fixed by clearing Downloads regularly rather than by any setting. macOS never overwrites, it always suffixes, so this accumulates indefinitely.

Backup restore duplication happens when you restore a Time Machine backup into a new folder rather than over the original, leaving two full copies of a document tree. The fix is to reconcile immediately after a restore, while you still remember which one is current.

Sync duplication is the most annoying: a folder that exists both in iCloud Drive and in its old local location, or a Dropbox conflict copy ("file (conflicted copy).docx"). Pick one canonical location per project and use an alias for the other. Conflict copies are worth reading before deleting — by definition, both sides were edited.

Export duplication is self-inflicted: repeated exports of the same video or design at the same settings. A dated export folder that you clear quarterly solves it.

How much you will get back

Set expectations honestly: on a typical personal Mac, true byte-identical duplicates outside developer folders come to 2–10 GB. It is real, it is worth reclaiming once, and it is rarely the largest problem on the drive. If you are 200 GB short, duplicates are not the answer — one forgotten VM image or a simulator runtime collection almost certainly is.

Dropit runs the three-stage scan described above (size buckets, then a 4 KB head hash, then a full BLAKE3 hash, in parallel across cores) and groups the results by wasted bytes so the biggest win is at the top. Scanning is free; you can see how many groups exist and how much space they represent before paying anything. Actually staging the extra copies for the Trash — with the last copy in each group locked so it cannot be selected — is part of the paid half.

Spørsmål

  • Does macOS have a built-in duplicate file finder?

    Not for general files. Photos has a Duplicates album for images and videos in your library, and Smart Folders in Finder can match on name or kind but not on content.

  • How do duplicate finders compare files?

    Good ones group by size, then hash a small prefix, then hash the full contents of the survivors. Matching on name or size alone produces false positives and should be treated as a warning sign.

  • Is it safe to delete duplicate files on a Mac?

    Yes, provided you keep one copy of each group and stay out of application bundles, library packages, .git and node_modules. Send them to the Trash rather than deleting outright.

  • Why do duplicates keep coming back?

    Usually a sync client re-downloading a file you deleted on one side only, or a backup restore writing a second copy into a new folder. Fix the source before running another sweep.

Få plassen tilbake i kveld.

Én betaling. Alle fremtidige oppdateringer inkludert. Fungerer på to av Mac-ene dine.

Last ned