Duplicates

How to find and delete duplicate photos

The short answer

Start with what your device already has: the Duplicates album in Photos on iPhone, iPad and Mac, or the "Duplicate files" card in Files by Google on Android. On Windows, Mac or Linux you can find exact copies by comparing SHA-256 file hashes, and you can find resized or re-saved copies with a visual tool such as our Duplicate Image Finder. Whatever you use, back up first, review every group, keep the largest copy, and empty the trash only after checking your library.

A photo library collects copies faster than you notice. The same memory card gets imported twice, a chat app saves a smaller version of a picture you already have, an editing app saves "IMG_2041 (1).jpg" next to the original. You end up with several files for one picture, and no single tool finds every kind of copy.

This guide covers what each platform offers, how to check files by hand, when a visual tool helps, and a deletion routine that keeps you from losing the copy you wanted. Platform steps come from Apple's, Google's, Microsoft's and Samsung's own help pages, with versions named where the page names them.

Exact duplicates and near-duplicates

Which tool you need depends on which kind of copy you have.

  • Exact duplicates are byte-for-byte identical files, often with different names or in different folders. A file hash, a short fingerprint computed from the file's bytes, finds them without guesswork. Identical files always give the same hash.
  • Near-duplicates look the same to you but are different files. Something re-saved, resized, converted or edited the picture, so the bytes changed and the hash no longer matches. Finding these means comparing what the pictures look like.
What happened to the copySame file hash?Found by our finder?
Copied or downloaded twiceYesYes (removed in its SHA-256 step)
Converted between JPEG and PNG, or re-saved at another qualityNoYes, at the default setting
Shrunk, for example by a chat app or an upload formNoYes, at the default setting
Metadata removed or edited, pixels untouchedNoYes, because only pixels are compared
Brightness or contrast adjustedNoUsually
Small cropNoOften; the loosest choice catches more
Burst shots or several frames of one sceneNoSometimes, so check by eye
Mirrored, rotated or heavily croppedNoRarely or not at all
RAW and JPEG versions of one shotNoNo, most browsers cannot open RAW files
Which kinds of copies a file hash and our finder catchA file hash only matches identical files. The finder also catches re-saved, converted, shrunk and metadata-changed copies, often catches brightness changes, small crops and burst shots, and rarely mirrored or rotated ones.same file hash?found by our finder?Copied or downloaded twice✓✓Converted JPEG ↔ PNG, or re-saved✗✓Shrunk by a chat app or upload form✗✓Metadata removed or edited✗✓Brightness or contrast adjusted✗~Small crop✗~Burst shots of one scene✗~Mirrored, rotated or heavily cropped✗✗✓ yes ~ often or usually, check by eye ✗ no
Summary of the table in the text (RAW plus JPEG pairs are not found because browsers cannot open RAW files). Always look at what is marked before you delete anything.

Where the copies come from

Knowing how a copy was made tells you which kind it is, and so which check will find it. It also shows you what to change so the copies stop piling up.

How it happenedKind of copyHow to stop it
A memory card imported twice, or onto two computers that were later mergedExactImport into one place, and clear the card only after checking the import
A backup folder copied back into the library, or two apps syncing the same folderExactLet one app or service own each folder
Pictures sent through chat apps or social sites and saved againNear: smaller and re-compressedSave only pictures you don't already have the original of
Edits saved as a new photo, such as Google Photos' Save as copyNear: same picture with editsDecide at once whether you still need the unedited version
HEIC photos converted to JPEG next to the originalsNear: different formatConvert into a separate folder, then keep one format

Google says Save as copy makes a new photo with your edits and leaves the original unchanged, so every edit saved that way leaves two pictures behind. Our guide to HEIC and JPEG covers when keeping both formats is worth it.

iPhone, iPad and Mac: the Duplicates album

The Photos app looks for duplicates in your library by itself. Apple says the Duplicates album is available on iOS 16, iPadOS 16.1 and later, and its Photos User Guide for Mac documents it for macOS Ventura 13 and later.

  • iPhone and iPad: open Photos, tap Collections (Albums in iOS 16), swipe up to Utilities and tap Duplicates. Tap Merge, then confirm.
  • Mac: open Photos and click Duplicates in the sidebar. In recent versions it sits under Utilities; hover over Utilities and click the arrow if you can't see it. Select the sets you want and click Merge.

On iPhone and iPad, Apple says merging combines the highest image quality and the relevant data into one photo and moves the others to Recently Deleted. On Mac, one original is kept for each set you merge and the rest go to Recently Deleted, where you can recover them within 30 days. The album appears only if Photos finds duplicates, and a large library can take a while to be analyzed. Apple's pages don't say how Photos decides that two items are duplicates, so look at each pair before you merge.

If you can't find the album, Apple's page on a missing Duplicates album says it appears only after the iPhone has indexed your library and found duplicates. To check, open Photos, tap Library and scroll to the bottom: a status message shows while indexing is still running. Detection needs the iPhone to be locked and connected to power, and depending on the library's size and other background tasks it can take from a few minutes to a few days. Leaving the phone on its charger overnight is the simplest way to let it finish.

Android and Google Photos

On Android, Files by Google can list duplicate files. Open the app, tap Clean in the menu, tap Select files on the "Duplicate files" card, choose the ones to remove and move them to Trash. Google marks one file in each set with an "Original" badge and recommends keeping it. The page covers files on the device, not just photos, and doesn't say how a duplicate is identified.

On a Samsung Galaxy, Samsung's help page describes My Files, then Analyse Storage, then Duplicate files. It is dated May 2023, so menu names may differ. It warns that if you delete every file after checking them, the originals are deleted too. Always leave one copy of each picture unticked.

Google Photos works differently. Its Android help page describes photo stacks: turn on Stack similar photos under More, and similar photos are grouped in your Photos view. Google says stacking doesn't change your available storage, and stacks only work for backed-up photos. A stack tidies what you see, so you still have to delete extra copies yourself.

Windows, Mac and Linux folders: compare hashes

We did not find a duplicate-photo finder in Microsoft's documentation for File Explorer or the Photos app. What Windows does document is hashing, which works on any folder on any system. It finds exact copies only, so a re-saved or resized copy slips through, but what it finds is certain: Microsoft's documentation says files with identical hash values have identical contents.

Windows

In PowerShell, open the photo folder and run:

Get-ChildItem -Recurse -File | Get-FileHash | Sort-Object Hash | Format-Table Hash, Path -Wrap

Microsoft's Get-FileHash page says it uses SHA256 unless you choose another algorithm. Rows with the same Hash are identical files, and the sort puts them side by side. To check one file from Command Prompt, certutil takes a file name and an algorithm, and SHA256 is one of the algorithms it lists:

certutil -hashfile photo.jpg SHA256

macOS and Linux

In Terminal, from the folder you want to check:

find . -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.heic' \) -exec shasum -a 256 {} + | sort

macOS includes shasum (type man shasum for its options), and -a 256 selects SHA-256. Each output line is a hash and a path, and the sort puts identical hashes on neighboring lines. The command also runs on Linux systems with shasum installed.

List only the duplicates

On a large folder, the full list buries the matches among thousands of unique files. In PowerShell, this version keeps only hashes that appear more than once and saves them as a spreadsheet in your user folder:

Get-ChildItem -Recurse -File | Get-FileHash | Group-Object Hash | Where-Object Count -gt 1 | ForEach-Object { $_.Group } | Select-Object Hash, Path | Export-Csv "$HOME\duplicates.csv" -NoTypeInformation

Open duplicates.csv in any spreadsheet app. Rows with the same Hash are one picture saved several times; sort by Hash and every set sits together. On macOS or Linux, pipe the earlier command through awk to print only lines whose hash repeats:

find . -type f \( -iname '*.jpg' -o -iname '*.jpeg' -o -iname '*.png' -o -iname '*.heic' \) -exec shasum -a 256 {} + | sort | awk '$1==h{if(!p)print l; print; p=1; next} {h=$1; l=$0; p=0}'

We tested this line on a folder with subfolders, mixed-case extensions and spaces in file names. Exact copies have identical bytes, so the capture date, location and any other metadata inside the files are identical too (only the dates your file system keeps may differ), and any one of them can be the keeper. Keep the copy in the folder you organize, and delete the stray in Downloads or the old backup.

Keep out of the Photos library

Run these commands on exported or ordinary folders and keep them away from the inside of a Photos library. Apple's Photos guide for macOS Monterey warns that changing a library's contents in Finder can delete or corrupt it. Delete from inside the Photos app instead.

When to use our Duplicate Image Finder

Use our Duplicate Image Finder for a folder where the copies were resized, re-saved or converted, so the hash check misses them. It compares the pictures in your browser and doesn't change or delete the files on your disk. Read our privacy policy before adding personal photos to any online tool, ours included.

How it works

  1. Add your photos. Drag a folder or images anywhere onto the page, or click the drop box. Subfolders are included and non-image files are skipped.
  2. Exact copies go first. The tool computes a SHA-256 hash of every picture file and drops byte-identical ones, keeping the first. The rest are compared by appearance, and groups appear at once.
  3. Choose how alike. "Exact copies" is the strictest, "Resized or re-saved" is the default, and "Similar-looking" is the loosest. It also catches small crops and alternate versions, but a few unrelated pictures can sneak in. Choose first, because regrouping re-checks every box.
  4. Review each group. Every thumbnail shows its file name, pixel size and file size. Everything starts checked, meaning "keep". Uncheck the copies you don't want, or clear a group's header checkbox and click the one picture to keep.
  5. Download Selected. The checked pictures go into deduplicated_images.zip, unchanged and under their original file names. Pictures with no match are listed under "Unique Images" and start checked too, so the ZIP holds your whole cleaned set.

The comparison looks at the broad pattern of light and dark in a small grayscale version of each picture and ignores color and exact pixel values. That is why it survives resizing and recompression, and also why a black-and-white copy can group with its color original. Our perceptual hashing guide explains the method and the thresholds behind the three choices.

Choosing the keeper

The first picture in a group is simply the one added earliest, which may or may not be the best. Groups are built against that first picture, so a near-copy of a member can land elsewhere. Judge by the numbers under each thumbnail:

  • Prefer the largest pixel size, but look at the picture too. An upscaled copy is big without having more detail.
  • At the same size and format, the larger file was usually saved at higher quality.
  • Pass over copies with watermarks, borders or tight crops.

What it can't do

  • Delete anything. It only builds the ZIP. Unzip it into a new folder, check it, and retire the old folder yourself. It can't touch your phone or your Photos library, so use it on exported or copied folders.
  • Reliably find mirrored or rotated copies. Heavily cropped or zoomed copies are often missed too.
  • Read every file. Files your browser can't display are skipped and appear in no group. That can include RAW files and, depending on the browser, iPhone HEIC photos. Convert them first, or use Apple's Duplicates album.
  • Keep same-named files apart. The ZIP stores files by name only, so two different pictures with the same file name overwrite each other. Rename one before loading if that could happen.
  • Handle huge folders in one go. Every image stays loaded in the page, and comparisons grow with the square of the picture count (up to about 500,000 for 1,000 pictures, 50 million for 10,000). Work in batches, then run the keepers through together once.

A worked cleanup: one messy folder on a computer

Say a folder called Photos 2025 holds camera originals, a phone export, pictures saved from a family group chat, and a copy of last year's backup that someone dragged in. Here is the order that finds every kind of copy with the least review.

  1. Copy the folder to another drive. Everything below works on the original, and the copy is your way back.
  2. Remove exact copies with a hash. Run the duplicates-only command above. The backup folder shows up as hundreds of pairs, each with one path inside backup. Delete the backup side of every pair; no visual check is needed for byte-identical files.
  3. Check for clashing names. Two cameras can both produce IMG_0001.JPG. If file names repeat across subfolders, add a prefix per source (for example phone_ and camera_) before the next step, because the finder's ZIP stores names only.
  4. Load the trusted files first. In the duplicate finder, drop the camera and phone folders first, then the chat folder in a second drop. Each group is built around its earliest file, so the full-size originals end up anchoring the groups (our perceptual hashing guide works through why order matters).
  5. Review with the numbers. A typical group holds camera_IMG_4471.JPG at 4032×3024 and a chat copy at 1600×1200 a tenth of the size. Untick the chat copy. When a chat copy is the only version of a picture, it has no group and stays in Unique Images, ticked.
  6. Download and count. Note "Selected Images" before you click Download Selected, unzip deduplicated_images.zip into a new folder, and compare the file count. Fewer files than selected means two names still clashed.
  7. Catch the mirrored copies. Run the cleaned folder through Group Similar Images at its Near-copies setting. It uses an AI model that describes content, so flipped versions, which the finder misses, group with their originals.
  8. Swap the folders. Rename the old folder to Photos 2025 (before cleanup), put the cleaned one in its place, and keep the old one until you have used the new one for a while.

A safe routine for deleting duplicates

  1. Back up first. Copy the whole library somewhere else before you delete anything. Apple's delete page tells you to back up the photos you still want before you start.
  2. Know what syncs. With iCloud Photos on, Apple says deleting a photo on one device deletes it on every other device signed in with the same Apple Account. Google says items deleted from Google Photos are also removed from Android phones, iPhones and iPads with backup on, and from albums and shared albums. Delete once, deliberately, in one place.
  3. Review every group and keep the best copy. Don't merge or delete everything with one tap until you have looked at the sets. Keep the highest pixel size, then the least compressed, with no watermark or crop.
  4. Check which copy holds the metadata or edits. The copy you would delete may be the one with the original date, the location or your edit. Re-saving can drop or change metadata, depending on the app that did it. Open both files in our metadata viewer to compare, and read what EXIF data contains if you're unsure what to look for. Apple says its merge combines the relevant data across the duplicates; don't assume other tools do.
  5. Delete to the trash and wait. Apple's Recently Deleted and Google Photos' trash both hold items for 30 days. Spot-check your albums and a few photos during that time. Emptying the trash is permanent, and Google says it can't be undone, even with Google Takeout.
  6. Keep the backup a while longer. Retire it only after you have lived with the cleaned library.

What automatic tools get wrong

  • They don't know which copy you prefer. Apple's iPhone merge keeps the highest-quality version, and Google marks an "Original" without saying how it chose. Neither knows that you like the cropped one.
  • Similar is not the same. Burst frames and two shots of one view can look like duplicates to a tool and be different pictures to you.
  • They miss copies that were changed too much. Hashes miss anything re-saved. Visual tools can miss mirrored, rotated and heavily cropped copies.
  • Visual tools over-group plain pictures. Simple graphics and subjects centered on plain backgrounds share broad layouts, so loosen strictness only one step at a time.

Troubleshooting

SymptomLikely causeWhat to do
The hash command finds nothing, yet you can see copiesThe copies were re-saved, resized or converted, so their bytes differUse a visual check: the Duplicates album, or our finder for folders
The Mac command lists many small files whose names start with ._On drives formatted for Windows (FAT32, exFAT), macOS keeps extra file information in hidden companion files named after the original with a ._ prefix, and many of them can be byte-identicalThey are not photos; add ! -name '._*' after the closing bracket of the find conditions to skip them
A rotated copy is not grouped by our finderA quarter turn rearranges the whole layout of light and darkTurn rotated photos upright with Rotate & Flip first, then compare again
Merged or deleted photos reappear laterAnother app or device syncing the same folder or account uploads its copy againFind the second sync source and turn it off, then delete once
Photos merged a pair you wanted to keep separatelyThe merge moved the other copy to Recently DeletedRecover it from Recently Deleted within 30 days
Put this into practice

Group visually similar images with perceptual hashing. It catches resized, re-saved and lightly edited copies that file hashes miss. It runs in your browser. Open the Duplicate Image Finder.

Frequently asked questions

Can I find duplicates by comparing file names or sizes?

Not reliably. A copy often gets a new name, and two different pictures can share one. Identical files always have the same size, so size can rule a pair out but can't prove a match. A hash or a visual comparison can.

Can I find exact duplicates of RAW or HEIC files?

Yes. A hash is computed from a file's bytes, not its picture, so the commands above work on any file type. In the macOS command, add the extensions you need, such as *.cr2 or *.dng. The PowerShell command already covers every file. Our finder can't read formats your browser can't display, so a hash check is the dependable option for those files.

Can I find duplicate videos too?

Apple's pages say its Duplicates album covers photos and videos. Our finder handles pictures only: it skips files that aren't images and compares GIFs by their first frame. For videos on a computer, the hash commands above work the same way, but they find exact copies only.

How can I check that the cleanup lost no picture?

Compare the file hashes of the old and the cleaned folder. On macOS or Linux, run this from the folder that holds both, with your own folder names in place of old and new (in quotes if they contain spaces):

(cd old && find . -type f -exec shasum -a 256 {} + | cut -c1-64 | sort -u) > old.txt
(cd new && find . -type f -exec shasum -a 256 {} + | cut -c1-64 | sort -u) > new.txt
comm -23 old.txt new.txt

The last line prints every file content that exists only in the old folder. After removing exact copies it should print nothing. After a visual cleanup, it prints one line per copy you unticked, so the line count should match the number of pictures you chose to drop.

I am building a training dataset. Is deduplicating different?

The steps are the same, but the stakes are higher: a picture that appears three times is learned three times. Deduplicate before you color-correct or tag, and keep a near-duplicate only if it adds something new. Our dataset cleaning workflow shows where this step fits.