About the SHA-256 Generator
SHA-256 is the default choice for integrity checks today and sits underneath TLS certificates, software signing and many blockchains. This SHA256 generator produces the 64-character hexadecimal digest of any text as you type, using your browser's built-in cryptography: hello gives a hash beginning 2cf24dba5fb0a30e. Even a single changed character produces a completely different result, which is what makes it useful for verifying that data has not been altered. It is a one-way function, so the original text cannot be recovered from the hash. For keyed signatures, use the HMAC Generator, and for older checksums, the MD5 Generator.
SHA-256 differs from MD5 and SHA-1 in one decisive way: no practical collision attack against it is known. No matching pair of inputs has ever been found, and nothing in current research suggests one will be. That is why it is trusted in situations where an attacker might pick the input, such as digital signatures, certificate fingerprints, content-addressed storage and download checks.
The digest is computed by the Web Crypto interface that is part of your browser, the same code websites use for their own security features. As a result the values match every other correct implementation exactly, and the calculation happens on your device rather than on a server.
One misuse deserves a clear warning: SHA-256 is not suitable for storing passwords. It was built to be fast, and speed works against you there, because anyone holding a leaked database can test billions of guesses per second. Passwords call for bcrypt, scrypt or Argon2 with a separate salt for each user. Whatever you hash here is not uploaded, logged or stored, so private text stays on your computer.
How to use the SHA-256 Generator
- Enter the textThe SHA-256 digest appears straight away and updates while you type.
- Copy the resultOne button copies the 64-character value.
- Check a published valuePaste a checksum you were given to confirm whether it matches.
- Use it for the right jobsIntegrity checks and signatures, yes; storing raw passwords, no.
SHA-256 Generator features
- Standard 64-character hexadecimal digest
- Calculated by the browser's built-in Web Crypto code
- Results update as you type
- Proper UTF-8 handling for accented text and emoji
- Comparison box that confirms a match or a mismatch
- No known practical collisions, unlike MD5 and SHA-1
- Nothing is uploaded or stored
Common uses
- Checking a download against its published SHA-256 checksum
- Creating a content-based identifier for a piece of text
- Confirming that two texts are exactly the same, character for character
- Fingerprinting an API request body
- Exploring how a cryptographic hash reacts to small changes
SHA-256 in practice: verifying downloads, hex and Base64 forms, webhooks, container digests and why hashing phone numbers is not anonymous
SHA-256 is the everyday hash of modern software, used to verify downloads, identify container images, sign webhooks and protect integrity throughout the web. This guide shows how to verify a file on each major operating system, explains the different ways the same hash is written, covers webhook signatures and integrity attributes, and explains why hashing personal data such as phone numbers does not make it anonymous.
A worked example: the same text, three results
The SHA-256 of hello is:
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
Add a trailing newline, as many command-line tools do, and the result becomes a completely different value beginning 5891b5b5. Change the first letter to a capital and it begins 185f8db3. When two systems disagree about a hash, the inputs almost always differ by something invisible, such as a newline, a space or a different text encoding.
Verifying a download
Software publishers often list the SHA-256 value of each download. On Windows, PowerShell's Get-FileHash command uses SHA-256 by default, and certutil -hashfile file.iso SHA256 works too. On macOS, use shasum -a 256 followed by the file name, and on Linux, sha256sum. If the value matches the one published on the official site, served over HTTPS, the file is the one the publisher released.
Hex and Base64
A SHA-256 digest is 32 bytes. Written in hexadecimal it takes 64 characters, while Base64 writes the same bytes in 44 characters, so hello becomes LPJNul+wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ=. Integrity attributes on script tags and content security policy hashes use the Base64 form, while checksum lists usually use hex. Comparing a hex value with a Base64 one will never match, even when both describe the same data.
Integrity attributes for CDN scripts
When a page loads a library from a public CDN, an integrity attribute containing the file's hash makes the browser refuse the file if it has been altered. This protects visitors if the CDN is ever compromised. The attribute names the algorithm, such as sha384, followed by the Base64 digest, and the value must be updated whenever the library version changes.
Webhook signatures
Payment gateways, courier services and other platforms often sign the webhooks they send using HMAC with SHA-256 and a secret shared with you. Your server recomputes the signature from the received body and compares it with the one in the request header. The comparison should use a constant-time function, and the body must be hashed exactly as received, before any parsing or reformatting.
Container image digests
Container images are identified by digests written as sha256 followed by the hash of their contents. Deploying by digest rather than by a tag such as latest guarantees the exact same image runs every time, because a tag can be moved to a new image while a digest cannot change without the content changing.
Hashing personal data is not anonymisation
Hashing phone numbers or CNICs before storing them can look like anonymisation, but it is not. Pakistani mobile numbers follow a known pattern with only around a billion possible combinations, which a computer can hash in minutes, so every stored hash can be matched back to its number. Using HMAC with a secret key that is stored separately makes reversal impractical without that key, and keeping as little personal data as possible is better still.
Common mistakes
- Comparing a hex digest with a Base64 one.
- Hashing text that differs by a trailing newline.
- Verifying a download against a checksum from an untrusted page.
- Treating hashed phone numbers or IDs as anonymous.
Related tools
For a longer digest, use SHA-512 Generator. To create keyed signatures, try HMAC Generator, and for older systems that still use MD5, MD5 Generator.
Text versus files
This tool hashes the text you type or paste. A text file's hash calculated from its pasted contents may not match the file's own hash, because the file might contain a byte order mark, different line endings or a final newline that pasting removes. For files, use the operating system commands described above to hash the exact bytes.
Proving a result was fixed in advance
Publishing the SHA-256 of a result before revealing it lets others confirm later that it was not changed, for example the answer to a puzzle or the random seed for a giveaway draw. For short or guessable results, add a long random secret to the text before hashing and reveal it together with the result, otherwise people can simply hash every possible answer.
Content addressing
Some systems store data under the hash of its content, so identical content is stored only once and any change produces a new address. Git identifies every file and commit this way, traditionally with SHA-1, and newer versions can also use SHA-256. Container registries and many backup tools work on the same principle.
Privacy
Hashes are calculated with your browser's built-in cryptography. Your text is not uploaded, logged or stored.
Further reading: Base64, URL Encoding and Hashing: What Is the Difference?.
Frequently asked questions
Is SHA-256 considered secure?
Yes, for the work hash functions are meant to do. Cryptographers know of no feasible way to make two messages share a digest, and that confidence is why secure websites, operating system updates and code signing all depend on it.
Can a SHA-256 hash be turned back into text?
No. The function is one-way, so the only approach is to guess inputs and hash them. A long random input therefore stays hidden, whereas a predictable one like password123 is recovered almost instantly.
Is SHA-256 a good choice for storing passwords?
No, because it is far too fast. Graphics cards can test enormous numbers of candidate passwords against a stolen list of such hashes every second. Use bcrypt, scrypt or Argon2, which are deliberately slow, with a unique salt for every account.
How is SHA-256 related to SHA-2?
SHA-2 is the name of the family, and SHA-256 is its member that produces a 256-bit digest. SHA-384 and SHA-512 belong to the same family, and SHA-256 is the one most systems use by default.
Why does another tool give me a different hash for the same text?
Nearly always the input differs slightly: another text encoding, or an invisible line break added at the end. This page hashes exactly what you typed, encoded as UTF-8, which is the standard behaviour.
Does my text get sent anywhere?
No. The Web Crypto functions run inside your browser, so neither the text nor its digest leaves your device, and nothing is stored after you close the page.