Find Duplicate Images & Videos

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

Ready
0 items

🟦 How BlockHash Duplicate Detection Works — Complete Guide

Everything you need to know about finding and cleaning up duplicate files with the BlockHash (block‑averaging) 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. BlockHash divides each image into a grid of equal‑sized blocks, computes the average brightness of each block, and produces a compact 256‑bit fingerprint. Files with matching fingerprints are grouped together, even if they were re‑compressed, re‑encoded, or saved at different quality levels.

Block‑Level Averaging

Divides the image into a grid of blocks. Each block's average brightness is computed independently, smoothing out noise and compression artifacts.

Very Fast

Block averaging is computationally cheap. One of the fastest algorithms in Sakarto — ideal for large folders and quick first‑pass scans.

Web Worker Processing

All 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 BlockHash Algorithm Works

BlockHash builds a fingerprint by summarising the brightness of each region of the image rather than any individual pixel. Here's what happens step by step:

  1. Resize to a Fixed Canvas

    Each image is drawn onto a canvas large enough to be cleanly divided into the block grid. This normalises all images to the same base size regardless of original resolution. In Fast Mode, JPEG files use their embedded EXIF thumbnail — much faster, and the block‑averaging step absorbs the small quality difference.

  2. Divide into a Grid of Equal Blocks

    The canvas is divided into a regular 16×16 grid of equal‑sized blocks. Each block covers a distinct rectangular region of the image. This produces a 256‑bit hash — the same length as aHash but computed differently.

  3. Compute Average Brightness per Block

    For each block, every pixel is converted to grayscale using the luminance formula 0.299×R + 0.587×G + 0.114×B, and the average grayscale value across all pixels in that block is computed. This single value represents the overall brightness of that region — noise and minor artifacts within the block are averaged away.

  4. Threshold to Binary Hash

    The average brightness of each block is compared to the overall median brightness of all blocks. If a block is brighter than the median it becomes 1; darker becomes 0. The result is a binary hash — one bit per block — that describes the coarse brightness pattern of the whole image.

  5. Compare Using Hamming Distance

    To compare two files, their binary 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 as duplicates. Lower = stricter.

  6. Aspect Ratio Pre‑Check

    Before any hash comparison, Sakarto checks that the two files have similar aspect ratios. Pairs where proportions differ by more than 10% are skipped. This prevents a tall portrait from matching a wide landscape even if their block brightness patterns coincidentally align.

  7. Videos — Multi‑Frame Averaging

    For video files, 3 frames are extracted at 1.5‑second intervals. Each frame is hashed separately. The 3 binary hashes are combined by 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 BlockHash more tolerant of compression artifacts than pixel‑level algorithms? JPEG compression introduces small errors in individual pixel values, but the block‑level average of a region of 64 or more pixels barely changes when a few pixels are shifted by a few grey levels. aHash and dHash compare individual pixels; BlockHash compares averages over entire zones, so compression noise washes out.

🎚️ 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 and directly re‑exported versions. Very few false positives. May miss files with significant compression differences or aggressive re‑encoding.

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

Catches re‑saved copies, different resolutions of the same image, heavy JPEG compression, and noisy re‑scans of photos. The default of 10 is a good starting point. BlockHash tolerates more variation than aHash at the same threshold, so you may find that lower values already catch everything you need.

High values (21–50) — Loose

Groups images with broadly similar coarse brightness distributions. Because BlockHash is already a coarse descriptor, high thresholds can produce a lot of false positives — use with care and always review before deleting. More useful for finding visually “in the same scene” images than for finding exact duplicates.

Re‑clustering is instant. When you release the slider, all already‑scanned hashes are re‑grouped using the new threshold 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. A value of 0 means “accept only identical hashes.” A value of 50 means “accept up to 50 bit differences out of 256.”

✅ 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)
  • Heavily compressed or low‑quality JPEG versions
  • Scanned photos with sensor noise or print grain
  • Re‑encoded files with visible compression artifacts
  • Screenshots of the same image
  • Videos with broadly similar key‑frame brightness
⚠️ May Struggle With
  • Heavily cropped versions (large area removed changes blocks entirely)
  • Rotated or mirrored images
  • Images with heavy colour filters or dramatic brightness edits
  • Fine details that differ only at the pixel level within blocks
  • Images with large text or watermarks overlaid
  • Two images that share an overall brightness structure by coincidence
BlockHash is an excellent first‑pass filter for large collections. Run it first for speed and noise‑tolerance, then use pHash or Color Signature on smaller batches where you need more precision, or ORB for rotated or perspective‑warped copies.

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

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 the embedded EXIF thumbnail instead of the full image — 5–10× faster, with the same duplicate detection accuracy in almost all cases. BlockHash's block‑averaging step absorbs any tiny thumbnail quality difference.
Step 2

Wait for the Scan

A progress bar shows how many files have been processed. BlockHash is one of the fastest algorithms in Sakarto — block averaging is very computationally light. Duplicate groups appear live as they're found. You can start reviewing before the scan finishes.

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 in a background worker — no re‑scan needed. Start at the default of 10. Because BlockHash is a coarse algorithm by design, it often catches everything useful at lower thresholds than you might need with other algorithms.

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 with full metadata (dimensions, size, type, path) and a similarity percentage for each pair. For 3+ files, a pairwise similarity matrix is shown. Use this to verify borderline matches before acting — BlockHash can occasionally group images that share a brightness structure without being true duplicates.

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 BlockHash 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 156 reviews

"I have thousands of old JPEGs from various cameras and scanners — different qualities, lots of compression artifacts. BlockHash found duplicates that aHash and pHash missed completely. The block averaging really works."

"This saved me hours of manual sorting. I scanned my entire photo archive of 25,000 files — BlockHash found 900 duplicate groups in under 4 minutes. The threshold slider let me fine‑tune the results perfectly."

"BlockHash is my go‑to first pass for messy collections. It catches all the obvious duplicates and handles varying image quality really well. I then use Compare to verify the borderline cases."

"I run a media archiving service and BlockHash is my secret weapon for processing large client collections. The noise tolerance is remarkable — images that have been re‑encoded 5 times still get grouped correctly."

💡 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 BlockHash as a First Pass

BlockHash is ideal for quickly filtering a large collection down to candidate groups. Once you have the groups, use Compare to verify each one before acting.

Start Stricter Than You Think

Because BlockHash is inherently a coarse descriptor, even a threshold of 5–8 will catch many obvious duplicates. Start low and raise only if you're missing known copies.

Always Use Compare for Borderline Groups

Two images that share a coarse brightness structure can match at moderate thresholds without being true duplicates. Use Ctrl+Click → Compare to view them side‑by‑side before deciding.

Move, Don't Delete

Use Move to a “Sakarto‑Duplicates” folder instead of deleting outright. Review the staged files over a few days before permanently removing anything.

Need More Precision? Try pHash

If BlockHash is grouping images you consider different, switch to pHash (DCT‑based) or Color Signature for tighter matching that distinguishes fine details better.

⚠️ Known Limitations

BlockHash is a coarse descriptor — it can over‑match.

Because brightness is averaged over entire blocks, two genuinely different images that share a similar overall brightness layout can produce the same or very similar hashes. This is less of a problem at low thresholds, but at values above 15 you should always use Compare to verify groups before acting.

Color is not compared — only brightness.

Like aHash, BlockHash converts everything to grayscale before processing. Two images with identical brightness patterns but completely different colours will produce the same hash. If colour accuracy matters, use Color Signature instead.

Rotation and mirroring break matching.

A rotated or mirrored version of an image will have different block positions, producing a very different hash. For rotation‑tolerant matching, use ORB Feature 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. Video processing pauses when the tab is hidden and resumes automatically when you return. Image hashing (in the Web Worker) is unaffected and continues at full speed.

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.

🔒 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 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 BlockHash different from aHash, and when should I choose it?
Both are brightness‑based perceptual hashes compared using Hamming distance, but they encode brightness differently. aHash shrinks to 16×16 individual pixels and compares each pixel to the overall mean — it's fast but sensitive to pixel‑level noise from JPEG compression. BlockHash divides a 64×64 canvas into 16 equal blocks and computes the average brightness of each block, then compares each block average to the median. This block averaging step is the key difference: by averaging brightness over a 16×16 area instead of reading a single pixel, compression artifacts, sensor noise, and encoding differences get diluted and mostly disappear from the hash. Choose BlockHash when your duplicates are heavily re‑compressed, saved at different quality settings, or include scanned documents at various DPIs.
Two clearly different photos are being grouped together. How do I fix it?
BlockHash is intentionally a coarse descriptor. Two photos with a similar broad brightness layout — both mostly bright sky above and dark ground below, for example — can produce matching hashes even if they show completely different scenes. Lower the similarity threshold slider to 3–6 to require hashes to be much closer before files are grouped. If false positives still occur at low thresholds, switch to pHash (frequency‑domain encoding, more discriminating) or Color Signature (also compares colour, not just brightness) for finer‑grained matching.
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 aspect ratios — pairs where one file's proportions differ from the other by more than 10% are excluded by the pre‑check before hashing runs. A portrait version will never match a landscape version regardless of threshold. Third, if one file is rotated or heavily cropped, BlockHash won't match it — try ORB Feature Matching, which is the only algorithm that handles geometric transformations.
Why is BlockHash described as “noise‑tolerant”? What counts as noise?
In this context, “noise” means any pixel‑level difference that doesn't represent a real change in the image's visual content. JPEG re‑compression at a lower quality setting introduces ringing artifacts around edges. Re‑scanning a document on a flatbed scanner at a different DPI introduces slight brightness variations. Saving through a different encoder (e.g. Photoshop vs Lightroom) can change individual pixel values by a few levels. In all these cases, the block average barely changes because the noise is random and largely cancels out when averaged over a 16×16 area. An individual‑pixel algorithm like aHash would see those changes as real differences and produce a different hash.
What does Fast Mode do, and does it affect BlockHash accuracy?
Fast Mode reads the small EXIF thumbnail embedded in JPEG files (typically around 160×120 pixels) instead of decoding the full image. This is 5–10× faster with no meaningful accuracy cost for BlockHash, because BlockHash averages brightness over large blocks and is already insensitive to fine detail. The main reason to turn Fast Mode off is if your JPEG files were saved without EXIF thumbnails — some cameras and image editors strip them — in which case Fast Mode falls back to reading the full image anyway.
Why does video scanning pause when I switch tabs?
Browsers stop processing video elements when a tab is hidden, to conserve battery and CPU. Sakarto uses the Page Visibility API to detect this and automatically pauses video frame extraction. It resumes immediately when you return to the tab. Image hashing runs in a background Web Worker, which is not affected by tab visibility — images continue scanning at full speed no matter which tab you're looking at.
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 for exactly this reason: it stages files for review before anything is actually deleted. Use the full‑size preview icon and the Compare modal to verify each group before executing a deletion. If you're unsure, use Move instead of Delete — moved files go to a “Sakarto‑Duplicates” subfolder you can review and manually restore from.
What file types are supported?
Images: JPEG, PNG, GIF, WebP, BMP. Videos: MP4, WebM, MOV, MKV. Files over 40 MB are silently skipped. HEIC/HEIF, SVG, RAW formats (CR2, NEF, ARW, DNG), and TIFF are not currently supported — browsers cannot natively decode these formats. Convert them to JPEG or PNG before scanning if needed.
Does this work on Firefox or Safari?
Scanning, hash 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, which is only available in Chrome 86+ and Edge 86+. In other browsers, run the full scan, review groups in the Compare modal, and use Download List to export a report so you can handle the files manually in your OS file manager.