SHA Hash Generator
Generate SHA-1, SHA-256, SHA-384 and SHA-512 hashes in your browser using the native Web Crypto API. Explicit UTF-8 and line-ending handling.
Input is always encoded as UTF-8. The same text in another encoding hashes differently. Line endings change the digest: "a\n" and "a\r\n" produce different SHA-256 values.
SHA-1
Do not use for securityda39a3ee5e6b4b0d3255bfef95601890afd80709
SHA-256
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
SHA-384
38b060a751ac96384cd9327eb1b1e36a21fdb71114be07434c0cc7bf63f6e1da274edebfe76f65fbd51ad2f14898b95b
SHA-512
cf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e
Key Takeaways
- Hashing is not encryption: it is one-way, and there is no such operation as decrypting a digest.
- MD5 is deliberately absent. The Web Crypto API (crypto.subtle.digest) does not implement it at all, because the algorithm is broken.
- SHA-1 is available but collision-broken: fine for non-security uses such as git object ids, never for signatures.
- Do not use SHA-256 to store passwords. That job needs bcrypt, scrypt or Argon2.
Why MD5 is not offered here
This question comes up often, because almost every online hash tool offers MD5. The answer is technical and precise: crypto.subtle.digest, the browser's built-in cryptography interface, implements only SHA-1, SHA-256, SHA-384 and SHA-512. MD5 appears nowhere in the specification, and that is a deliberate design decision rather than an oversight. Practical collision attacks on MD5 have been public since 2004: you can produce two different inputs with an identical digest in seconds. The standard refused to put a broken algorithm on the platform surface.
The only way to add MD5 to this page would be to ship a hand-rolled JavaScript implementation. That means both unnecessary bundle weight and the wrong message. If you have a legitimate reason to compute an MD5, such as verifying a legacy file checksum, reach for md5sum or openssl dgst -md5 on the command line. If you are designing a new system, MD5 is not the right answer at any layer of it.
Algorithms and digest lengths
| Algorithm | Digest length | Hex characters | Status |
|---|---|---|---|
| SHA-1 | 160 bit | 40 | Collision-broken (SHAttered, 2017) |
| SHA-256 | 256 bit | 64 | Secure, the common default |
| SHA-384 | 384 bit | 96 | Secure, a truncated SHA-512 variant |
| SHA-512 | 512 bit | 128 | Secure, fast on 64-bit hardware |
SHA-1 is on the list because legitimate uses for it remain. Git object identifiers, legacy file inventories and checksums intended to catch accidental corruption all qualify. The distinction is this: SHA-1 is still good at catching random damage, but not at resisting a deliberate attacker. The SHAttered research published in 2017 produced two valid PDFs sharing one SHA-1 digest. It therefore has no place anywhere a signature, certificate or proof of integrity is required, and the tool labels it accordingly in the interface.
Hashing is not encryption
The most common misconception arrives as "how do I decrypt this hash". You cannot. A hash function is one-way: it produces a fixed-length output no matter how long the input was, and information is irreversibly discarded along the way. A ten megabyte file collapses to a 64-character SHA-256 digest, and reversing that is not mathematically possible.
Sites advertised as an "MD5 decrypter" or a "SHA-1 cracker" perform no reversal at all. They look the digest up in enormous precomputed tables. If your input was a common password or a short word it will be in the table; if it was random text it will not. That says the input was guessable, not that the algorithm was broken.
SHA-256 is the wrong tool for passwords
The SHA family was designed to be fast. That is exactly the property you want for verifying a file, and exactly the property you do not want for storing a password. An ordinary graphics card computes billions of SHA-256 digests per second, so weak passwords in a leaked table fall within minutes. The correct answer is a password hashing function that is deliberately slow and memory-hungry.
// WRONG: being fast works in the attacker's favourconst digest = await crypto.subtle.digest('SHA-256', utf8('mypassword')); // RIGHT: server-side, with a salt and a cost parameterimport { hash, verify } from '@node-rs/argon2'; const stored = await hash('mypassword', { memoryCost: 19456, // KiB timeCost: 2, parallelism: 1,});// $argon2id$v=19$m=19456,t=2,p=1$<salt>$<digest> await verify(stored, submittedPassword); // true / falseWarning
Why your hash does not match
When two parties believe they hashed the same text and get different results, the cause is almost always at the byte level. A hash function sees bytes, not characters, so encoding and line-ending differences land directly in the output. This tool always encodes input as UTF-8 and offers line-ending normalisation as a separate, explicit option.
// Line endings: Windows CRLF and Unix LF are different bytessha256('a\n'); // 87428fc522803d31065e7bce3cf03fe475096631e5e07bbd7a0fde60c4cf25c7sha256('a\r\n'); // a different digest entirely // Encoding: identical-looking text can be different bytesnew TextEncoder().encode('ş'); // [0xC5, 0x9F] UTF-8, two bytes// ISO-8859-9 writes the same letter as the single byte [0xFE].// Same letter, different bytes, different digest. // An invisible BOM is part of the text toosha256('hello') !== sha256('\uFEFFhello');Frequently Asked Questions
- Is the text I enter sent to a server?
- No. The digest is computed with the Web Crypto API in your browser and involves no network request at all. Once the page has loaded you can disconnect and the tool keeps working, which matters when you are hashing something confidential.
- Does the same input always produce the same digest?
- Yes, byte-identical input always produces identical output, and that determinism is the whole point of hashing. If you are seeing a different result, the inputs are not byte-identical: line endings, a trailing space, an encoding difference or an invisible BOM are the usual culprits.
- Can I reverse a digest to recover the original text?
- No. Hash functions are one-way, and information about the input is irreversibly lost. Sites that advertise themselves as decrypters simply search precomputed tables, so they only return anything when the input was short and common.
- Should I choose SHA-256 or SHA-512?
- Both are secure today. SHA-256 is more widely accepted and produces a shorter digest. SHA-512 is usually faster for large inputs on 64-bit processors. Unless a specific standard forces your hand, SHA-256 is the sensible default.
- Can I hash a file?
- This tool works on text input. To hash a file, shasum -a 256 file on Unix or certutil -hashfile file SHA256 on Windows is more practical, because those stream the contents instead of loading a large file into browser memory.