How to Find Duplicate Photos (and Near-Duplicates)

⏱️ 7 min readUpdated September 27, 2026

To find exact duplicate photos, compare file hashes: two files with the same MD5 or SHA-256 are byte-for-byte copies. To find near-duplicates (the same shot resized, re-saved or lightly edited), use an image hash that fingerprints what the picture looks like and count how many bits differ. We ran ten common edits on one photo to show which copies each method catches.

How do you find duplicate photos?

First decide what you're hunting. The same folder copied onto two drives gives exact duplicates, and a file hash finds them in seconds. A photo exported for Instagram, emailed smaller and screenshotted gives near-duplicates, and a file hash misses all of them. A practical order:

  1. Back up the folder first. Deleting is the only step you can't undo.
  2. Run a near-duplicate scan with the Duplicate Image Finder. Select the images, and it groups the ones that look alike.
  3. Open each group and pick the keeper: usually the largest file with the most detail.
  4. For anything you're unsure about, check exact identity with the hash generator. Matching hashes mean the files are identical.

Our tool runs in your browser. Each image is drawn to a canvas no wider than 400 pixels, fingerprinted and compared. Nothing is uploaded.

What counts as a duplicate (exact vs near-duplicate)?

An exact duplicate is the same file twice: same bytes, same hash, often a name like IMG_2041 (1).jpg. A near-duplicate shows the same picture in a different file. Resizing, re-compression, a brightness tweak or stripped metadata all rewrite the bytes, so to a file hash they're strangers.

Then there are similar photos: five burst shots of a kid blowing out candles, taken a fraction of a second apart. They're not copies, and which ones to keep is your call.

How does image hashing work?

The method our tool uses is called average hash, or aHash. It's simple enough to explain in four steps:

  1. Shrink the image to 8x8 pixels, which throws away almost all detail and keeps the broad light and dark shapes.
  2. Turn each of the 64 pixels into a single gray value by averaging its red, green and blue.
  3. Work out the mean of those 64 grays.
  4. Write a 1 for every pixel brighter than the mean and a 0 for every one that isn't. That's a 64-bit fingerprint.

Two images are compared by counting how many of the 64 bits differ. That count is the Hamming distance. Our tool puts two images in the same group when the distance is 10 or less.

Resizing and compression barely move the fingerprint. A flip or rotation moves the bright and dark regions and scrambles it.

What does each edit do to the hash? (our test)

We took one 640x427 JPEG of a temple roof, made ten versions, and computed MD5 plus the same 8x8 aHash our tool uses (in Python with Pillow). The last row is an unrelated control photo.

EditMD5 match?aHash distance (measured)Caught by our tool at ≤10?
Exact file copyYes0Yes
Resized to 50%No0Yes
JPEG re-save at quality 70No0Yes
Brightness +10%No0Yes
Converted to grayscaleNo0Yes
Cropped 5% off every edgeNo2Yes
Cropped 10% off right and bottomNo5Yes
Small text watermark in a cornerNo0Yes
Horizontal mirrorNo26No
Rotated 90°No32No
A different photo (control)No36No

These numbers come from one test image, so results will vary. Browsers also shrink images a bit differently; switching Pillow's resize filter moved the edge crop from 5 to 4 bits and the mirror from 26 to 22. MD5 caught only the untouched copy. The image hash caught every edit that kept the picture the right way round and missed both the mirror and the rotation.

Grayscale scored 0 because aHash already averages the color channels. A big, bold watermark would score higher than our small corner text.

Find duplicate and near-duplicate photos in your browser

Select a batch of images and get groups of lookalikes by filename. Nothing leaves your device.

Duplicate Image Finder →

What Hamming distance means a match?

There's no official cut-off; ours is fixed at 10 of 64. Here's how we'd read the bands, as a heuristic rather than a standard.

Distance (of 64 bits)Usual meaning (heuristic)
0Looks identical at 8x8: a copy, resize or re-save
1 to 5Same photo with a light crop, filter or compression
6 to 10Probably an edited copy; review before deleting
11 to 20Similar scene, burst shot or heavy edit; rarely a true duplicate
21 to 32Mostly unrelated, or a flipped or rotated copy
Above 32Different photos (unrelated images tend to land near 32)

Unrelated photos hover around 32 because each bit is roughly a coin flip. Plain images, like product shots on white, can land closer than they should.

Does your phone already find duplicates?

Often, yes. Since iOS 16, the iPhone Photos app has a Duplicates collection under Collections, then Utilities. Tap Merge and Photos keeps one copy, combining the best quality version with the relevant data from the others, and moves the rest to Recently Deleted. Apple says the scan needs the phone locked and on power and can take up to a few days on a big library. Macs got the same Duplicates collection in macOS Ventura, and deleted items stay recoverable for 30 days.

Google Photos checks for exact copies when you back up, so uploading the same unchanged file twice shouldn't give you two copies. It doesn't search your existing library for near-duplicates, though, and an edited, resized or re-dated copy counts as a new file.

On Windows, third-party guides say newer versions of Microsoft Photos flag exact duplicates, but we couldn't confirm that from Microsoft.

What should you check before deleting?

Saving space? Run the keepers through an image compressor too.

The bottom line

Use a file hash for proof two files are identical, and an image hash to find the same picture in different clothes. Scan, review each group, keep the best copy, and wait a week before emptying the trash.

Frequently Asked Questions

What is the fastest way to find duplicate photos?

For exact copies, compare file hashes: identical files give identical MD5 or SHA-256 values. For photos that were resized, re-saved or lightly edited, use a perceptual hash tool that compares what the images look like.

Why doesn't a resized copy have the same file hash?

A file hash like MD5 changes completely if a single byte changes. Resizing, re-saving as JPEG or stripping metadata rewrites the bytes, so the hash no longer matches even though the picture looks the same.

What Hamming distance counts as a duplicate?

Our tool treats two 64-bit average hashes as a match at 10 differing bits or fewer. As a rough rule, 0 to 5 is almost always the same picture, 6 to 10 is usually an edited copy, and above 20 is usually a different photo. It's a heuristic, so review each group.

Can a duplicate photo finder detect mirrored or rotated images?

A simple average hash can't. In our test a horizontal mirror scored 26 bits apart and a 90 degree rotation scored 32, both far past the threshold of 10.

Does iPhone find duplicate photos automatically?

Yes. Since iOS 16, the Photos app lists detected duplicates under Collections, Utilities, Duplicates, and you can merge them. Apple says indexing can take up to a few days and runs while the phone is locked and charging. Mac Photos gained the same Duplicates collection in macOS Ventura.

Related Tools