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 copy | Same file hash? | Found by our finder? |
|---|---|---|
| Copied or downloaded twice | Yes | Yes (removed in its SHA-256 step) |
| Converted between JPEG and PNG, or re-saved at another quality | No | Yes, at the default setting |
| Shrunk, for example by a chat app or an upload form | No | Yes, at the default setting |
| Metadata removed or edited, pixels untouched | No | Yes, because only pixels are compared |
| Brightness or contrast adjusted | No | Usually |
| Small crop | No | Often; the loosest choice catches more |
| Burst shots or several frames of one scene | No | Sometimes, so check by eye |
| Mirrored, rotated or heavily cropped | No | Rarely or not at all |
| RAW and JPEG versions of one shot | No | No, most browsers cannot open RAW files |
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.
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.
Run these commands on exported or ordinary folders, not on 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
- 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.
- 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.
- 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.
- 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.
- 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, not color or exact pixels. 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 only the one added earliest, not necessarily 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 safe routine for deleting duplicates
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
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.
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.