ToolsTray

Star a tool to keep it here.

Hash & HMAC Generator (MD5, SHA-256, CRC32)

Hash generator for MD5, SHA-1, SHA-256, SHA-384, SHA-512 and CRC32, plus keyed HMAC and a compare box that says outright whether two checksums match.

SHA-256

Algorithm
Hash

Storing a password? Use the Bcrypt Hash Generator, which salts and slows each hash on purpose.

Getting a digest

  1. Leave Hash on Text and type or paste into the box. The digest appears at the top, grouped in eights, with no button press, and the line under the box counts the bytes that went in.
  2. Pick the algorithm card. SHA-256 is already selected; MD5, CRC32, SHA-1, SHA-384 and SHA-512 sit beside it.
  3. Verifying a download instead? Switch Hash to File and drop the file in. The line under it names the file and its size.
  4. For a keyed HMAC, put the shared secret in the HMAC key field. The digest's label changes to what is being computed, for example HMAC-SHA-256.
  5. Paste the published checksum into Expected checksum if you have one, then take the digest with Copy.

About this tool

A hash generator turns whatever you give it into a fixed-length fingerprint, and there are six to pick from here: MD5, CRC32, SHA-1, SHA-256, SHA-384 and SHA-512. Choose one of the six cards under Algorithm, each marked with its length and what it is fit for, and the hex updates as you type, no button involved. SHA-256 is preselected because it is the sane default, and it gives you 64 hex characters. SHA-512 gives 128, SHA-384 gives 96, SHA-1 gives 40, MD5 gives 32, and CRC32 gives 8. You see one algorithm at a time; picking another card re-runs the same input through it.

Most people start on the Text tab. Switch Hash to File and the bytes get read off disk instead, which is how you check a download against the SHA-256 its author published. Paste theirs into Expected checksum and the page says whether it matches, and when it does not, why: a paste of the wrong length is named by the algorithm that length belongs to, and one of the right length is tried again with a trailing newline and with CRLF. The comparison ignores case, spaces and colons, so a value copied out of a SHASUMS file matches one written 3a:7f:b2 style. Put a secret in the HMAC key field and every digest becomes a keyed HMAC instead. CRC32 is the exception, being a plain checksum with no keyed form, and the tool says so rather than failing quietly.

Why your hash doesn't match sha256sum

Type hello into the Text box with SHA-256 selected and you get 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824. Run echo hello | sha256sum in a terminal and it hands back 5891b5b5… instead. Both are correct.

echo appends a newline, so the shell hashed six bytes and the box hashed five. Use echo -n hello and the two line up exactly. Nearly every mismatch I have chased turned out to be something that small: a trailing newline, CRLF where the other side had LF, or a space that came along with the copy. Paste 5891b5b5… into Expected checksum and the page finds the newline for you.

Good to know

  • MD5 and SHA-1 have practical collisions. As bare digests both are fine for spotting a corrupted download and for talking to a system that already expects them, and both are wrong anywhere an attacker gets a say in the input. Keyed, as HMAC-MD5 or HMAC-SHA-1, that warning stops applying, because HMAC does not lean on collision resistance; SHA-256 is still the better pick for anything new.
  • A file is read into memory whole before it is hashed, with no streaming. A few hundred megabytes is comfortable on a desktop and can be too much on an older phone.

Frequently asked questions

The checksum on the download page has colons in it. Will that still compare?

Yes. Colons, spaces and letter case all get normalised away before the two values are lined up, so 3a:7f:b2… and 3A7FB2… count as the same checksum. The verdict shows up as soon as both boxes have something in them.

Which algorithm should I pick if I have no idea?

SHA-256. It is the default here and it is what most projects publish alongside their downloads. Move up to SHA-384 or SHA-512 only when something specifically asks for a longer digest. MD5 and SHA-1 are there for matching systems that already use them, and CRC32 is an error check at eight hex characters, easy to collide on purpose.

Can I get the original text back out of a hash?

There is nothing to get back. Hashing throws the input away by design, which is why a 900 MB file and a three-letter word both come out as 64 hex characters of SHA-256. What you can do is hash a guess and see whether it matches, and that is precisely how password cracking works.

Why does the HMAC key field do nothing when CRC32 is selected?

CRC32 detects accidental corruption and has no cryptographic construction behind it, so there is no keyed version to compute. The digest clears and the note under the key tells you to pick MD5 or one of the SHA algorithms. Every other algorithm accepts a key.

Can I use this to hash passwords before storing them?

Please do not. A SHA-256 digest is fast on purpose, and fast is the wrong property for a stored password, because a GPU will grind through billions of guesses per second. Use the Bcrypt Generator instead: it salts each hash and is deliberately slow. There is a link to it just under the key field.

Missing something in Hash & HMAC Generator (MD5, SHA-256, CRC32)? Suggest a feature →

Tell someone who needs this.