Find Duplicate Images & Videos

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

Ready
0 items

🌊 How wHash Duplicate Detection Works — Complete Guide

Everything you need to know about finding and cleaning up duplicate files with the wHash (Wavelet 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. wHash applies a Haar Wavelet Transform to encode the dominant low‑frequency structure of each image as a compact 64‑bit fingerprint. It then compares pairs of fingerprints using Hamming distance — counting how many of the 64 bits differ. Files whose bits differ by at most the threshold value are grouped as duplicates.

Haar Wavelet Fingerprinting

Uses a Haar Wavelet Transform to extract low‑frequency structure. The result is a 64‑bit hash that is stable across rescaling, re‑compression, and mild image edits.

Very Fast Hashing

The 1D Haar transform is a simple average/difference operation — much faster than DCT. Scans large folders with minimal CPU overhead.

Web Worker Processing

All wavelet computation runs in a background Web Worker via OffscreenCanvas, keeping the browser tab fully responsive during scanning.

Images & Videos

Supports images (JPEG, PNG, GIF, WebP, BMP) and videos (MP4, WebM, MOV, MKV). Videos are hashed using 3‑frame majority vote averaging.

🧠 How the wHash Algorithm Works

Wavelet Hash uses the Haar Wavelet Transform to decompose an image into low and high‑frequency components, then encodes the low‑frequency approximation as a binary fingerprint. Here is the exact step‑by‑step process used in this tool:

  1. Resize to 16×16 Pixels

    Each image is drawn onto a 16×16 canvas. The canvas size must be a power of 2 for the Haar wavelet transform to work correctly, and 16×16 gives 256 pixels as input — enough information to capture broad perceptual structure while keeping computation extremely fast. In Fast Mode, JPEG files use their embedded EXIF thumbnail at this step.

  2. Convert to Grayscale

    Each of the 16×16 = 256 pixels is converted to a grayscale value using the luminance formula 0.299×R + 0.587×G + 0.114×B. The wavelet transform operates on intensity only. Colour information is discarded at this stage — wHash, like all hash algorithms in Sakarto, is colour‑blind.

  3. Apply the 1D Haar Wavelet Transform to Each Row

    For each of the 16 rows, the 16‑element array is transformed by the Haar operation: adjacent pairs of pixels are averaged (stored in the first half of the result) and differenced (stored in the second half). The first half encodes a low‑frequency approximation of the row; the second half encodes the fine detail. This is the fundamental “split into averages and differences” step of the Haar wavelet.

  4. Apply the 1D Haar Wavelet Transform to Each Column

    The same Haar operation is then applied column‑wise to the result of step 3. After this separable 2D transform, the top‑left 8×8 region of the 16×16 matrix — the LL sub‑band — contains the lowest‑frequency approximation of the entire image. The remaining regions encode horizontal, vertical, and diagonal detail at increasing levels of frequency.

  5. Extract the 8×8 LL Sub‑Band (64 Values)

    Only the top‑left 8×8 = 64 wavelet coefficients are kept. These represent the broadest, most perceptually dominant structures in the image: overall brightness distribution, major edges, dominant shapes. All high‑frequency detail (fine texture, noise, compression artifacts) is discarded here. This is what makes wHash robust to re‑compression and minor edits.

  6. Compute the Mean of the 64 Coefficients

    The mean (average) of the 64 LL sub‑band values is calculated, excluding the DC component at index 0. The DC component encodes overall image brightness — excluding it makes the hash invariant to global brightness differences between otherwise identical images.

  7. Produce the 64‑Bit Hash

    Each of the 64 LL sub‑band coefficients is compared to the mean. If a coefficient is above the mean, its bit is 1; if at or below, its bit is 0. The resulting 64‑bit binary string is the wHash fingerprint — a compact encoding of the image's dominant low‑frequency wavelet structure.

  8. Compare Using Hamming Distance & Video Multi‑Frame Averaging

    To compare two files, their 64‑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 perceptual structure. An aspect ratio pre‑check first skips any pair where proportions differ by more than 10%. For video files, 3 frames are extracted at 1.5‑second intervals, each hashed individually, and combined by majority vote into one representative hash.

Why is wHash fast? The Haar wavelet transform at each step is just averaging and subtracting pairs of adjacent values — no trigonometric functions, no matrix multiplications. On a 16×16 canvas it completes in microseconds. pHash requires a full 2D DCT on a 32×32 canvas, which is significantly heavier. For large collections, wHash is noticeably faster while producing very similar quality results.

🎚️ Understanding the Hamming Threshold Slider

The Similarity Threshold slider (0–50) controls how many of the 64 hash bits two images can differ on and still be grouped as duplicates.

Low values (0–5) — Very strict

Only near‑identical images match. Finds exact copies, direct re‑exports, and lossless format conversions. Very few false positives. May miss images with any significant edits.

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

Catches resized copies, re‑compressed files, and mild colour corrections. The default of 10 is a good starting point for most photo libraries. wHash is well‑calibrated at this range — it reliably finds edited copies while keeping false positives low.

High values (21–50) — Loose

Groups images with broadly similar perceptual structure regardless of specific content. Always review groups before acting on results at these values.

Re‑clustering is instant. When you release the slider, all already‑computed hashes are re‑grouped in a background Web Worker — no re‑scanning needed. The scan only runs once per folder.
Lower = stricter. The slider measures the maximum number of differing hash bits allowed between two files. A value of 0 means “identical wavelet fingerprints only.” A value of 10 means “accept up to 10 bit differences out of 64.”

✅ 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)
  • Re‑compressed JPEG versions at moderate quality reductions
  • Copies with mild colour grading or brightness adjustments
  • Images with slight noise reduction or sharpening
  • Lightly cropped versions where major structure is preserved
  • Videos with similar dominant visual content across key frames
⚠️ May Struggle With
  • Rotated or mirrored copies (wavelet transform is not rotation‑invariant)
  • Heavily cropped versions where major structures are removed
  • Dramatic colour or contrast transformations
  • Stylised versions (extreme filter effects, posterise, watercolour)
  • Very heavily re‑compressed copies (quality 1–5)
wHash is a fast, reliable all‑purpose hash. For rotated or perspective‑warped copies, use ORB Feature Matching. For copies that differ only in brightness or exposure, dHash is more sensitive to those specific changes. For the most discriminating frequency‑domain matching, try pHash.

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

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.

Enable Fast Mode for JPEG‑heavy libraries. It reads embedded EXIF thumbnails instead of full images — 5–10× faster, with no meaningful accuracy loss because wHash discards all high‑frequency detail anyway.
Step 2

Wait for the Scan

A progress bar shows how many files have been processed. wHash is one of the fastest algorithms in Sakarto — the Haar wavelet on a 16×16 canvas is extremely light. Duplicate groups appear live as they are found during the scan. You can start reviewing before the scan finishes.

Step 3

Adjust the Similarity Threshold

After the scan, use the Similarity Threshold slider to tune matching sensitivity. Releasing the slider re‑clusters all results instantly in a background Worker — no re‑scan needed. The default of 10 is a good starting point. Because wHash uses a compact 16×16 wavelet basis, it is slightly coarser than pHash, but this also means it is less sensitive to minor compression noise — which can actually reduce false positives in very large JPEG collections.

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 both files side‑by‑side with full metadata (dimensions, size, type, path) and a similarity percentage. For 3+ files a 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 wHash 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 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 164 reviews

"wHash is the perfect middle ground between speed and accuracy. It caught all the duplicates in my 20,000 photo library in just a few minutes, and the results were indistinguishable from pHash for my use case."

"I tested wHash against pHash on a 50,000 image dataset — the results were nearly identical, but wHash was consistently 30‑40% faster. The wavelet transform is incredibly efficient."

"The wavelet transform does a fantastic job of capturing the essence of an image. It found duplicates that aHash missed because of minor edits, and it was noticeably faster than pHash on my older laptop."

"I switched from pHash to wHash for my 100,000+ image library and the speed difference is significant. The wavelet hash is just as reliable for finding duplicates across different formats and resolutions."

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

wHash is the Fastest Hash

For very large collections where speed matters, wHash is the best choice. The Haar wavelet on a 16×16 canvas is significantly faster than pHash's DCT on a 32×32 canvas.

Trust the Default Threshold

The default of 10 works well for most photo collections. Try it before adjusting. Lower it if too many unrelated images are being grouped; raise it if you expect edited copies to exist.

Use Compare for Borderline Groups

Ctrl+Click two cards then click Compare to see them side‑by‑side with a similarity percentage. Verify before deleting anything from borderline groups.

Move, Don't Delete

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

Combine Algorithms Strategically

Run wHash for a fast first pass on large collections, then follow up with pHash for more discriminating matching or ORB for rotated copies that wHash will miss.

⚠️ Known Limitations

Not rotation‑invariant.

Rotating an image 90° changes the positions of all wavelet coefficients significantly. A rotated copy will not be matched at any threshold. For rotation‑tolerant matching, use ORB Feature Matching.

Colour is not compared — only luminance.

wHash converts to grayscale before the wavelet transform. A colour version and a desaturated version of the same image will match perfectly if their luminance structures are similar. For colour‑sensitive matching, use Color Signature.

Coarser resolution than pHash.

The 16×16 canvas gives wHash slightly less spatial resolution than pHash's 32×32 DCT. For very similar images with subtle differences, pHash may distinguish them more accurately. wHash's speed advantage makes this trade‑off worthwhile for most use cases.

No undo for file deletion.

The File System Access API bypasses the OS recycle bin. Always use Queue Mode to stage and review before executing.

Video scanning pauses when you switch tabs.

Browsers throttle background video decoding. Video processing pauses when the tab is hidden and resumes when you return. Image hashing (in the Web Worker) continues at full speed regardless.

Move and Delete require Chrome or Edge.

The File System Access API is available only in Chrome 86+ and Edge 86+. Firefox and Safari can scan and display results but cannot move or delete files.

🔒 Privacy & Security

Zero network activity after page load. Open DevTools → Network tab and verify: no outbound requests during any scan, hash computation, or file operation.
No accounts, no cookies, no analytics. The only localStorage data saved is your OS detection and checkbox preferences. 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 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 wHash different from pHash, aHash, and dHash?
All four produce a 64‑bit hash compared with Hamming distance, but they use different mathematical transforms. aHash simply compares pixels to a mean — the fastest but coarsest. dHash encodes brightness gradient directions — good for exposure‑adjusted copies. pHash applies a 2D Discrete Cosine Transform on 32×32 and extracts the 8×8 low‑frequency coefficients — the most precise but most computationally intensive. wHash applies a Haar Wavelet Transform on a 16×16 canvas and extracts the 8×8 LL (low‑low) sub‑band. Wavelets decompose the image into multiple frequency scales simultaneously, similar to how DCT works but in a different mathematical basis. The result is quality very close to pHash at lower CPU cost — making wHash the best balance of speed and accuracy when you want more precision than aHash but don't need every last bit of pHash's discrimination.
When should I choose wHash over pHash?
Choose wHash when you have a large collection and want good quality matching without pHash's higher processing cost. In practice, for most photo deduplication tasks, wHash and pHash produce nearly identical groups — the difference only becomes noticeable at the boundaries of the threshold, where very similar but not identical images either match or don't. Choose pHash over wHash when you're looking for copies of photos that have been subtly edited (light retouching, slight colour adjustments, minor crops) and need the extra precision to distinguish real duplicates from near‑duplicates. wHash is also slightly better at handling images with local edits in one region of the image, because wavelet transforms capture spatial structure at multiple scales simultaneously.
Two clearly different photos are being grouped together. How do I fix it?
Lower the similarity threshold slider to 4–8. wHash's 16×16 wavelet basis is coarser than pHash's 32×32 DCT, so at loose thresholds it can group photos with broadly similar structural layouts. Use the Compare modal (Ctrl+Click two cards, then Compare) to verify before acting. If false positives persist at strict thresholds, try pHash for more discrimination, or Color Signature if the falsely‑grouped photos have different colour palettes that colour comparison could distinguish.
I know two files are duplicates but wHash isn't grouping them. What should I try?
First, raise the threshold toward 15–20. Second, check aspect ratios — pairs differing by more than 10% are excluded by the pre‑check. Third, consider what kind of edit was applied: wHash handles re‑compression, format changes, and mild edits well. Like all hash algorithms, it fails for rotated images — use ORB for those. For very heavily cropped copies where more than a third of the image content was removed, the structural content shifts enough that the wavelet sub‑band changes significantly. Try ORB for cropped copies as well.
What does Fast Mode do, and does it affect wHash accuracy?
Fast Mode reads the EXIF thumbnail embedded in JPEG files instead of the full image. Since wHash operates on a 16×16 canvas, the EXIF thumbnail (typically 160×120 or similar) is many times larger than needed and produces an identical hash. Leave Fast Mode on. Turn it off only if you're seeing suspicious groupings on JPEG files that disappear when Fast Mode is disabled — a sign that the EXIF thumbnails in those files were stripped or are stale (some editors update the image but not the embedded thumbnail).
What is a Haar Wavelet Transform, explained simply?
A Haar wavelet transform works by repeatedly averaging pairs of values and keeping the difference between them. Applied to an image row by row and then column by column, the result is four sub‑regions: LL (both averaged — the “thumbnail” of the image), LH (row‑averaged, column‑differenced — horizontal edges), HL (row‑differenced, column‑averaged — vertical edges), and HH (both differenced — diagonal detail). wHash uses only the LL sub‑band — the smoothed, low‑frequency overview of the image — and discards the edge/detail sub‑bands. This is conceptually similar to what pHash does with DCT, just using a different (and computationally cheaper) mathematical basis.
Why does video scanning pause when I switch tabs?
Browsers throttle video elements when a tab is hidden to save battery and CPU. Sakarto uses the Page Visibility API to detect this and pauses video frame extraction, resuming when you return. Image hashing runs in a background Web Worker that is not throttled by tab visibility — images continue scanning at full speed regardless of which tab you have open.
Can I recover files after deleting them?
No. The File System Access API's remove() method permanently deletes files without using the OS Recycle Bin or Trash. Queue Mode is enabled by default to prevent accidental deletions: files are staged for review before execution. Use the preview icon and Compare modal to verify groups. When uncertain, Move to a “Sakarto‑Duplicates” subfolder rather than deleting — you can recover those files manually later.
What file types are supported?
Images: JPEG, PNG, GIF, WebP, BMP. Videos: MP4, WebM, MOV, MKV. Files over 40 MB are skipped. HEIC/HEIF, SVG, RAW formats, and TIFF are not supported due to browser decoder limitations. Convert these to JPEG or PNG in your photo editor before scanning.
Does this work on Firefox or Safari?
Scanning, wavelet computation, result display, and the Compare modal all work in Firefox and Safari. Move and Delete are the exception — they 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 for manual file management.