Find Duplicate Images & Videos

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

Ready
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 — not just files with the same name. The aHash algorithm converts each file into a compact 256‑bit “fingerprint” based on its overall brightness pattern. Files with matching fingerprints are grouped together, even if they were resized, re‑compressed, 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 — your tab stays 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. Shrink to 16×16 Pixels

    Each image — regardless of its original size — is drawn onto a 16×16 pixel canvas. This makes all images directly comparable. In Fast Mode, JPEG files use their embedded EXIF thumbnail instead, which is faster and produces the same result in almost all cases.

  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 similarity threshold slider controls the maximum Hamming distance allowed for two files to be grouped together.

  5. Aspect Ratio Pre‑Check

    Before comparing hashes, Sakarto checks whether the two files have similar aspect ratios. Pairs where one file’s proportions differ by more than 10% are skipped entirely. This prevents a tall portrait from being matched with a wide landscape even if their brightness patterns coincidentally align.

  6. Videos — Multi‑Frame Averaging

    For video files, 3 frames are extracted at 1.5‑second intervals. Each frame produces its own 256‑bit hash. The 3 hashes are averaged together (majority vote per bit) to produce a single representative hash for the whole file. Video scanning pauses if you switch browser tabs and resumes when you return.

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 Similarity 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.

Low values (0–5) — Very strict

Only nearly identical files match. Use for finding exact copies, the same file at different bitrates, or lossless vs. lossy exports. Very few false positives. May miss slightly re‑compressed or quality‑reduced copies.

Medium values (6–20) — Balanced (default: 10)

Catches re‑saved copies, different resolutions of the same image, minor brightness adjustments, and JPEG compression artifacts. The default of 10 is a good starting point for most photo libraries. Some false positives are possible for images with very similar brightness structures.

High values (21–50) — Loose

Groups images with broadly similar brightness distributions. Two very different images can match if their brightness patterns coincide. Useful for finding visually related but not identical images. Expect more false positives — always review before deleting.

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. Unlike some similarity sliders, here a value of 0 means “must be identical” and 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 (1080p, 4K, thumbnail)
  • Re‑saved copies in different formats (JPEG → PNG → WebP)
  • Minor brightness or contrast adjustments
  • Re‑compressed or lower‑quality JPEG versions
  • Screenshots of the same image
  • Videos sharing similar brightness structure across key frames
⚠️ May Struggle With
  • Heavily cropped versions where a large portion is removed
  • Rotated or mirrored images (brightness pattern shifts)
  • Images with heavy filters or dramatic color grading
  • Black‑and‑white vs. color versions of the same photo
  • Images with large text or watermarks added over the content
  • Night vs. day versions of the same scene (brightness reversal)
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 dHash (edge‑based) or 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

Adjust the Similarity Threshold

After the scan, use the Similarity Threshold slider to tune how strict matching is. Releasing the slider re‑clusters all results instantly using the new value — no re‑scan needed. Start at the default of 10 and raise it only if you want to catch more approximate matches.

Step 4

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 5

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 6

Take Action — Move, Delete, or Copy

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

📋 CopyCopy filename(s) to clipboard
📂 MoveStage for move to a named folder
🗑️ DeleteStage for permanent deletion
⚖️ CompareView selected files side‑by‑side
Step 7

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

All toolbar buttons, checkboxes, and keyboard shortcuts for Sakarto aHash duplicate finder
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.
Scan Images checkboxInclude or exclude image files from the scan
Scan Videos checkboxInclude or exclude video files from the scan
Similarity 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."

"I was sceptical about aHash because it ignores colour, but it caught every duplicate in my holiday photos — different resolutions, crops, even some black‑and‑white versions. Fast and reliable."

💡 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 JPEG Libraries

Fast Mode reads embedded EXIF thumbnails instead of full images — 5–10× faster with near‑identical accuracy for most photo collections.

Start Strict, Then Loosen

Begin with the default threshold of 10. Review those results first. Only raise the slider if you want to catch more approximate matches.

Compare Metadata Before Deciding

In the Compare modal, check file size and resolution. A larger file usually means better quality. Keep the JPEG with the highest bitrate or the highest resolution PNG.

Move, Don’t Delete

Use Move to a “Sakarto‑Duplicates” folder rather than deleting outright. Review the moved files over a few days before permanently removing them.

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 pHash or Color Signature.

⚠️ Known Limitations

aHash ignores color entirely.

Because hashing happens in grayscale, two images with the same brightness structure but completely different colors will match. This is uncommon in practice but can happen with high‑contrast graphics or images with bold geometric patterns. Always use Compare to verify before deleting.

Rotated or mirrored images won’t match.

A 90° rotation completely changes the position of bright and dark pixels in the 16×16 grid. Two versions of the same photo — one landscape, one rotated portrait — will produce very different hashes. Use ORB for rotation‑tolerant matching.

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 — it exists for exactly this reason.

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 (in the Web Worker) is unaffected and continues in the background.

Move and Delete require Chrome or Edge.

The File System Access API is only available in Chrome 86+ and Edge 86+. Firefox and Safari can scan and display results but cannot move or delete files. Use “Download List” to export results in those browsers.

Memory limit for very large collections.

Each hash is only 256 bits (32 bytes), so aHash uses far less memory than algorithms that store larger feature vectors. However, thumbnails rendered for display still consume RAM. For 50,000+ files, consider scanning subfolders individually.

🔒 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, Scan Images, Scan Videos). No file names, paths, or hashes are ever saved or transmitted.
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 the other image algorithms in Sakarto?
aHash is the simplest and fastest of the 7 algorithms: resize to 16×16, convert to grayscale, compute the average brightness, then compare each pixel to that average. The result is a 256‑bit binary hash. It is the best starting point for large libraries where speed matters most. The trade‑off is precision — aHash only captures broad brightness structure, not fine detail. For more discriminating matching, pHash uses a Discrete Cosine Transform (similar to JPEG compression math) and is more stable across edits. dHash encodes brightness gradients and is better for exposure‑adjusted copies. Color Signature compares actual YUV colour values and is the only algorithm that detects colour differences. ORB handles rotation and perspective distortion that all hash algorithms miss entirely.
Two clearly different photos are being grouped together. How do I fix it?
aHash compares overall brightness structure, not visual content. Two photos with similar brightness distributions — for example, two brightly lit outdoor scenes or two dark indoor shots — can produce similar hashes even if they show completely different subjects. Lower the similarity threshold slider to 5–8, which requires hashes to be much closer before files are grouped. If false positives persist even at low thresholds, switch to pHash or Color Signature for more discriminating results. Always use the Compare modal (Ctrl+Click two cards, then Compare) to verify groups before acting.
I know two files are duplicates but they aren't being grouped. What's wrong?
Work through this checklist: first, raise the threshold slider toward 15–20. Second, check that the two files have similar aspect ratios — pairs differing by more than 10% are excluded by the aspect‑ratio pre‑check before hashing even runs. A portrait photo will never match a landscape crop of the same image regardless of threshold. Third, consider whether the duplicate has been rotated or mirrored — a 90° rotation changes the position of every bright and dark pixel in the 16×16 grid, producing a completely different hash. For rotated copies, switch to ORB.
What does Fast Mode actually do, and when should I turn it off?
Most JPEG files contain a small embedded thumbnail stored in their EXIF metadata, typically 160×120 or similar. Fast Mode reads this thumbnail instead of decoding the full multi‑megapixel image. For a 24 MP photo, this means processing a few KB instead of 24 MB — 5–10× faster. Since aHash downscales everything to 16×16 anyway, the thumbnail produces an identical or near‑identical hash in the vast majority of cases. Turn Fast Mode off only if you notice incorrect groupings on JPEG files that you don't see when Fast Mode is off, which would indicate your camera or editor strips EXIF thumbnails.
How does re‑clustering the threshold work? Does it re‑scan all my files?
No — re‑clustering is instant and requires no re‑scanning. Every file's 256‑bit hash is stored in memory after the initial scan. When you release the threshold slider, a background Web Worker re‑runs the comparison step across all stored hashes using the new value. For a folder of 1,000 files that's around 500,000 XOR+popcount operations, which completes in milliseconds. For 10,000 files it's 50 million operations and may take a second or two. The scan only ever needs to run once per folder session.
Why does video scanning pause when I switch tabs?
Browsers throttle background video decoding to conserve battery and CPU — video elements simply stop working when the tab is hidden. The scanner detects this using the Page Visibility API and automatically pauses video processing. It resumes the moment you switch back. Image hashing is unaffected because it runs in a dedicated Web Worker: workers are not throttled by tab visibility, so images keep scanning at full speed even when you're on a different tab.
Can I recover files after deleting them?
No. Sakarto uses the File System Access API's remove() method, which permanently deletes files without sending them to the OS Recycle Bin or Trash. This is why Queue Mode is on by default: use it to stage files in the Delete Queue, preview each one using the full‑size preview icon, compare them side‑by‑side in the Compare modal, and only execute the deletion once you're certain. Move files to a “Sakarto‑Duplicates” subfolder first if you want a recoverable intermediate step.
What file types are supported, and why are some files silently skipped?
Images: JPEG, PNG, GIF, WebP, BMP. Videos: MP4, WebM, MOV, MKV. Files over 40 MB are skipped to avoid browser memory pressure. HEIC/HEIF, SVG, RAW camera formats (CR2, NEF, ARW, etc.), and TIFF are not currently supported because browsers cannot natively decode them. If you need to process RAW files, convert them to JPEG or PNG first using your photo editor.
Does this work on Firefox or Safari?
Scanning, hash computation, result display, the Compare modal, and box‑selection all work in Firefox and Safari. The limitation is Move and Delete — those require the File System Access API, which is only available in Chrome 86+ and Edge 86+. In other browsers, run the scan, review results, use the Compare modal to decide what to keep, and use Download List to export a report. Then handle the files manually in your OS file manager.