fileformer
search⌘KtranslateENexpand_moreupload_fileConvert
Converters8 file families · 44 direct conversions
What changes in a conversionarrow_forward
home/developer-tools/hash-generator

Hash generator

A hash generator for SHA-1, SHA-256, SHA-384 and SHA-512 fingerprints of any text, and check a download against its published checksum. Computed by your browser's built-in crypto: nothing is sent.

input text43 bytes
Verify a checksuminfoCase and spaces don’t matter.
hashes
lowerUPPER
SHA-1legacycontent_copyCopy
2fd4e1c67a2d28fced849ee1bb76e7391b93eb12160 bits · 40 hex characters
SHA-256recommendedcontent_copyCopy
d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592256 bits · 64 hex characters
SHA-384strongcontent_copyCopy
ca737f1014a48f4c0b6dd43cb177b0afd9e5169367544c494011e3317dbf9a509cb1e5dc1e85a941bbee3d7f2afbc9b1384 bits · 96 hex characters
SHA-512strongcontent_copyCopy
07e547d9586f6a73f73fbac0435ed76951218fb7d0c8d788a309d785436bbb642e93a252a954f23912547d1e8a3b5ed6e1bfd7097821233fa0538f3db854fee6512 bits · 128 hex characters
~/the-avalanche-effect

Change one letter, change everything.

A good hash reacts wildly to tiny edits: about half of all the output bits flip. That's what makes it useful for spotting tampering. Edit the second line.

SHA-256 of original
6301eabae52edbb3b623ac43cccc139aea1f5c77423d907d05eb53e3d5771e3f
SHA-256 of edited: changed characters highlighted
8588fb8aadc8e64b55022498d45b0ee25de2082f165fee85d2c18961e950a956
characters changed63 / 64
bits flipped129 / 256
share of bits50%
~/often-confused

Hashing, encryption, encoding.

Three ways to transform data, for three completely different jobs.

fingerprintthis tool
HashingA one-way fingerprint. You can’t get the original back, you can only hash again and compare.
reversibleno
needs a keyno
same input → same outputalways
Use it for:checksums, deduplication, detecting changes.
lockthis tool
EncryptionScrambles data so only someone with the key can turn it back into the original.
reversiblewith the key
needs a keyyes
same input → same outputusually not
Use it for:keeping secrets: messages, files, backups.
swap_horizthis tool
EncodingChanges the format so data survives a system: no secrecy at all.
reversibleby anyone
needs a keyno
same input → same outputalways
Use it for:Base64, URL encoding, sending binary as text.
~/which-algorithm

Which algorithm should you use?

algorithmoutputstatusgood for
MD5128 bitsbrokenOld checksums only. Collisions can be made on purpose, never for security.
SHA-1160 bitslegacyGit history and old systems. Practical collisions exist since 2017.
SHA-256256 bitsrecommendedThe everyday default: file checksums, signatures, blockchains, APIs.
SHA-384384 bitsstrongTLS certificates and systems that need a larger security margin.
SHA-512512 bitsstrongLong-term integrity; often faster than SHA-256 on 64-bit CPUs.
bcrypt / Argon2variesfor passwordsDeliberately slow and salted, the right choice for storing passwords.
warningStoring passwords? Don't use any of these directly, they're built to be fast, which helps attackers. Use a deliberately slow password hash such as bcrypt, scrypt or Argon2 with a unique salt.
~/merkle-damgard-padding

What the hash function actually reads: your bytes, a 1 bit, zeros and the length.

SHA-1 and SHA-2 process fixed-size blocks: 64 bytes for SHA-256, 128 for SHA-512. FIPS 180-4 pads every message the same way. Append the byte 80, then zeros, then the message length in bits as a big-endian integer, so the total fills a whole number of blocks. A message one byte too long for the last block spills into a whole new one. Type to see the padded input built live.

SHA-256 · 64 BSHA-512 · 128 B
message3 B0x80 · the 1 bit1 Bzero padding52 Blength in bits8 B
block 1 of 1bytes 0-63
61626380000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000018
message3 bytes · 24 bitspadded to64 bytesblocks processed1room left in last block52 bytes
warningLength extension. The final internal state is the hash itself, so anyone who knows SHA-256(secret + message) and the secret’s length can compute the hash of secret + message + padding + more, without knowing the secret. That’s why API signatures use HMAC rather than a plain hash of key and data. SHA-3, BLAKE2 and the truncated SHA-512/256 aren’t affected.
~/birthday-bound

How many hashes before two of them match by chance?

With an n-bit hash there are 2ⁿ possible outputs, but random collisions appear after only about 2ⁿᐟ² inputs, as in the birthday paradox. That’s why a 128-bit hash gives just 64 bits of collision resistance. The odds below use p ≈ 1 − e^(−k²/2ⁿ⁺¹) for k random inputs; deliberate attacks on broken algorithms like MD5 and SHA-1 are far faster than this.

Hash size
32 bitsCRC-32 · checksums64 bits64-bit · short IDs128 bitsMD5 · also UUIDs160 bitsSHA-1 · Git256 bitsSHA-256 · the default512 bitsSHA-512
chance at least two collide1 in 6.8 × 10²⁶Far less likely than any hardware failure. For random inputs, collisions won’t happen.
possible outputs2¹²⁸50% chance after2.2 × 10¹⁹collision security64 bits
~/spec-sheet

Hash functions, for reference.

Block sizes, word sizes and rounds from FIPS 180-4 and FIPS 202, the security level against each kind of attack, and whether this browser’s Web Crypto can compute it.

algorithmoutputblockwordroundscollisionstatusWeb Crypto
MD512851232642¹⁸ (broken)Broken since 2004; collisions in secondscancel
SHA-116051232802⁶³·¹ (broken)SHAttered 2017; deprecated for signaturescheck_circle
SHA-2242245123264112 bitsTruncated SHA-256cancel
SHA-2562565123264128 bitsThe common defaultcheck_circle
SHA-38438410246480192 bitsTruncated SHA-512; no length extensioncheck_circle
SHA-51251210246480256 bitsFaster than SHA-256 on 64-bit CPUscheck_circle
SHA-512/25625610246480128 bitsDifferent IVs; no length extensioncancel
SHA3-2562561088 rate6424128 bitsKeccak sponge, FIPS 202cancel
BLAKE2b≤ 51210246412256 bitsRFC 7693; used by Argon2cancel
Known-answer tests: SHA-256 of these must match exactly
""verifiedmatches this browsere3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
"abc"verifiedmatches this browserba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
"abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"verifiedmatches this browser248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1
1979Merkle’s thesisRalph Merkle describes building hashes from a compression function, later formalised with Damgård.
1992MD5Ron Rivest publishes RFC 1321.
1993SHA-0NIST publishes FIPS 180; it is withdrawn two years later.
1995SHA-1FIPS 180-1 fixes SHA-0 with a one-bit rotation.
2001SHA-2SHA-256, SHA-384 and SHA-512 are published; SHA-224 follows in 2004.
2004MD5 collisionsWang and colleagues find practical MD5 collisions.
2015SHA-3FIPS 202 standardises Keccak, a sponge design unlike SHA-2.
2017SHAtteredGoogle and CWI publish the first SHA-1 collision: two different PDFs.
2022SHA-1 retiredNIST announces SHA-1 must be phased out by 2030.

More security tools

For the jobs next to hashing.

All developer tools →