Find Duplicate Images & Videos

Select a folder to scan. Supports images (JPG, PNG, GIF, WebP) and videos (MP4, WebM, MOV).

Starting...
0 items

⚡ How aHash Duplicate Detection Works — Complete Guide

Everything you need to know about finding and cleaning up duplicate files with the aHash (Average Hash) algorithm. Scroll down for step‑by‑step instructions, tips, and answers to common questions.

100% Private — Your Files Never Leave Your Computer Everything runs inside your browser. No uploads, no accounts, no tracking. Close the tab and all data is gone.

🔍 What This Tool Does

Sakarto looks inside your images and videos to detect duplicates by analysing their brightness patterns. The aHash algorithm converts each file into a compact 256‑bit “fingerprint” based on its overall brightness structure. Files with matching hashes are grouped together, even if they were re‑compressed, resized, or saved in a different format.

Fastest Algorithm

Shrinks to 16×16 pixels and hashes in milliseconds. The best choice for very large folders where speed matters most.

256‑Bit Hash

Each file produces a 256‑bit binary fingerprint. Two files are compared by counting how many of those 256 bits differ — a single fast operation.

Web Worker Processing

Image hashing runs in a background Web Worker via OffscreenCanvas, keeping the browser tab fully responsive during scanning.

Fast Mode for JPEG

Reads the embedded EXIF thumbnail instead of the full image — 5–10× faster with near‑identical accuracy for most photos.

🧠 How the aHash Algorithm Works

Average Hash (aHash) is one of the simplest and most reliable perceptual hashing algorithms. It reduces an image to its fundamental brightness structure in six steps:

  1. Load & Resize

    Each image is drawn onto a 16×16 pixel canvas (or a tiny JPEG thumbnail in Fast Mode). This makes all images directly comparable regardless of their original size.

  2. Convert to Grayscale

    Each of the 256 pixels is converted to a grayscale value using the standard luminance formula: 0.299×R + 0.587×G + 0.114×B. Color information is discarded. Only the brightness at each position matters.

  3. Compute Average Brightness & Hash

    The average brightness across all 256 pixels is calculated. Each pixel is then compared to that average: pixels brighter than average become 1, darker become 0. The result is a 256‑bit binary hash — a compact fingerprint of the image’s brightness structure.

  4. Compare Using Hamming Distance

    To compare two files, their 256‑bit hashes are XOR'd bit by bit. The number of positions where the bits differ is the Hamming distance. A distance of 0 means identical hashes. The threshold slider controls the maximum Hamming distance allowed for two files to be grouped as duplicates. An aspect-ratio pre-check filters out pairs with very different proportions before comparison.

Why is aHash so fast? The entire algorithm — resize, grayscale, average, hash — takes under a millisecond per image on modern hardware. For 10,000 images, the comparison step is 10,000 × 10,000 / 2 = 50 million XOR operations, which completes in seconds in a Web Worker. No FFT, no colour space conversion, no large matrix operations.

🎚️ Understanding the Hamming Threshold Slider

The Hamming Threshold slider (0–50) controls how many bits two hashes can differ and still be grouped as duplicates. It is the most important control on this page.

Re‑clustering is instant. When you release the slider, all already‑scanned hashes are re‑grouped using the new threshold immediately, in a background Web Worker — no re‑scanning needed. The scan only runs once per folder.
Lower = stricter. A value of 0 means “must be identical”. A value of 50 means “accept up to 50 bit differences”. The slider measures difference, not similarity.

✅ What It Finds — and What It Might Miss

✅ Finds Well
  • Exact byte‑for‑byte copies
  • The same photo at different resolutions
  • Re‑saved copies in different formats (JPEG → PNG → WebP)
  • Social media re‑uploads with different compression
  • Screenshots of the same content
  • Images that share a similar brightness structure even if colour differs
⚠️ May Struggle With
  • Heavily cropped versions (large area removed changes brightness structure)
  • Rotated or mirrored images (brightness pattern shifts)
  • Images with heavy colour filters that drastically alter brightness
  • Black‑and‑white vs. colour versions of the same photo (different structure)
  • Images with large text or watermarks added over the content
For rotated, perspective‑warped, or heavily cropped copies, try the ORB (Feature Matching) algorithm — it detects local keypoints and handles geometric transformations. For colour‑graded copies, try Color Signature.

📋 Step‑by‑Step: How to Use Sakarto aHash

Step 1

Select a Folder to Scan

Click 📁 Select Folder to Scan to open a native folder picker (Chrome / Edge). Or drag and drop a folder onto the page. In Firefox or Safari, use the file input fallback.

Make sure Fast Mode is checked if you have many JPEG photos — it reads embedded EXIF thumbnails and is 5–10× faster than loading full images.
Step 2

Wait for the Scan

A progress bar shows how many files have been processed. Duplicate groups appear live as they're found — you can start reviewing before the scan finishes. You can switch browser tabs freely during image scanning (videos pause when the tab is hidden and resume when you return).

Step 3

Review the Duplicate Groups

Results are shown in numbered groups. Each group contains files that look similar to each other.

  • Click a card to select it (blue border)
  • Ctrl+Click (or Cmd+Click on Mac) to add to the compare list (purple border)
  • Click the 🔍 icon on hover to preview full size
  • Right‑click any card for the context menu
  • Click & drag on empty space to box‑select multiple cards
Step 4

Compare Side‑by‑Side

Ctrl+Click two or more cards, then click ⚖️ Compare in the toolbar. A modal opens showing each file with full metadata, a similarity percentage, and action buttons. For 3+ files, a full pairwise similarity matrix is shown.

Step 5

Take Action — Move, Delete, or Copy

Select files and use the toolbar buttons. With Queue Mode on (recommended), files are staged for review first:

📋 Copy Copy filename(s) to clipboard
📂 Move Stage for move to a named folder
🗑️ Delete Stage for permanent deletion
⚖️ Compare View selected files side‑by‑side
Step 6

Queue Mode — Review Before You Commit

When Queue Mode is enabled (the default), clicking Move or Delete stages files in a queue instead of acting immediately. Switch to the Move Queue or Delete Queue tab in the sidebar to review what's staged, remove individual files, then execute when ready.

With Queue Mode disabled, a confirmation dialog appears and the operation runs immediately after you confirm.

🏛️ Quick Reference — Buttons & Controls

🏛️ Quick Reference — Buttons & Controls
Button / ActionWhat it does
🔄 New SearchReload the page and start a fresh scan
📋 Copy (N)Copy selected filenames to clipboard. N = count selected.
📂 Move (N)Move selected files or stage them in the Move Queue
🗑️ Delete (N)Delete selected files or stage them in the Delete Queue
✕ Deselect AllRemove selection from all cards
⚖️ Compare (N)Open the compare modal for Ctrl+clicked files. Needs 2+.
🔇 VideosToggle mute/unmute for all video cards
Queue Mode checkboxWhen checked: stage files for review before executing. Recommended.
Fast Mode checkboxUse EXIF thumbnail for JPEG scanning — much faster. On by default.
Hamming Threshold sliderMaximum Hamming distance for grouping. Lower = stricter. Re‑clusters instantly on release.
Click cardSelect / deselect the file
Ctrl + Click cardAdd / remove from compare list (purple border)
Click & drag (empty area)Box‑select multiple cards at once
Ctrl + dragAdd to existing selection with box
Right‑click cardContext menu: Copy / Move / Delete / Compare
🔍 hover iconOpen full‑size preview with metadata and action buttons
Hover video cardAuto‑play the video clip

⭐ What Users Say

Based on 203 reviews

"aHash scanned my 18,000‑photo library in under 3 minutes. The threshold slider is genius — I started at 10 and found 1,200 duplicates. Nothing else comes close for speed."

"I manage a media archive with tens of thousands of files. aHash is my go‑to for the first pass — it's so fast that I can run it on entire drive roots. The Web Worker keeps the UI snappy."

"aHash found duplicates that other tools missed because it ignores colour and only compares brightness. I paired it with Color Signature for a two‑pass clean‑up — perfect combo."

"Fast Mode is a game changer. Scanned 5,000 JPEGs in seconds. The queue system saved me from accidentally deleting the wrong files."

💡 Tips for Best Results

Back Up First

Always back up your files before deleting anything. Deleted files bypass the recycle bin and cannot be recovered.

Use Fast Mode for JPEGs

Fast Mode reads the embedded thumbnail rather than the full image. Almost always produces the same results at a fraction of the scan time.

Preview Before Deleting

Click the 🔍 icon to view files full-size. Use Compare to see them side-by-side. Keep the largest file size — it usually means better quality.

When In Doubt, Move

Use Move instead of Delete if you're unsure. You can always permanently delete from the destination folder later.

Scan Smaller Folders

For very large collections, scan one subfolder at a time. The tool works best with up to 5,000–10,000 files at once.

No Matches? Try a Higher Threshold

If expected duplicates aren't being grouped, try raising the threshold to 15–20. If results look too noisy at higher values, try a more precise algorithm like <strong>pHash</strong> or <strong>Color Signature</strong>.

⚠️ Known Limitations

You must select a folder each time.

Browsers cannot silently read your disk — a folder picker dialog is required every time you scan.

No undo for file deletion.

The File System Access API bypasses the OS recycle bin. Deleted files are gone permanently. Use Queue Mode to review before executing.

Single folder at a time.

You can't compare files across two separate folders in one scan. Workaround: scan their common parent directory.

Memory limit for large collections.

50,000+ images may slow down or crash the tab on devices with less than 8GB RAM. Split large folders into smaller batches.

Video scanning pauses when you switch tabs.

Browsers throttle background video decoding. The scanner pauses video processing when the tab is hidden and resumes automatically when you return. Image scanning is unaffected.

Limited browser support for file operations.

Move and Delete require Chrome 86+ or Edge 86+ (File System Access API). Firefox and Safari can scan and display results but cannot move or delete files. Use "Download List" to export results in those browsers.

🔒 Privacy & Security

Zero network activity after page load. Open DevTools → Network tab and verify: no outbound requests during any scan or file operation.
No accounts, no cookies, no analytics. The only localStorage data is your OS detection and checkbox preferences (Fast Mode, Queue Mode). No file names or scan results are ever saved.
Folder access is scoped and session‑only. Permission is granted only for the specific folder you select, lasts only while the tab is open, and is revocable at any time from browser site settings.
Purely static — no backend. Sakarto is HTML, CSS, and JavaScript. There is no server, no database, and no API receiving your data.

❓ Frequently Asked Questions

How is aHash different from pHash, dHash, or Color Signature?
aHash is the simplest and fastest: it resizes to 16×16, converts to grayscale, and compares each pixel to the average brightness. pHash uses a Discrete Cosine Transform (similar to JPEG compression math) and is more stable across edits. dHash compares adjacent pixels (brightness gradients) and is better for exposure‑adjusted copies. Color Signature is the only algorithm that compares actual YUV colour values, making it ideal for colour‑based matching.
Two clearly different photos are being grouped together. How do I fix it?
Lower the Hamming Threshold slider to 3–8. aHash compares overall brightness structure, not the content or subject of the image. Two photos with a similar overall brightness distribution — for example, two different outdoor scenes both dominated by bright skies — can produce similar hashes even if they show completely different places. If false positives persist, switch to pHash which encodes structural image content rather than just average brightness.
I know two files are duplicates but they aren't being grouped. What should I try?
First, raise the threshold slider toward 15–20. Second, check whether the two files have different dominant brightness patterns — if someone drastically altered the exposure, the hash won't match. Third, check aspect ratios — pairs differing by more than 10% are excluded before comparison. For rotated or cropped copies, try ORB.
Does aHash work well for finding re-compressed social media images?
Yes. When an image is downloaded from a social media platform after being re-encoded, the compression may change individual pixel values slightly, but the overall 16×16 brightness structure stays almost identical. aHash reliably groups re-compressed copies even at moderately strict thresholds.
Why does video scanning pause when I switch tabs?
Browsers throttle background video decoding when a tab is hidden. Sakarto detects this via the Page Visibility API and pauses video frame extraction automatically, resuming when you return. Image processing runs in a background Web Worker and is completely unaffected by tab switching.
The scan is slow for large folders. What can I do?
Make sure Fast Mode is on — it reads embedded JPEG thumbnails instead of full images, giving a 5–10× speed boost. Close other browser tabs and applications to free up CPU and RAM. For folders with more than 10,000 files, scan subfolders separately rather than the full root directory.
Can I recover files after deleting them?
No. The File System Access API's remove() method permanently deletes files without going through the OS Recycle Bin or Trash. Queue Mode is on by default to prevent accidents — it stages files for review before any deletion is executed. Use the full-size preview and Compare modal to verify groups, and consider using Move to a “Sakarto-Duplicates” folder rather than deleting outright.
Does this work on Firefox or Safari?
Scanning, hash computation, result display, and the Compare modal all work in Firefox and Safari. The limitation is Move and Delete — those require the File System Access API (Chrome 86+ and Edge 86+ only). In other browsers, complete the scan, review groups, and use Download List to export a report, then manage files manually in your OS file manager.