reverse image search · content matching · dedup

Perceptual hash demo

Perceptual hashes produce similar hashes for similar content — unlike cryptographic hashes where one bit difference changes everything. aHash (average), dHash (difference), pHash (DCT-based). Type text for a simulation, or load real images to compute genuine aHash/dHash fingerprints.

Perceptual hash output
Enter two texts or images to compute perceptual hashes and compare similarity.

How to use this tool

  1. Type or paste text into the Text or Image A box — or click Load Image A / drop an image to compute a real perceptual hash.
  2. Add a second input in Text or Image B (compare) the same way.
  3. Results appear instantly in the output panel — aHash and dHash for both inputs, plus their Hamming distance and a similarity percentage.
  4. Read the Hamming distance to judge how alike the two inputs are — 0 means identical, higher values mean more difference (out of 64 for images, 16/15 for text).
  5. Hit Clear to reset both boxes and start over.

Why this tool is helpful

Learn perceptual hashing

See aHash and dHash produce fingerprints in real time without setting up an image library — the same idea powers production pHash implementations.

Understand reverse image search

Reverse image search, duplicate detection, and content matching all rely on "similar content → similar hash." Watch that principle work on text first.

Quantify similarity

The Hamming distance gives a concrete score — out of 16 for aHash and 15 for dHash — plus a percentage, so "close" is measurable, not a guess.

Contrast with cryptographic hashes

Unlike SHA-256, flipping one bit doesn't avalanche here. Similar inputs stay near each other in hash space — a core property of perceptual hashing.

Stay private

Everything runs in your browser. Nothing is uploaded, logged, or sent to a server.

FAQ

What is a perceptual hash?

A perceptual hash is a fingerprint designed so that similar content produces similar hashes. Unlike cryptographic hashes, a tiny change in input doesn't scramble the result. Common variants are aHash (average), dHash (difference), and pHash (DCT-based).

Is this a real image hasher?

Yes — when you load an image, this tool computes genuine aHash and dHash by resizing to a fixed grid (8×8 for aHash, 9×8 for dHash), converting to grayscale, and thresholding to a 64-bit fingerprint. Text input remains a simulation.

What's the difference between aHash and dHash?

aHash divides content into segments and marks each one 1 or 0 by comparing it to the average. dHash instead compares each segment to its neighbor, which makes it more robust to brightness shifts in real images.

What does Hamming distance mean?

It counts the positions where two hashes differ. A distance of 0 means identical, while higher distances mean less similarity. This tool also shows it as a percentage.

Why is aHash 16 bits but dHash only 15?

The text is split into 16 segments. aHash produces one bit per segment (16 total), while dHash compares consecutive segments, yielding 15 differences. For images, both produce a full 64-bit hash.

Can I hash an actual image here?

Yes. Click Load Image A / Load Image B (or drag & drop an image onto either panel) to compute a real 64-bit aHash and dHash. Load two images to measure their similarity.

Does any of my data leave my browser?

Never. All hashing runs locally in JavaScript. Your input is not sent to, stored on, or logged by any server.