Hash generator for text and files

MD5, SHA-1/2/3, Keccak, CRC-32 and HMAC of text or files, in hex or Base64.

Input

43 bytes

Hashes

MD5 ⚠Not collision resistant: fine as a checksum, not where someone could craft an input.

9e107d9d372bb6826bd81d3542a419d6

SHA-1 ⚠Not collision resistant: fine as a checksum, not where someone could craft an input.

2fd4e1c67a2d28fced849ee1bb76e7391b93eb12

SHA-256

d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592

SHA-384

ca737f1014a48f4c0b6dd43cb177b0afd9e5169367544c494011e3317dbf9a509cb1e5dc1e85a941bbee3d7f2afbc9b1

SHA-512

07e547d9586f6a73f73fbac0435ed76951218fb7d0c8d788a309d785436bbb642e93a252a954f23912547d1e8a3b5ed6e1bfd7097821233fa0538f3db854fee6

SHA3-256

69070dda01975c8c120c3aada1b282394e7f032fa9cf32f4cb2259a0897dfc04

SHA3-512

01dedd5de4ef14642445ba5f5b97c15e47b9ad931326e4b0727cd94cefc44fff23f07bf543139939b49128caf436dc1bdee54fcb24023a08d9403f9b4bf0d450

Keccak-256

4d741b6f1eb29cb2a9b9911c82f56fa8d73b04959d3d9d222895df6c0b28aa15

CRC-32 ⚠Not collision resistant: fine as a checksum, not where someone could craft an input.

414fa339

⚠ Not collision resistant: fine as a checksum, not where someone could craft an input.

Paste a hash; case and spaces are ignored for hex.

What this tool does

Type or paste text, or choose a file, and every hash is computed at once: MD5, SHA-1, SHA-256, SHA-384, SHA-512, SHA3-256, SHA3-512, Keccak-256 (the original Keccak padding that Ethereum uses) and CRC-32. Tick HMAC to compute keyed hashes instead, with a text or hex key. Results can be shown in hexadecimal (lower or upper case), Base64 or Base64url, and the compare box tells you which algorithm, if any, produced a hash you paste. Text and files never leave your browser; files are read in slices, so large ones work too.

Text is hashed as UTF-8 bytes

A hash is computed over bytes, not characters. The tool encodes text as UTF-8, exactly as typed, which is what printf '%s' 'text' | sha256sum does on a command line. Two things commonly make a hash "not match":

  • A trailing line break. echo 'text' | sha256sum hashes the text plus a newline, so the result differs. Use printf '%s' or echo -n.
  • A different encoding. "é" is two bytes in UTF-8 (C3 A9) and one in Latin-1 (E9). The byte count under the text box shows what is being hashed.

Worked example: the text The quick brown fox jumps over the lazy dog (43 bytes) has MD5 9e107d9d372bb6826bd81d3542a419d6, SHA-256 d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592 and CRC-32 414fa339. With HMAC and the key key, HMAC-SHA256 is f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8.

Which algorithm for what

  • SHA-256 is the sensible default for checksums, content addressing and signatures. SHA-512 is as strong and often faster on 64-bit CPUs; SHA-384 is SHA-512 cut short.
  • SHA-3 (SHA3-256, SHA3-512) is a different design from SHA-2, standardised in FIPS 202. Use it when a protocol asks for it. Keccak-256 is not the same as SHA3-256: it uses the padding from before standardisation, and appears in Ethereum.
  • MD5 and SHA-1 are broken for collisions: people can make two different inputs with the same hash. They are still fine for detecting accidental corruption, and some old systems expect them, but never use them where someone could craft an input.
  • CRC-32 is a checksum, not a cryptographic hash: it catches transmission errors (ZIP, PNG and gzip use it) but is trivial to forge.
  • HMAC proves a message came from someone who knows the key, as webhook signatures do. Comparing SHA-256(key + message) instead is vulnerable to length-extension attacks; HMAC is not.
  • Passwords: none of these. A fast hash lets an attacker try billions of guesses a second. Use a password hashing function such as Argon2id, scrypt or bcrypt.

The article which hash to use: MD5, SHA-256 or HMAC explains these choices with examples.

How the tool is checked

MD5 is tested with the full RFC 1321 suite, SHA-1 and SHA-2 with the FIPS 180-4 examples, SHA-3 with the NIST values (including one million times "a"), CRC-32 with the standard check value (CBF43926 for "123456789"), and HMAC with the RFC 2202 and RFC 4231 test cases; all of them are also compared with OpenSSL. For checking a download against a published checksum, the file hash checker has a dedicated layout. To encrypt rather than hash, use text encryption.

Frequently asked questions

Why does my SHA-256 differ from the command line?

Usually because echo adds a newline: echo 'abc' | sha256sum hashes four bytes, not three. Use printf '%s' 'abc' | sha256sum or echo -n. Different text encodings (UTF-8 versus Latin-1 or UTF-16) also give different bytes and so different hashes.

Can a hash be reversed?

No, not by computation. But short or common inputs can be found by guessing: an MD5 or SHA-256 of a common password is found in seconds in public tables. That is why passwords need slow, salted functions such as Argon2id or bcrypt.

Is MD5 still safe to use?

For detecting accidental damage to a file, yes. For anything an attacker could influence (signatures, certificates, deduplication of untrusted files), no: collisions can be produced on a laptop. Use SHA-256.

What is the difference between SHA3-256 and Keccak-256?

Both use the Keccak permutation, but NIST changed the padding when it standardised SHA-3 in FIPS 202. Ethereum adopted Keccak before that, so its 'keccak256' gives different results from SHA3-256 for the same input.

When should I use HMAC?

Whenever a hash must prove who sent a message: webhook signatures, API request signing, signed cookies. Both sides share a secret key, and only someone with the key can produce a matching HMAC. Compare HMACs with a constant-time function in your code.