A checksum arrives without a label more often than you would expect. It may be pasted into a release note, printed under a download button, or quoted in a support reply. Before you can check a file against it, you need to know which algorithm produced it, and the fastest way to find out is simple. Count the characters.

Every hash algorithm prints its digest at one fixed length, and the lengths do not overlap. This guide gives you the table and explains why the lengths are what they are. It also shows how the SHA Hash Generator and the hash checker's auto-detect lean on the same fact.

Contents

  • Quick answer
  • The length table
  • Why each hex character is 4 bits
  • Why a longer output is a bigger search space
  • Length is not the whole story
  • How to identify an unknown checksum, step by step
  • Worked example: reading a real digest
  • Limitations and honest tradeoffs
  • Common mistakes
  • FAQs
  • Conclusion
  • References

Quick answer

Count the hex characters. 32 means MD5, 40 means SHA-1, 64 means SHA-256, 96 means SHA-384 and 128 means SHA-512. Each hex character carries 4 bits, so the character count is the algorithm's bit length divided by four: 64 characters is 256 bits. Once you know the algorithm, verify the file with that algorithm selected in the SHA Hash Generator. Or paste the value into a hash checker and let its auto-detect guess from the length.

The length table

Hex charactersAlgorithmBits
32MD5128
40SHA-1160
64SHA-256256
96SHA-384384
128SHA-512512

The algorithm's name usually gives the game away for the SHA-2 family: SHA-256 produces 256 bits, SHA-384 produces 384, SHA-512 produces 512. MD5 and SHA-1 predate that naming habit, but their outputs are just as fixed. No setting changes these lengths, whether the input is three letters or a three gigabyte file. Spaces pasted along with a value do not change the count that matters; strip them and count the characters themselves.

Why each hex character is 4 bits

Digests are printed in hexadecimal, base 16, because it is compact. A hex character takes one of sixteen values: the digits 0 to 9, then the letters a to f for the values ten to fifteen. Sixteen possibilities is exactly what 4 bits can hold, since 2 to the power of 4 is 16.

That fact converts between the two ways lengths get quoted. Multiply the character count by 4 to get bits: SHA-256's 64 characters times 4 is 256 bits. Divide bits by 4 to get characters: SHA-512's 512 bits divided by 4 is 128 characters. When a publisher calls a checksum 256 bit and the string in front of you has 64 characters, the two agree.

Why a longer output is a bigger search space

The digest is the whole space an attacker has to search. Every extra bit doubles the number of possible digests, so the growth is not gentle. A 256 bit output does not have twice the room of a 128 bit output. It has 2 to the power of 128 times as much. Finding a second file that produces a given digest, or two files that collide, means searching that space. At SHA-256's size, the search is beyond practical reach. No SHA-256 collision has ever been found in practice.

Length is the first thing to look at in an unknown checksum. It tells you the algorithm, and it tells you the size of the haystack any attack would have to work through.

Length is not the whole story

It would be tidy if longer always meant safer, and it is not true. MD5 prints 32 characters and its collisions can be manufactured, which is why an MD5 match no longer proves a file untampered. SHA-1 prints 40 characters, a quarter more than MD5, and collisions have been demonstrated for it too. So SHA-1 survives only for verifying old published checksums. The algorithm's internal design matters alongside its length; a longer output from a broken design is still broken.

This is why the tool set is what it is. The SHA Hash Generator computes SHA-1, SHA-256, SHA-384 and SHA-512 using Web Crypto, the browser's built-in cryptography. SHA-224 and the SHA3 family are absent because Web Crypto exposes only the SHA-1 and SHA-2 family. The tool uses the audited built-in rather than a reimplementation.

How to identify an unknown checksum, step by step

  1. Copy the checksum and count its hex characters, ignoring any spaces. The count is the identification.
  2. Match the count against the table: 32 MD5, 40 SHA-1, 64 SHA-256, 96 SHA-384, 128 SHA-512.
  3. To verify a file against it, open the SHA Hash Generator, select that algorithm, choose File mode and compute the digest of your copy.
  4. Or paste the value into the Hash Checker with Auto-detect on. It guesses the algorithm from the length, hashes your file locally, and compares the two values character by character.

Worked example: reading a real digest

Here is a real digest, the SHA-256 of the three letters abc, the worked example printed in FIPS 180-4:

ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad

Count it and you get 64 characters, so the table says SHA-256, and 64 times 4 confirms the 256 bits the name promises. Paste that value into the Hash Checker, select a text file containing exactly abc with no trailing newline, and the checker reports Match. Press Enter at the end of that same file and the verdict flips to No match. The newline is part of the file. The bytes changed, and so did the digest. Length identified the algorithm; the bytes decided the verdict.

Limitations and honest tradeoffs

The table covers the algorithms you will actually meet on download pages and the ones the Ovatly tools compute. An exotic 256 bit hash from outside this set would also print 64 characters, so length identifies the algorithm in practice, not with mathematical certainty.

Identifying the algorithm says nothing about whether the value is trustworthy. A match proves your bytes are identical to the checksum source. It does not prove who published the file. So the checksum has to come from the publisher's own site over HTTPS. And hashing very large files means reading them fully into memory, which can be slow, whatever algorithm the length points to.

Common mistakes

  • Counting the spaces or the label. Pasted checksums often arrive grouped in spaces or with the algorithm name attached. Count hex characters only.
  • Assuming longer means safer. SHA-1 at 40 characters outlengths MD5 and is still not trusted for new integrity claims. Design matters, not just length.
  • Comparing across lengths. Hashing a file with SHA-256 and comparing it against a published 32 character MD5 value can never match. Identify the algorithm first, then compute with it.
  • Looking for SHA-224 or SHA3 in the generator. Web Crypto does not expose them, so the tool does not offer them.
  • Treating length as proof of trust. A correctly sized checksum from an untrusted page proves nothing about the file's origin.

FAQs

How can I tell which algorithm a checksum came from? Count the hex characters. 32 is MD5, 40 is SHA-1, 64 is SHA-256, 96 is SHA-384 and 128 is SHA-512. Length alone identifies the algorithm in almost every case you will meet on a download page.

Why does each hex character count as 4 bits? A hex character has sixteen possible values, 0 to 9 and a to f, and sixteen values need exactly 4 bits to store. So a 64 character SHA-256 digest carries 64 times 4, which is 256 bits.

Does a longer hash mean a more secure hash? Length sets the size of the search space, so a longer output is harder to collide or guess by brute force. But length is not the whole story: the algorithm's design matters too. That is why SHA-1 at 40 characters is no longer trusted, even though it is longer than MD5.

How does a hash checker know which algorithm I pasted? It guesses from the length, using the same table as this guide: 32 hex characters is treated as MD5 and 64 as SHA-256. If you know the algorithm, choosing it yourself removes the guesswork.

Why does the SHA Hash Generator not offer SHA-224 or SHA3? The tool computes hashes with Web Crypto, the browser's built-in cryptography. Web Crypto exposes only the SHA-1 and SHA-2 family: SHA-1, SHA-256, SHA-384 and SHA-512. SHA-224 and the SHA3 family are not part of that set.

Conclusion

A checksum's length is its identity card. Count the characters and divide the bits by four in your head. Then you know what produced it and how big a space an attacker faces. When you are ready to run the full check on a real download, see How to Verify Software with a SHA-256 Checksum. It walks through it end to end. For more guides in this series, see our Security and Privacy guides, which pair each technique with the free tool that performs it.

References