SHA-2 Hash Generator
Get the SHA-256, SHA-384 or SHA-512 hash of any text or file as you type. Paste a published hash to check a download, and copy the result as hex or Base64. Everything runs in your browser.
SHA-256("hello world") = b94d27b9…e2efcde9
11 characters → 11 bytes of UTF-8
Hashes
SHA-25664 characters
b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
SHA-38496 characters
fdbd8e75a67f29f701a4e040385e2e23986303ea10239211af907fcbb83578b3e417cb71ce646efd0819dd8c088de1bd
SHA-512128 characters
309ecc489c12d6eb4cc40f50c902f2b4d0ed77ee511a7c7a9bcd3ca86d4cd86f989dd35bc5ff499670da34255b45b0cfd830e81f605dcf7dc5542e93ae9cd76f
Fine-tune
Line breaks in text
Everything is hashed in your browser. Your text and files are never uploaded.
How to generate a SHA-256 hash
- Type or paste your text into the box, or switch to File and drop in any file: a download, a photo, a document.
- The SHA-256, SHA-384 and SHA-512 hashes appear straight away and update as you type. Copy the one you need.
- To check a hash you were given, paste it into Check against a hash. The matching row turns green, or you are told what is likely to be different.
A hash is a fixed-length fingerprint of the exact bytes you put in. The same input always gives the same hash, and changing a single character gives a completely different one. That is why hashes are used to confirm a file arrived intact, to spot changed data, and inside things like TLS certificates and Bitcoin.
Text is hashed as UTF-8, the encoding used by almost every website, programming language and command-line tool, so the result matches what they produce for the same text. SHA-224, SHA-512/224 and SHA-512/256 are under Fine-tune if you need them.
Worked example: checking a download
Software sites often list a SHA-256 checksum next to the download link. Checking it proves your copy is complete and is the exact file the publisher released.
Step 1: Drop the downloaded file into the tool
Step 2: Copy the checksum from the download page
Step 3: Read the result
A single changed byte gives a different hash. Try it with text:
hello world → b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
Hello world → 64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c
Only the first letter changed, yet the two hashes have nothing in common. There is no such thing as a hash that is “nearly right”: it either matches exactly or the data is different.
How long is a SHA-256, SHA-384 or SHA-512 hash?
The number in the name is the length in bits. Every hash from one variant is the same length, whether you hash one letter or a 10 GB file, so the length tells you which variant a hash came from.
| Variant | Bits | Bytes | Hex characters | Base64 characters |
|---|---|---|---|---|
| SHA-256 | 256 | 32 | 64 | 44 |
| SHA-384 | 384 | 48 | 96 | 64 |
| SHA-512 | 512 | 64 | 128 | 88 |
| SHA-224 | 224 | 28 | 56 | 40 |
| SHA-512/256 | 256 | 32 | 64 | 44 |
| SHA-512/224 | 224 | 28 | 56 | 40 |
Hex uses two characters per byte, which is why a 32-byte SHA-256 hash is 64 characters long. Base64 packs the same bytes into fewer characters and usually ends in =. A 40-character hash is SHA-1 and a 32-character one is MD5, not SHA-2; for SHA-1, use the SHA-1 Hash Generator.
Why doesn't my SHA-256 hash match?
Nearly always because the bytes being hashed are not quite the same, even though the text looks identical. Here is what small, invisible differences do to the SHA-256 of hello world:
| What is different | SHA-256 starts with | What to do |
|---|---|---|
| Nothing: plain hello world | b94d27b9… | This is the reference. |
| A line break at the end | a948904f… | Tick “Add a line break at the end”. echo and most text files add one. |
| Windows line break (CRLF) at the end | 572a95fe… | Choose Windows (CRLF) as well. |
| A space at the end | 9e1b0435… | Remove it; the tool warns about it. |
| A capital H | 64ec88ca… | Hashes are case-sensitive about the text. |
| Hashed as UTF-16 instead of UTF-8 | 36f71d94… | In code, encode the text as UTF-8 first. |
| Hash written in capitals | B94D27B9… | Same hash. Hex letters are not case-sensitive. |
| Hash written in Base64 | uU0nuZNN… | Same hash in a different alphabet. Switch the output to Base64. |
The most common trap is the line break. echo "hello world" | sha256sum hashes the text plus a line break, so it gives a948904f…, not b94d27b9…; echo -n leaves it out. Likewise, hashing a text file usually includes the line break at the end of the last line, while pasting its contents may not.
If you are checking a file, hash the file itself rather than pasting its contents: copying text can change line breaks and invisible characters. And if a downloaded file does not match, it is a different or damaged file. Download it again from the official site rather than using it.
SHA-256 vs SHA-384 vs SHA-512: which should you use?
If you are checking a hash someone gave you, use whichever one they published; the length tells you which. If you are choosing, SHA-256 is the standard choice. It is what download pages, certificates, Bitcoin and most APIs use, and it is far beyond the reach of any known attack.
- SHA-256: the default for checksums, file fingerprints and signatures. Shortest common hash that is still considered fully secure.
- SHA-384: a shortened SHA-512. Common in TLS certificates, government systems and the
integrityattribute websites use to check scripts (sha384-…). - SHA-512: the longest hash. Often just as fast as SHA-256 on 64-bit computers, though SHA-256 wins on processors with built-in SHA-256 instructions. Pick it when a system asks for it or you want the largest safety margin.
All three come from the same SHA-2 family and are equally trustworthy for everyday use. A longer hash is not “more correct”, only harder to attack in theory, and SHA-256 is already strong enough that the difference rarely matters.
Can a SHA-256 hash be decrypted?
No. Hashing is not encryption: there is no key and no way to run it backwards. A 64-character SHA-256 hash can stand for a single word or a whole film, so the original simply is not in it.
What sites that claim to “decrypt” SHA-256 actually do is look the hash up in a list of hashes of common words and passwords. That works for hello world or password123, and never for anything long or random. It is also why passwords should not be stored as plain SHA-256: they are fast to compute, so guesses can be tested by the billion. Websites should use a slow password hash such as Argon2id, scrypt or bcrypt instead.
Similarly, an API that asks for an “HMAC-SHA256” signature wants a hash mixed with a secret key, which a plain hash like the ones above does not include.
Frequently asked questions
Is SHA-256 the same as SHA-2?
SHA-256 is one member of the SHA-2 family. SHA-2 is the name for all six: SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 and SHA-512/256. When people say "SHA-2" they usually mean SHA-256, the most widely used one.
Is SHA-256 still secure?
Yes. There is no practical way to find two inputs with the same SHA-256 hash or to work back from a hash to its input, and NIST still approves the whole SHA-2 family. The older MD5 and SHA-1 are the ones considered broken.
Why does empty text have a hash?
SHA-2 works on any amount of data, including none. The SHA-256 of empty text is e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. If you see that hash where you expected something else, the input was probably empty.
Are my text and files uploaded?
No. The hashes are worked out by your browser on your device, so nothing you type or drop in leaves your computer. Large files are read in pieces, so even multi-gigabyte downloads can be checked.
What are SHA-224 and SHA-512/256 for?
They are shorter versions of SHA-256 and SHA-512 for systems with limited space. You only need them when a specification asks for them. Turn on "Show every SHA-2 variant" under Fine-tune, or paste a 56-character hash and they appear automatically.
Sources
- NIST FIPS 180-4, Secure Hash Standard: the definition of every SHA-2 variant and its output length
- NIST Hash Functions project: which hash functions NIST approves, and the status of SHA-1
- MDN: SubtleCrypto.digest(): how browsers compute SHA-256, SHA-384 and SHA-512
- OWASP Password Storage Cheat Sheet: why fast hashes are not for passwords, and what to use instead
Related Tools
PBKDF2 and key derivation functions.
SHA-1 hashes of text or files, and Git object IDs.
Generate salts for encryption and hashing.
Break secrets into verifiable shares.