Privacy

What is File hash?

Also called checksum or hash value.

A file hash is a fixed-length value calculated from a file’s bytes using an algorithm such as SHA-256, used to check that a file hasn’t changed.

How it works

A hash function reads every byte of a file and produces a short fingerprint: 64 hexadecimal characters for SHA-256. The same bytes always produce the same fingerprint, and even a one-byte change produces a completely different one.

That makes hashes useful for checking downloads, confirming a backup copy is identical to the original, or finding byte-for-byte duplicates among photos. The algorithm is part of the comparison: an MD5 value and a SHA-256 value of the same file look nothing alike and can’t be compared with each other.

Hash vs checksum

People use the words interchangeably. Strictly, a checksum is any value used to detect errors, including very simple ones such as CRC32 inside ZIP archives, while a cryptographic hash such as SHA-256 is also designed so nobody can deliberately craft a different file with the same value. When a download page lists a “checksum”, it is almost always a SHA-256 hash.

A practical example

Calculate a downloaded file’s SHA-256 value and compare it with a checksum published through a trusted channel. A mismatch means the bytes don’t match.

What to watch out for

A matching hash doesn’t prove that a file is safe or that its publisher is trustworthy. It only supports an integrity check against the reference you trust.

Tools you can use

Go a little deeper

Common questions

Which hash algorithm should I use?

SHA-256 for anything new. MD5 and SHA-1 are still fine for spotting accidental corruption but are no longer considered safe against deliberate tampering.

Does renaming a file change its hash?

No. The hash is calculated from the file’s contents, not its name or dates, so a renamed copy has the same hash as the original.

Can two different files have the same hash?

In theory, yes, but with SHA-256 the chance of an accidental match is so small that it is treated as impossible in practice.

Related terms

Browse the complete file format glossary →