On many download pages, underneath the big button, there is a long run of letters and numbers, labelled MD5 or SHA-256, with no explanation attached. That string is a file hash, there so you do not have to take the download on faith.
A hash lets you prove that the file you received is byte for byte the file the publisher released. This guide explains what it is, why publishers print one, and how to check yours with the free File Hash and Info Report on Ovatly, which reads the file in your browser and uploads nothing.
Contents
- Quick answer
- What a hash function actually does
- Why the string looks the way it does
- Why download pages show one
- How to check a hash yourself, step by step
- Worked example: the abc test vectors
- What else the report shows
- Limitations and honest tradeoffs
- Common mistakes
- FAQs
- Conclusion
- References
Quick answer
A file hash is a fixed-length string computed from a file's exact bytes. The same bytes always give the same string, and changing one byte changes the string completely. Download pages show a hash so you can recompute it, with a tool like the File Hash and Info Report, and compare. If your string matches the published one, your copy is identical to theirs. If it differs by one character, you have a different file.
What a hash function actually does
A hash function takes input of any size, a three-byte note or a three-gigabyte installer, and produces output of one fixed size. MD5 always returns 32 characters. SHA-256 always returns 64. The size of the file tells you nothing about the length of its hash.
Three properties make hashes useful as fingerprints. First, the function is deterministic: the same input always produces the same output, on any machine. Second, it is one-way: you cannot rebuild the file from its hash. Third, it avalanches: change a single bit of the input and the output changes beyond recognition, with no pattern linking the two strings. There is no such thing as a near match.
Why the string looks the way it does
The characters are hexadecimal: the digits 0 to 9 plus the letters a to f, a compact way of writing the raw numbers the function produces, two characters per byte of output. MD5 produces 16 bytes, written as 32 hex characters; SHA-256 produces 32 bytes, written as 64. The string looks alien because it is a number, written in base 16.
Because the string is exact, the comparison has to be exact too. A hash is not a summary where close counts. Paste both values into a text editor and check the full length, not just the first few characters.
Why download pages show one
A publisher computes the hash once, from the master copy of the file. From then on, anyone, anywhere, can check their copy against it. Publishers print it for three practical reasons.
The first is corruption. Files get cached, mirrored and resumed after dropped connections. They usually arrive intact, but not always, and a damaged installer can fail in confusing ways or, worse, mostly work. A hash check settles the question in seconds.
The second is substitution. Mirrors and archives can serve a file that is not the one the publisher released: an older version, a repackaged copy, or in the worst cases something tampered with. The file name will look right either way. The hash will not.
The third is that a promise is not testable. The publisher cannot check your copy for you, and their assurance that the file is fine gives you nothing to verify. The hash is the verifiable version of that assurance: seconds to print, a minute to check.
How to check a hash yourself, step by step
- Copy the hash from the download page, and note which algorithm it belongs to: a 32-character string is MD5, a 64-character string is SHA-256.
- Open the File Hash and Info Report and choose the file you downloaded. Nothing is uploaded; your browser reads the file on your device.
- Let the tool compute. MD5 is read in 4 MB slices with a progress bar; SHA-256 reads the file as one block.
- Find the report line for the same algorithm.
- Compare the two strings in full, character by character. A complete match means your copy is the publisher's file. Any difference means it is not.
Worked example: the abc test vectors
You do not need a real download. The field relies on published test vectors, agreed values any correct tool must produce. The classic input is the three characters abc, saved as a text file of exactly 3 bytes, with no newline at the end. Run it through the report and you should see:
MD5: 900150983cd24fb0d6963f7d28e17f72
SHA-256: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
Those are the standard published results for abc. If your file produces different values, the near-certain cause is a hidden trailing newline your editor added, making it a 4-byte file with a different fingerprint. One extra byte, a completely different string, and the check noticed what your eyes could not.
What else the report shows
Alongside the hashes, the report lists the file's name, size, extension, modified date and reported type. For text-like files (text, Markdown, JSON, code and similar) up to 512 KB, it also shows a preview.
One honest note on the type field: it is the type the browser reports, which usually comes from the file's extension, not from inspecting its contents. Rename a .zip to .txt and the report describes it the way its name suggests. The hashes are computed from the actual bytes and ignore the name entirely, which is why they are the part you can rely on for identification.
Limitations and honest tradeoffs
A hash proves identity, not quality. A match tells you your copy is identical to the copy that was hashed. It says nothing about whether the publisher is competent or honest, or whether the original file contained something nasty. Verification and trust are separate judgements, and the hash only makes the first one.
MD5 has a real weakness: it is an identification checksum, not a security proof, because collisions (two different files with the same MD5) are practical to construct. SHA-256 has no such practical weakness, so prefer it whenever the publisher offers both.
There is a practical cost too: SHA-256 reads the file as one block, so a very large file can take a while and use noticeable memory. That is the price of checking locally instead of uploading the file to a server.
Common mistakes
- Skimming the comparison. Checking the first eight characters and calling it a match proves almost nothing. Compare the full string, every time.
- Comparing across algorithms. Your computed MD5 will never equal a published SHA-256. Match the algorithm first, then the string.
- Checking the wrong file. A downloads folder can hold the installer, its previous version and a partial download with similar names. Hash the file you actually downloaded.
- Assuming a match means safe. It means unchanged. The trust decision about the source is still yours.
- Assuming a mismatch means an attack. Most mismatches are dull: a cut-off download, or the wrong file entirely. Start with a fresh download from the publisher, not with alarm.
FAQs
What is a file hash in plain terms? It is a fingerprint of a file: a function reads the file's bytes and produces a short, fixed-length string. Identical files always produce identical strings, and a file changed by even one byte produces a completely different one.
Why do publishers print the hash instead of just promising the file is fine? A promise cannot be checked. The hash can. Publishing the fingerprint of the master copy gives every downloader a way to prove, on their own machine, that their copy is the released file.
Can two different files have the same hash? That is called a collision. For MD5, collisions are practical to construct, which is why MD5 is only an identification checksum. For SHA-256, no practical collision method is known, which is why it is the stronger check.
Is my file uploaded when I check its hash here? No. Your browser reads the file locally and computes the hashes on this device. Nothing leaves your machine, which is what you want when checking an unverified file.
Does a matching hash mean a file is safe? It means your copy is identical to the copy the checksum was computed from. It does not judge whether that original was good. Verification confirms the copy survived unchanged; trusting the publisher is separate.
Conclusion
A file hash is a small string that does one job completely: it lets a publisher state exactly which file they released, and it lets you confirm that the copy on your disk is that file. The File Hash and Info Report computes both fingerprints in your browser, so the check happens where the file already is. And if a comparison ever comes back different, our guide to what to do when a checksum does not match walks through the likely causes and the fix. For more guides in this series, see our File and Data Conversion guides.
References
- MDN Web Docs, on the Web Crypto digest operation browsers use to compute hashes: https://developer.mozilla.org/en-US/docs/Web/API/SubtleCrypto/digest
- NIST, the Secure Hash Standard (FIPS 180-4) that defines SHA-256: https://csrc.nist.gov/pubs/fips/180-4/upd1/final
- RFC 1321, the MD5 Message-Digest Algorithm specification: https://www.rfc-editor.org/rfc/rfc1321