What is a hash value?
The short answer, then the detail, then a calculator to try it on your own file.
A hash value is a short, fixed-length string calculated from the entire contents of a file. It works like a fingerprint: the same file always produces the same hash value, and changing even one byte produces a completely different one. It is written as hexadecimal characters, such as d41d8cd98f00b204e9800998ecf8427e.
A worked example
Here is the MD5 hash of two nearly identical pieces of text. Only the final character differs.
One letter changed and the entire hash is unrecognisable. That is the property that makes hash values useful: you cannot tell from the hash how similar two files are, only whether they are identical.
Four things that are always true
- 1 Fixed length. An empty file and a 50 GB archive both produce a hash of exactly the same length. MD5 gives 32 characters, SHA-256 gives 64.
- 2 Deterministic. The same input always gives the same hash, on any machine, in any program, forever.
- 3 One-way. You cannot reconstruct the file from its hash. The hash is far too small to contain the file.
- 4 Avalanche effect. A one-bit change to the input changes roughly half the bits of the output.
What hash values are used for
- ›Checking a download. A publisher lists the hash of a file; you calculate it yourself and compare. If they match, you have the right file.
- ›Detecting corruption. A file that got truncated or damaged in transit will not match its original hash.
- ›Finding duplicates. Two files with the same hash are, for practical purposes, the same file.
- ›Proving nothing changed. Record a hash today, recalculate it later; a match shows the file is untouched.
- ›Password storage. Systems store the hash of a password rather than the password, using purpose-built algorithms such as bcrypt or Argon2 rather than the file-hashing algorithms on this page.
[1] SELECT FILE(S) TO HASH
Select one or multiple files to hash from your system, or drag and drop files below
[2] CHOOSE YOUR HASH FUNCTION
[3] LAUNCH THE HASHING PROCESS
Hash, checksum, digest, fingerprint
These words are used almost interchangeably and in everyday use they mean the same thing. If you want the distinction: a digest is the formal term for the output of a cryptographic hash function; a checksum historically meant a much simpler error-detection value such as CRC32, which catches accidents but not tampering; fingerprint is an informal description. When a download page says "checksum" today it almost always means a cryptographic hash such as SHA-256.
FAQ
How do I find the hash value of a file?
Select the file in the calculator above and press calculate; the hash appears in a few seconds without the file leaving your computer. On the command line you can use certutil -hashfile FILE SHA256 on Windows, shasum -a 256 FILE on macOS, or sha256sum FILE on Linux.
Can two different files have the same hash value?
In principle yes, because unlimited inputs map to a limited number of outputs; this is called a collision. With MD5 and SHA-1, collisions can be deliberately manufactured. With SHA-256 no one has ever found one, so a match means the files are identical for any practical purpose.
Is a hash value the same as encryption?
No. Encryption is reversible with the right key, and its purpose is to hide contents. Hashing is deliberately irreversible, and its purpose is to identify contents. A hash cannot be decrypted back into the file.
Why is my hash value different from the one published?
Usually one of three reasons: you hashed with a different algorithm than the one published, the download is incomplete or corrupted, or the file genuinely is not the same one. Check the algorithm first — an MD5 is 32 characters and a SHA-256 is 64, so the length tells you immediately.