Hash Generator

Drop files here to hash them

any type, any size — they are read in pieces and never uploaded

Algorithms

Drop a file or type some text and get MD5, SHA-1, SHA-256, SHA-512 and CRC-32 back. Files are read in 8 MB pieces, so a 4 GB disk image hashes as easily as a note; there is no size limit and nothing leaves your browser. Paste the checksum from a download page, or a whole SHA256SUMS file, and the page tells you whether it matches.

How to check a download against its checksum

  1. Drop the file on the page. Several files at once work too, and each gets its own block.
  2. Leave MD5 and SHA-256 ticked, or tick the one the download page names.
  3. Paste the published checksum into the compare box. You can paste a single value, a value with a prefix such as sha256:, or the whole SHA256SUMS file that many projects publish next to their releases.
  4. Read the verdict. Match means every byte is the same. Anything else tells you the character where the two values first differ.

The algorithm is worked out from the length of the value you paste: 8 hexadecimal characters is CRC-32, 32 is MD5, 40 is SHA-1, 64 is SHA-256 and 128 is SHA-512. If you paste a SHA-1 value while only SHA-256 is ticked, the page adds SHA-1 by itself. When the pasted text is a list, each file is compared with the line that carries its name, in either the sha256sum layout or the BSD one, SHA256 (name) = value.

No file size limit

The browser's built-in digest function takes the whole input in one call, so a page built on it has to hold the entire file in memory. That is where the caps come from: at least one of the pages that rank for this search states a 50 MB limit for files. This page does not use it. MD5, SHA-1, SHA-256, SHA-512 and CRC-32 are written out here as incremental hashes, and the file is read 8 MB at a time and fed through as it goes. Memory use stays at one piece whatever the size. A 320 MiB test file was hashed this way with MD5 and SHA-256 together in about 3.5 seconds on the machine these pages are built on, and the SHA-256 matched Python's.

How it was checked

Hand-written hash code is easy to get subtly wrong, and the errors cluster at the edges. Every algorithm here was compared with Python's hashlib and zlib on inputs of 23 different lengths, including the ones on either side of each block boundary — 55, 56, 57, 63, 64, 65 bytes for the 64-byte algorithms and 111 to 129 for SHA-512, whose blocks are 128 bytes — plus the empty input. All 115 comparisons agree. (The first version of SHA-512 did not: one intermediate value was treated as a signed number, and every SHA-512 result was wrong until that test caught it.)

On the same machine, in Chrome, the speeds came out at roughly 280 MiB/s for MD5, 230 for SHA-1, 155 for SHA-256, 80 for CRC-32 and 75 for SHA-512. SHA-512 is slower because JavaScript has no 64-bit integer arithmetic on ordinary numbers, so each 64-bit word is handled as two 32-bit halves. Your device will differ; the order will not.

Why a text hash differs from the command line

The most common surprise is a line break. The SHA-256 of hello is 2cf24dba…9824, and the SHA-256 of hello followed by a newline is 5891b5b5…be03 — completely different. The shell command echo hello prints the newline, so hashing its output gives the second value; echo -n hello or printf hello gives the first. The page tells you when your text ends with a line break so you can see which one you are hashing.

Text is hashed as UTF-8. An é is two bytes and a Chinese character is three, so the same visible text saved in another encoding produces a different hash. The size line above the result shows the byte count, not the character count.

Which algorithm to pick

AlgorithmLengthUse it for
SHA-25664 charactersVerifying downloads; the default choice
SHA-512128 charactersWhen a project publishes it; not stronger in practice for this job
SHA-140 charactersOlder release lists, Git object names
MD532 charactersCatching accidental corruption only
CRC-328 charactersComparing with a ZIP or PNG checksum; accidental errors only

MD5 and SHA-1 are fine for noticing that a download was cut short. They are not fine for proving that nobody swapped the file, because collisions can be manufactured for both. A checksum only protects you if it comes from somewhere the attacker could not also change — a hash printed on the same page as the file adds nothing against someone who controls that page.

Packing files together before you send them? The ZIP maker checks each file's CRC-32 after packing; the same CRC-32 option is here for comparing a file with an archive listing. To see what changed between two versions of a text file rather than whether they differ at all, use text diff. Nothing you drop on this page is uploaded.

Frequently asked questions

How do I check that a download is intact?

Drop the file on the page, paste the checksum from the download page into the compare box, and read the verdict. The algorithm is worked out from the length of what you pasted: 64 hex characters is SHA-256, 40 is SHA-1, 32 is MD5. If the download page publishes a SHA256SUMS file, paste all of it - the page finds the line with your file's name.

Is there a file size limit?

No. The file is read 8 MB at a time and fed to the hash as it goes, so memory use stays flat whatever the size. A hash built on a single call to the browser's digest function needs the whole file in memory at once, which is where the common 50 MB and 100 MB limits on other pages come from.

Why is there no SHA-3 or bcrypt?

This page is for checksums, which is what MD5, SHA-1, SHA-256, SHA-512 and CRC-32 are used for. Password hashes such as bcrypt and Argon2 are deliberately slow and salted; a browser page that hands you one for a password you typed would be a bad habit to encourage.

Is MD5 still safe to use?

For catching a corrupted download, yes. For anything an attacker might tamper with, no: MD5 and SHA-1 collisions can be produced on purpose, so two different files can be made to share a hash. Use SHA-256 or SHA-512 when the checksum has to protect against a deliberate change.

Why does my text hash differ from the command line?

Usually a line break. echo adds a newline to what it prints and the hash covers it; printf and echo -n do not. The page tells you when your text ends with a line break. Encoding matters too: text is hashed as UTF-8, so a character outside plain ASCII is more than one byte.

What is a CRC-32 for?

It is a short check value used by ZIP, PNG and Ethernet to catch accidental corruption. It is not a hash in the security sense - it is easy to forge - but it is what the ZIP listing of a file shows, so it is handy for comparing a file with an archive entry.

Does anything get uploaded?

No. The hashing is plain JavaScript running in this page, and the file is read with the browser's own file API. You can turn off the network after the page loads and it still works.