How to Generate an MD5 or SHA-256 Hash and Verify a File Checksum
Generate an MD5, SHA-1 or SHA-256 hash from text or a file and check a download against its published checksum. MD5 vs SHA-256 explained.
Updated November 7, 20267 min read
A hash is a short fingerprint of some data: feed in a word or a 4 GB disc image and you get back a fixed-length string of letters and digits. Change one byte of the input and the fingerprint changes completely. That makes hashes the standard way to check that a download arrived intact. To do it, hash the file with the hash generator, paste the checksum the publisher listed, and read the verdict. This guide covers that, the differences between MD5, SHA-1 and SHA-256, and the two mistakes people make most: treating a hash as encryption and using a plain hash for passwords.
What a hash is, in plain terms
A hash function reads any amount of data and produces a digest of a fixed size. Three properties matter in practice. The same input always gives the same digest. A tiny change in the input gives a digest that looks unrelated. And you cannot work backwards from the digest to the input. The text "hello" hashes to 5d41402abc4b2a76b9719d911017c592 with MD5 and to 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 with SHA-256, every time, on every computer. The length depends on the algorithm, not on the input: even an empty input has a digest.
Verify a downloaded file, step by step
Find the published checksum
Software pages and release notes list a checksum next to the download, often labelled SHA-256 or MD5. Copy it, or keep the page open.
Add the file
Open the hash generator, switch the input to File, and drop in the downloaded file. Any file type works.
Press Hash file
A progress bar shows how much of the file has been read, and Cancel stops the work. MD5, SHA-1, SHA-256 and SHA-512 are selected by default; you can add SHA-384, SHA3-256, SHA3-512 or CRC-32.
Paste the checksum into the verify box
In Verify against a checksum, paste the value. The tool works out the algorithm from its length (32 hex characters is MD5, 40 is SHA-1, 64 is SHA-256) and says whether it matches. Case and surrounding spaces are ignored.
Act on the result
A match means the file is byte for byte what was published. A mismatch means it is not: download it again, ideally from the original source, and compare once more before you open it.
Hash text or a file with eight algorithms and verify a checksum by pasting it. Free: one file up to 250 MB, or text up to 5 MB, with every algorithm included. Pro: queues of up to 100 files. It all runs on your device, not our servers.
Generate a hashMD5, SHA-1 or SHA-256: which one
| Algorithm | Digest length | Hex characters | Status today |
|---|---|---|---|
| MD5 | 128 bits | 32 | Broken for security; fine for spotting accidental corruption |
| SHA-1 | 160 bits | 40 | Broken for security; still used by some tools, such as Git object ids |
| SHA-256 | 256 bits | 64 | The usual default for downloads and new work |
| SHA-512 | 512 bits | 128 | Wider digest, often fast on 64-bit hardware |
| SHA3-256 | 256 bits | 64 | A different design from SHA-2, for when a standard asks for one |
| CRC-32 | 32 bits | 8 | A checksum, not a cryptographic hash; catches accidents only |
The first rule is simple: use the algorithm the publisher gave you. A SHA-256 you computed proves nothing if the page only lists MD5. If you are free to choose, pick SHA-256, which every language and command-line tool already supports.
"Broken" has a specific meaning. For MD5 and SHA-1, researchers can build two different files with the same digest on purpose. That ruins them for signatures and certificates, where an attacker controls the content. It does not make them useless for a different question: did this file get corrupted while downloading? Random damage will not accidentally produce a matching digest, so an MD5 that matches is still good evidence of an intact copy. If you need the single-algorithm pages, there are dedicated ones for MD5, SHA-1 and SHA-256.
A hash is not encryption
Encryption is reversible by design: with the key you get the original back. A hash throws information away, so there is nothing to reverse. Sites that claim to "decrypt" an MD5 are looking the value up in a table of inputs somebody already hashed, which is why short and common strings fall to them. Encoding is a third idea again: Base64 simply rewrites bytes in another alphabet and anyone can undo it. If you need to hide data, use encryption. If you need to prove data has not changed, use a hash.
Why a plain hash is wrong for passwords
Hash functions such as MD5 and SHA-256 are built to be fast. For checking a 4 GB file that is a virtue. For passwords it is a flaw, because an attacker who steals a database of fast hashes can test billions of guesses per second, and identical passwords produce identical hashes. Passwords need a deliberately slow function with a unique salt per user, such as Argon2, scrypt or bcrypt, from a well-reviewed library. Use this tool to compare and verify files and strings, not to design password storage.
A related tool is HMAC, which mixes a secret key into the hash so only someone holding the key can produce or check the value. It is how webhook signatures work. Enter a key in the HMAC key field and say whether it is UTF-8, hex or Base64; every selected algorithm then produces an HMAC. CRC-32 cannot take a key and is left out while one is set.
Text and file hashes differ, and why a checksum fails to match
A hash is computed over bytes, and one visible text can be several different byte sequences. That is the most common reason a checksum "does not match" when nothing is wrong.
| Cause | What happens | What to do |
|---|---|---|
| Line endings | Windows files end lines with CRLF, macOS and Linux with LF: different bytes | Hash the file itself, not pasted text |
| Byte-order mark | A UTF-8 file saved with BOM starts with three invisible bytes | Hash the file as stored |
| Trailing newline | Editors add one on save; pasting usually does not | Hash the file, or add the same newline |
| Encoding | Text typed here is hashed as UTF-8; UTF-16 or legacy code pages hold other bytes | Hash the original file |
| Wrong algorithm | A 64-character value is SHA-256 or SHA3-256, not the same thing | Select the algorithm the publisher named |
Text mode is for strings you hash on purpose, such as an API payload. It updates as you type. For the same reason, a stray space at the end of a pasted word gives a different digest; the tool shows the character and byte counts so you can spot it. Encoded text is a related trap, and URL encoding changes the bytes before they are hashed.
Limits, formats and batches
Every algorithm, every output format (lowercase hex, uppercase hex, Base64), HMAC and checksum verification are free. Free hashes one file at a time up to 250 MB, or text up to 5 MB. Pro removes the size cap and queues up to 100 files, with an export that the standard sha256sum -c command can read, a CSV, and a single archive download. The file is read in pieces, so a big disc image does not have to fit in memory. Everything runs on your device, not our servers, which matters when the file is one you are not allowed to share.
A hash is also not an identifier. If you only need a unique id, a UUID is the right tool; a hash of a record changes whenever the record does.
Frequently asked questions
How do I generate an MD5 or SHA-256 hash of a file?
Open the hash generator, switch to File, drop in your file and press Hash file. MD5, SHA-1, SHA-256 and SHA-512 are calculated in one pass, and you can copy any of them. Free covers one file up to 250 MB.
How do I verify a file checksum?
Hash the downloaded file, then paste the publisher's checksum into the Verify against a checksum box. The algorithm is detected from the length of the value, and the tool confirms a match or says there is none.
Is MD5 still safe to use?
Not for security. Two different files can be crafted to share an MD5, so do not use it for signatures or passwords. It still works for detecting accidental corruption when that is the checksum the publisher gives.
Can a hash be reversed to get the original text?
No. A hash discards information, so it is one-way. Sites that claim to reverse hashes look the value up in a list of inputs that were already hashed, so short or common strings are found and long random ones are not.
Why does my SHA-256 not match the published one?
Usually the bytes differ: the download was incomplete, you hashed a different file, or you hashed pasted text instead of the file because of line endings or a byte-order mark. Check you picked the algorithm the publisher named, then download again.
Can I use a hash to store passwords?
Not a plain one. MD5 and SHA-256 are fast, so stolen hashes can be guessed at enormous speed. Use a slow, salted password function such as Argon2, scrypt or bcrypt from a reviewed library.