What Is a Hash? MD5, SHA-256 and CRC32 Explained in Five Minutes
A hash is a short fingerprint of any text or file. Here is what that means, how MD5, SHA-1, SHA-256, SHA-512 and CRC32 differ, which one to use, and how to generate them free in your browser.
A hash is a short, fixed-length fingerprint of any piece of data: a word, a document or a 2 GB file. Run the same data through the same hash function and you always get the same fingerprint. Change even one character and the fingerprint changes completely.
Three properties that make hashes useful
- Deterministic: the same input always gives the same hash, on any computer.
- Fixed length: a SHA-256 hash is always 64 hexadecimal characters, whether the input is one letter or a whole film.
- One-way and sensitive: you cannot turn a hash back into the original data, and a tiny change in the input produces an entirely different hash.
Here is that sensitivity in action. Changing one letter to a capital produces a completely different, unrelated result (hashes produced by our Hash Generator):
| Input | SHA-256 hash |
|---|---|
| hello | 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 |
| Hello | 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969 |
MD5, SHA-1, SHA-256, SHA-512 and CRC32 compared
| Algorithm | Hash length | Use it for | Avoid it for |
|---|---|---|---|
| CRC32 | 8 hex characters (32 bits) | Quick error checks on files and data transfers | Anything security-related: it is easy to fake |
| MD5 | 32 hex characters (128 bits) | Spotting accidental changes and duplicate files; older systems | Security: deliberate collisions are practical |
| SHA-1 | 40 hex characters (160 bits) | Compatibility with older tools | New security uses: it is considered cryptographically weak |
| SHA-256 | 64 hex characters (256 bits) | Verifying downloads, file integrity, and most modern uses | Storing passwords on its own (see below) |
| SHA-512 | 128 hex characters (512 bits) | The same as SHA-256 when a longer hash is wanted | Storing passwords on its own |
A collision is when two different inputs give the same hash. For MD5 and SHA-1, researchers have shown how to create collisions on purpose, so an attacker could swap in a different file with the same fingerprint. That is why the Hash Generator labels MD5, SHA-1 and CRC32 as not for security use. For anything that matters, use SHA-256.
What hashes are used for
- Verifying downloads. Software sites often publish a SHA-256 checksum. Hash the file you downloaded; if the two match, the file is complete and unchanged. Our File Checksum tool can compare the result with the expected value for you.
- Spotting duplicate or changed files. Two files with the same hash are, for practical purposes, identical.
- Behind the scenes in software: Git commits, digital signatures, caches and blockchains all rely on hashes.
How to generate a hash
- Open the Hash Generator and choose Text or File.
- Pick the algorithms you need. All five are selected by default.
- Click Generate Hashes. Every result appears side by side.
- Copy a single hash, use Copy all, or Download as TXT.
Everything is calculated in your browser, so your text and files are never uploaded. Need just one algorithm? There are dedicated SHA-256, MD5, SHA-1 and SHA-512 tools too.
Frequently asked questions
Can a hash be reversed?
No. A hash function is one-way. Short or common inputs can sometimes be guessed by hashing many candidates and comparing, which is why hashes alone should not protect passwords.
Which hash should I use?
SHA-256 for almost everything. Use MD5 or CRC32 only for quick, non-security checks or when an older system requires them.
Why does my hash differ from the one on a website?
Either the file is different (incomplete, corrupted or altered), or you used a different algorithm. Also check for extra spaces or line breaks when hashing text, because they change the result.
Are my files uploaded?
No. The Hash Generator calculates every hash locally in your browser.
Don't see the tool you need?
Goeroe Digital builds custom calculators, generators, and business tools on request.
Request a Custom Tool