Glossary · File hash / checksum
What is a file hash (checksum)? Proving two files are identical
Short answer
A file hash, or checksum, is a short fixed-length code calculated from every byte of a file. The same file always gives the same hash, and changing a single byte gives a completely different one. Duplicate finders use hashes such as MD5 or SHA-256 to prove that two photos are exact copies without comparing them pixel by pixel.
Last updated
Which hash functions are common?
| Function | Output length | Status |
|---|---|---|
| CRC32 | 32 bits | Error check only, collisions are easy |
| MD5 | 128 bits | Broken for security, still fine for finding accidental duplicates |
| SHA-1 | 160 bits | Deprecated for security |
| SHA-256 | 256 bits | Current standard in NIST FIPS 180-4 |
For spotting duplicate photos on a phone, speed matters more than resistance to attackers, so tools often use a fast hash, sometimes only over part of the file, then confirm a match with a full comparison.
A hash is a one-way calculation. You cannot rebuild a photo from its SHA-256 value, and the value is the same length, 64 hexadecimal characters, whether the file is a 50 KB sticker or a 50 MB RAW.
Download sites publish checksums for the same reason: after a large download, computing the hash yourself and comparing it shows whether the file arrived intact.
How does a duplicate finder use hashes?
- List every image file and its size. Files of different sizes cannot be identical, which rules out most pairs instantly.
- For files that share a size, compute a hash of the contents.
- Group files with matching hashes. Each group is one image stored several times.
- Keep one copy per group, usually the original in the camera folder, and offer the rest for deletion.
Because the work is simple arithmetic, it runs entirely on the phone and takes seconds even for tens of thousands of files. GalleryJury, coming soon to Android, finds exact copies this way on the device before any AI step begins. The full approach is covered in the guide to deleting duplicate photos on Android.
Hashing also makes re-runs cheap. A tool can store each file's hash and skip unchanged files next time, so only new photos need work.
What can a file hash not detect?
Anything that changes the bytes, even when the picture looks the same. A WhatsApp copy is re-compressed, an edited file has new pixels, and a copy with stripped metadata has fewer bytes. All three get unrelated hashes. Finding those needs a perceptual hash or a visual model, which is the gap between a simple exact duplicate check and a similar-photo tool.
Two different files with the same hash, a collision, is theoretically possible. With SHA-256 the odds are so small that no accidental collision has ever been found, so a match is treated as proof in practice.
Metadata edits catch people out. Rotating a photo in some galleries only changes the orientation tag, yet that alone produces a new hash, so the rotated file and the untouched original stop matching.
Frequently asked questions
Is a checksum the same as a hash?
In everyday use, yes. Strictly, checksums such as CRC are simple error checks, while cryptographic hashes such as SHA-256 are designed to resist deliberate collisions.
Do two identical photos with different names have the same hash?
Yes. The name is stored by the file system, not inside the file, so it does not affect the hash.
Sources
- NIST: FIPS 180-4 Secure Hash Standard (checked 31 October 2026)
- Files by Google Help: Delete duplicate files (checked 31 October 2026)
Related
More in Photo cleanup terms
GalleryJury is coming soon to Android
It keeps the best shot from every burst and clears the clutter around it. 50 free photos to try, then $5 for 5,000 photos or $15 for 20,000. Pay once, nothing renews. No subscription.