Free Image Hash Generator — SHA-256 + Perceptual aHash & dHash

Image hashes power deduplication, copyright matching, reverse image search and integrity verification. PikDraw's Image Hash Generator computes the three most-used hashes — cryptographic SHA-256 of the raw file plus 64-bit aHash and dHash perceptual fingerprints — entirely in your browser.

What is the Image Hash Generator — SHA-256, aHash & dHash?

Image Hash Generator computes one cryptographic and two perceptual fingerprints of any image. SHA-256 is byte-exact; aHash and dHash are visual fingerprints that survive resizing and recompression.

Key features

  • SHA-256 via Web Crypto API
  • 64-bit aHash (average hash)
  • 64-bit dHash (difference hash)
  • Copy-to-clipboard for each value
  • 100% client-side
  • Free, unlimited, no signup

How it works

SHA-256: hash the raw file bytes via crypto.subtle.digest. aHash: downscale to 8×8 greyscale, threshold each pixel against the mean. dHash: downscale to 9×8 greyscale, compare adjacent pixel pairs. Both perceptual hashes pack into a 64-bit hex value.

Why use this tool

Most online hashers compute SHA only. Most perceptual-hash tools require a CLI. PikDraw runs in the browser, computes all three at once, and shows the math behind each result.

Common use cases

  • Deduplication of large photo libraries
  • Copyright / DMCA matching
  • Reverse image search index keys
  • File integrity verification
  • Detecting tampered or re-saved images
  • Building a similarity database

How to use this tool

  1. Upload an image — Drop a JPG, PNG, WebP or any common format. The file is read into memory in your browser.
  2. Compute Hashes — SHA-256 fingerprints the raw file bytes; aHash and dHash generate 64-bit perceptual hashes of the visual content.
  3. Copy or compare — Click the copy icon next to any hash to copy it to your clipboard. Compare aHash/dHash values by Hamming distance to detect visually similar images.
  4. Use in workflows — Use SHA-256 to verify file integrity. Use perceptual hashes for deduplication, reverse image search or copyright matching.

Who should use this

Developers building image search/dedupe pipelines, photographers tracking their work online, researchers, forensic analysts, and anyone curious about how image similarity is measured.

How to get started

Upload an image, click Compute Hashes, copy the values you need.

Best practices

  • Store SHA-256 for integrity, dHash for similarity
  • Use 5-bit Hamming distance as a starting threshold
  • Compute hashes on the original — recompressed copies shift dHash values
  • Batch hashing? Use our Duplicate Image Finder

Pro tips

  • Identical files = identical SHA-256. One pixel different = totally different SHA.
  • aHash and dHash within ~5 bits of Hamming distance = likely the same image (resized/recompressed).
  • dHash is more robust to brightness changes than aHash.
  • For large libraries, store dHash values in a database and query by Hamming distance.

Expert insights

💡 Dedupe with dHash

Use dHash + 5-bit Hamming threshold for the best dedupe accuracy without false positives.

💡 SHA for Integrity

When you need to prove a file hasn't been touched, SHA-256 is the gold standard.

💡 Batch with Duplicate Finder

Got a folder? Run our Duplicate Image Finder — it uses these same hashes at scale.

Limitations to be aware of

  • 64-bit perceptual hashes have ~3.7B collision space — fine for libraries up to ~10M images
  • Single image per run (use Duplicate Finder for batches)
  • No pHash (DCT-based) — coming in a future update
  • Perceptual hashes are not cryptographically secure

Frequently asked questions

What's the difference between SHA-256 and perceptual hashes?
SHA-256 hashes the file's raw bytes — any change (re-save, single pixel edit, EXIF rewrite) produces a completely different hash. Perceptual hashes (aHash, dHash) hash the visual content — they stay similar when the image is resized, recompressed or lightly edited, making them ideal for finding duplicates.
What's a good Hamming distance threshold for 'same image'?
For 64-bit hashes: 0–5 bits = essentially identical (resized/recompressed copies), 6–10 bits = likely related (edits, crops), 11+ bits = probably different. Tune the threshold to your false-positive tolerance.
Should I use aHash or dHash?
dHash is generally better — it's more robust to brightness/contrast changes because it compares adjacent pixels rather than against a global average. Use aHash only when you specifically need the average-luminance fingerprint.
What about pHash?
pHash (DCT-based) is even more robust than dHash but slower. For browser use, dHash hits the sweet spot of speed and accuracy. We may add pHash in a future update.
Can I find duplicates this way?
Yes — that's exactly what our Duplicate Image Finder does, using aHash internally. Use this tool to inspect individual hashes; use Duplicate Finder to batch-process whole folders.
Is the file uploaded?
No. All hashing happens in your browser via Web Crypto (for SHA-256) and Canvas (for perceptual hashes).

Browse all PikDraw image tools →