tools / hash
hash/
Calculate MD5, SHA-1, SHA-256, SHA-384, SHA-512 and HMAC of text or files. Text is encoded as UTF-8.
Input
Digests
| MD5 | |
|---|---|
| SHA-1 | |
| SHA-256 | |
| SHA-384 | |
| SHA-512 |
| HMAC HEX | |
|---|---|
| HMAC Base64 |
What is a hash
A hash function turns data of any length into a fixed-length digest from which the original cannot be worked back; SHA-256, for example, always gives 256 bits, or 64 characters in hex. This page computes MD5, SHA-1, SHA-2 family hashes and HMAC for text (as UTF-8) or files.
How it works: compress block by block into a fixed-length digest
- The data is padded and cut into fixed-size blocks, and each block updates an internal state: MD5, SHA-1 and SHA-256 use 512-bit blocks, SHA-384 and SHA-512 use 1024-bit blocks.
- Result lengths: MD5 128 bits, SHA-1 160 bits, SHA-256 256 bits, SHA-384 384 bits, SHA-512 512 bits; in hex, the number of bits divided by 4 is the number of characters.
- Collisions can be deliberately constructed for MD5 and SHA-1 (two different pieces of data made on purpose to give the same result), so they should no longer be used for security purposes such as digital signatures or certificates.
- HMAC (RFC 2104) hashes the key and the data twice in fixed steps; without the same key you cannot get the same result.
Example
The SHA-256 of the three letters abc; 256 bits in hex are exactly 64 characters:
- Input
- abc
- Output
- ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
HMAC-SHA256 with the key Jefe:
- Input
- what do ya want for nothing?
- Output
- 5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843
Sources
FAQ
Can MD5 be decrypted online?
No. MD5 is a one-way digest, not encryption, so there is nothing to decrypt. This site only calculates hashes and never looks anything up online. So-called "MD5 decrypt" sites just match your hash against a table of hashes of known plaintexts; short common passwords are found, long random ones are not.
Why does the hash differ from the command line or another tool?
First check for an extra line break or space in the input. This tool hashes the text box content exactly as UTF-8 without trimming whitespace, while echo on the command line adds a newline by default, so use echo -n to match. Line breaks in the text box are counted as LF; if the original uses Windows CRLF, switch to file mode, which hashes the raw bytes and agrees with md5sum and shasum. Upper or lower case hex makes no difference; tick "Uppercase output" to match the other side.
How are 16-character and 32-character MD5 related?
The 32-character form is the full MD5: 128 bits written as 32 hexadecimal characters. The so-called 16-character MD5 is the 9th to 24th characters of those 32. This tool gives the full 32 characters; if you need the 16-character version, cut it out yourself.
How do I verify the hash of a downloaded file, and is there a size limit?
Drop the file onto the area under the input box. MD5, SHA-1, SHA-256, SHA-384 and SHA-512 are calculated together, and you compare them with the value on the download page. The limit is 200 MB; the whole file is read into memory first, so a very large file uses a lot of memory, and a failed read is reported on the page. For files over 4 MB, MD5 is calculated in chunks with a progress indicator.
How do I calculate an HMAC, and how do I enter the key?
Enter the key below and the HMAC is calculated over the same input above (text or a file), with SHA-1, SHA-256 or SHA-512 to choose from, shown in both hexadecimal and Base64. Whatever you type in the key box is taken as text and its UTF-8 bytes are used as the key; if your key is really raw bytes written as hex or Base64, typing it in as is gives a different result. HMAC-MD5 and HMAC-SHA384 are not available here.
What should I do about "WebCrypto is not available here"?
Open the site over HTTPS, or use it on localhost. The SHA family and HMAC rely on the browser's WebCrypto, which is only available in secure contexts (HTTPS, localhost), so on a plain http page those results do not appear. MD5 is implemented by the page itself and is not affected.
Which should I pick, MD5, SHA-1 or SHA-256, and can I use them to store passwords?
For file integrity checks or digital signatures, prefer SHA-256 or another longer SHA-2 variant; MD5 and SHA-1 only suit catching accidental corruption or matching old systems. Do not store user passwords with any of them directly either; use a salted, slow hash such as bcrypt, scrypt or Argon2. This site only offers MD5, SHA-1, SHA-256, SHA-384, SHA-512 and HMAC.
Are my text and files uploaded?
No. MD5 is calculated by the page's own code, and SHA and HMAC use the browser's built-in WebCrypto. Text, files and the HMAC key are handled only on your device, with no upload requests.