SHA-256 generator
Hash any text to a 64-character SHA-256 digest. SHA-384, SHA-512, SHA-1 and MD5 are generated in the same pass, which makes it easy to see how the algorithms differ on identical input.
UTF-8, no trailing newline added
What SHA-256 gives you
SHA-256 is a member of the SHA-2 family, published by NIST in 2001. It takes any input and
returns 256 bits, written as 64 hexadecimal characters. The string hello hashes to
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824.
Unlike MD5 and SHA-1, no practical collision has been found for SHA-256. That is why it became the default wherever a digest has to survive contact with an adversary: TLS certificates, signed software updates, Git object identifiers, Bitcoin block headers, container image manifests, and the checksum lists published next to most Linux distributions.
Where you will meet a SHA-256 value
| Context | What is hashed |
|---|---|
| Release checksums | The installer or archive file, published as a .sha256 file or a line of text next to the download. |
| TLS certificates | The certificate body, before the CA signs it. Visible in the browser's certificate viewer. |
| Git | The commit object contents, which is why a commit ID changes when history changes. |
| Bitcoin | Block headers and transaction identifiers, using a double SHA-256 construction. |
| Subresource Integrity | The integrity attribute on a script tag, so a CDN cannot swap the file. |
| APIs | Webhook signatures, where the body is hashed with a shared secret (HMAC, not a bare hash). |
The same value from a terminal
# Linux
printf '%s' 'hello' | sha256sum
# macOS
printf '%s' 'hello' | shasum -a 256
# Windows PowerShell
$b = [Text.Encoding]::UTF8.GetBytes('hello')
[BitConverter]::ToString([Security.Cryptography.SHA256]::Create().ComputeHash($b)).Replace('-','').ToLower()
# OpenSSL
printf '%s' 'hello' | openssl dgst -sha256
Not for passwords. SHA-256 is fast by design, which is exactly the wrong property for password storage. A modern GPU tests billions of candidates per second. Use Argon2id, scrypt or bcrypt with a per-user salt, as described in password hashing.
SHA-256, SHA-384 or SHA-512?
All three are SHA-2 and all three are unbroken. SHA-384 and SHA-512 are faster than SHA-256 on 64-bit hardware but produce longer output, so they are used where storage is cheap and the digest will be compared by hand. For checksums and general use, SHA-256 is the safe default because every tool, library and platform supports it without special handling. The full size comparison is in the hash length reference.
Frequently asked
Why is my SHA-256 different from the one on the download page?
Check the obvious causes in order: the file may be partially downloaded, the page may list a SHA-512 value instead (128 characters), or the publisher may have re-built the artifact after posting the checksum. The checksum guide covers each case.
Can two different inputs have the same SHA-256?
In theory yes, because the output space is finite. In practice no: finding a collision by brute force would take on the order of 2^128 operations. No collision for full SHA-256 has been published.
Does a trailing space change the hash?
Yes, completely. A space, a tab, a carriage return and a newline are all bytes, and every byte changes the digest. This is the single most common reason two people get different values for "the same" text.
Is this tool using the browser's own crypto?
Yes for SHA-256, SHA-384 and SHA-512: the page calls the Web Crypto API, which is the same implementation your browser uses for TLS. MD5 is not part of Web Crypto, so a small JavaScript implementation is used for that row, verified against the RFC 1321 test vectors.
Related
- File checksum — SHA-256 for a file of any size.
- Checksum verifier — check a digest against your content.
- HMAC generator — keyed SHA-256 for API signatures.
- MD5 vs SHA-256 — when the older algorithm still applies.