SHA-256 Hash Generator
Generate SHA-256 checksums for text and files, verify them against a published hash, and hash large files locally in your browser.
Choose one or more files, or drop them here. Files are read in chunks in a background worker and are never uploaded. There is no fixed size limit.
Local Processing
100% client-side SHA-256 hashing. Your data never leaves your browser.
Cryptographically Secure
SHA-256 is collision-resistant and widely trusted for security applications.
Multiple Formats
Output as lowercase or uppercase hex, Base64 or Base64URL. Switch between formats instantly.
Large & Multiple Files
Files of any size are hashed in chunks in a background worker, with progress and cancel. Several files give sha256sum-style lines.
Compare & Verify
Paste a published checksum or a whole SHA256SUMS file and see match or mismatch for every file.
Lines & Raw Bytes
Hash each line separately, read the input as hex or Base64 bytes, or apply double SHA-256.
// ABOUT SHA-256 HASHING
How SHA-256 Works:
SHA-256 (Secure Hash Algorithm 256-bit) is part of the SHA-2 family designed by the NSA. It processes input data using the Merkle-Damgard structure with 64 rounds of compression. It produces a 256-bit (32-byte) hash value, rendered as a 64-character hexadecimal string.
Example:
"Hello" → 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
Common Use Cases:
- >Bitcoin mining and blockchain verification
- >SSL/TLS certificate validation
- >Digital signatures and code signing
- >File integrity verification and checksums
- >Building block of HMAC-SHA-256, HKDF and PBKDF2 (never store passwords as plain SHA-256)
>> frequently asked questions
Q: What is SHA-256?
A: SHA-256 (Secure Hash Algorithm 256-bit) is a cryptographic hash function from the SHA-2 family, designed by the NSA. It takes any input and produces a fixed 256-bit (64-character hexadecimal) hash value. It is widely used in security applications, blockchain technology, and data integrity verification.
Q: Is SHA-256 secure?
A: Yes, SHA-256 is considered cryptographically secure. Unlike MD5, no practical collision attacks have been found against SHA-256. It remains the standard for security-critical applications including Bitcoin, TLS/SSL, and digital signatures.
Q: What is the difference between SHA-256 and SHA-512?
A: SHA-256 produces a 256-bit (64 hex character) hash, while SHA-512 produces a 512-bit (128 hex character) hash. SHA-512 uses 64-bit operations and can be faster on 64-bit processors. Both are part of the SHA-2 family and are considered equally secure for their respective output sizes.
Q: Where is SHA-256 used?
A: SHA-256 is used extensively in Bitcoin and cryptocurrency mining, SSL/TLS certificates, digital signatures, code signing, file integrity verification, key derivation (HMAC, HKDF, PBKDF2), and many security protocols. It is the backbone of blockchain technology.
Q: Can SHA-256 be reversed?
A: No, SHA-256 is a one-way hash function. It is computationally infeasible to reverse a SHA-256 hash back to the original input. This property makes it ideal for security applications where data confidentiality is required.
Q: How do I generate a SHA-256 hash online — is it safe?
A: Paste any text into the input area and the hash updates as you type, or click [GENERATE SHA-256]. Hashing happens entirely in your browser — the content never leaves your device, and files are read locally in chunks instead of being uploaded. This means even secret values (API keys, tokens, confidential documents) can be hashed safely here; no request reaches our server. The page runs the open-source @noble/hashes SHA-256 implementation, checked against the NIST example messages and Node.js crypto. It is used instead of the Web Crypto API (crypto.subtle.digest('SHA-256', …)), which returns the same digest but needs the whole input in memory at once, so it cannot hash a large file piece by piece. Output can be rendered as hex (64 chars), Base64 (44 chars with padding) or Base64URL (43 chars).
Q: How do I compute SHA-256 in code?
A:
Python: import hashlib; hashlib.sha256(b'Hello').hexdigest()
Node.js: require('crypto').createHash('sha256').update('Hello').digest('hex')
Browser JS: const h = await crypto.subtle.digest('SHA-256', new TextEncoder().encode('Hello')); then convert the ArrayBuffer to hex.
Go: fmt.Sprintf("%x", sha256.Sum256([]byte("Hello")))
Java: MessageDigest.getInstance("SHA-256").digest("Hello".getBytes(StandardCharsets.UTF_8))
Shell: printf 'Hello' | shasum -a 256 (macOS) or printf 'Hello' | sha256sum (GNU coreutils). Avoid echo 'Hello' and <<< 'Hello' here: both append a newline, which gives a different hash.
Q: What's the difference between 'SHA 256 generator', 'SHA 256 online', and 'hash SHA 256'?
A: Nothing substantive — they are different phrasings of the same task. SHA 256 generator / SHA256 online / SHA-256 checksum / hash SHA 256 all refer to computing the 256-bit SHA-2 digest of some input. Our tool supports text, files, and multi-line input, and lets you switch between hex, Base64 and Base64URL output instantly.
Q: Why is SHA-256 always 64 hex characters?
A: SHA-256 always produces a 256-bit (32-byte) digest regardless of input length. Each byte renders as 2 hex characters, so the hex output is always 64 chars. Base64-encoded output is 44 characters (32 bytes → ceil(32/3)*4 = 44 with padding). If your SHA-256 tool returns a different length, it is using a truncated variant (e.g., SHA-224) or a different algorithm.
Q: Can I use SHA-256 for password storage?
A: Only with a slow, salted key-derivation function on top — never use bare SHA-256 for passwords. Raw SHA-256 is too fast: a modern GPU computes billions of hashes per second, making brute-force attacks on common passwords trivial. Instead use bcrypt, scrypt, Argon2id, or PBKDF2-HMAC-SHA-256 with a high iteration count and a per-user salt. SHA-256 on its own is appropriate for file integrity, signatures, HMAC, and blockchain — not for protecting user credentials.
Q: Is SHA-256 encryption? Can a SHA-256 hash be decrypted?
A: No. SHA-256 is a hash function, not encryption: it has no key and discards information, so there is nothing to decrypt. Encryption such as AES is designed to be reversed with a key. Sites that claim to "decrypt SHA-256" only look the hash up in a table of inputs that were hashed before, which is why short or common inputs such as password or 123456 are found instantly while a long random value is not.
Q: Is SHA256 the same as SHA-2?
A: SHA-2 is the family; SHA-256 is its most used member. FIPS 180-4 defines SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 and SHA-512/256 (see the SHA-2 variants tool). SHA256, SHA-256 and SHA2-256 are spellings of the same algorithm. SHA-3 is a different design (Keccak, FIPS 202), so SHA3-256 gives a different 64-character hash for the same input.
Q: Can two different files have the same SHA-256 hash?
A: In theory yes, because there are more possible files than 256-bit values. In practice nobody has ever published a SHA-256 collision, and finding one is expected to take about 2128 hash computations. A matching SHA-256 therefore means the two files are identical for every practical purpose. That is not true of MD5 or SHA-1, for which real colliding files exist.
Q: Why is my SHA-256 different from the one my terminal prints?
A: The two tools almost always hashed different bytes. The usual cause is a trailing newline: echo "Hello" | sha256sum hashes Hello\n, while this page hashes exactly what is in the input box. Windows line endings, a UTF-8 byte order mark, UTF-16 text and stray spaces have the same effect. The byte counter under the input and the troubleshooting table help you find the difference.
Q: How do I check files against a SHA256SUMS file?
A: Choose or drop all the downloaded files, then paste the content of the SHA256SUMS file into the compare field. Each file is matched to its line by name and marked MATCH, MISMATCH or NOT LISTED. GNU (hash name) and BSD (SHA256 (name) = hash) lines are both understood. On the command line the equivalent is sha256sum -c SHA256SUMS.
Q: What does the Double SHA-256 option do?
A: It hashes the input, then hashes the resulting 32 raw bytes again: SHA-256(SHA-256(data)). The second round runs over the binary digest, not over its 64-character hex text. Bitcoin uses this construction for block hashes and transaction IDs. For example, double SHA-256 of hello is 9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50.
Q: Is there a file size limit?
A: There is no fixed limit. A file is read in 4 MB chunks and fed to the hash incrementally in a background worker, so memory use stays flat and the page stays responsive; a progress bar and a cancel button are shown while it runs. How long a multi-gigabyte file takes depends on your device and disk.
Calculate the SHA-256 of a file
Choose or drop one or more files of any size. The browser reads each file in 4 MB chunks in a background worker and hashes its exact bytes; it does not decode binary content as text and does not upload anything. Copy the 64-character hexadecimal hash and compare every character with the checksum published by the file provider, or paste the published value into the compare field and let the page do the comparison.
Hex and Base64 are two representations of the same 32-byte digest. Changing the output format does not rehash the file. Text input is encoded as UTF-8; adding a newline changes its digest. An empty file also has a valid SHA-256.
How to verify a download with SHA-256
A matching hash proves integrity, not origin. Someone who can replace a file on a server can usually replace the checksum next to it. When authenticity matters, verify a signature on the checksum file (GPG, minisign, code signing) or obtain the checksum through a separate channel you already trust.
- >Get the expected checksum from the publisher: a hash on the official download page, a
.sha256file or aSHA256SUMSfile, fetched over HTTPS. - >Choose or drop the downloaded file above. Nothing is uploaded.
- >Paste the expected value into the compare field. Uppercase, spaces between bytes, a
sha256:prefix and whole checksum lines are accepted. - >MATCH means your copy has exactly the bytes the publisher hashed. MISMATCH means the download is incomplete, corrupted or was changed: do not run it, download it again.
SHA-256 checksum commands for Windows, macOS and Linux
Get-FileHash prints uppercase hex and some certutil versions put a space between bytes, while sha256sum, shasum and openssl print lowercase. These are the same digest: letter case and spacing do not matter when comparing hex, and the compare field accepts all of these forms.
Linux sha256sum file.iso
Linux verify sha256sum -c SHA256SUMS --ignore-missing
macOS shasum -a 256 file.iso
macOS verify shasum -a 256 -c SHA256SUMS
Windows cmd certutil -hashfile file.iso SHA256
PowerShell Get-FileHash file.iso -Algorithm SHA256
OpenSSL openssl dgst -sha256 file.iso
Text, no newline printf 'Hello' | sha256sum
Python 3.11+ hashlib.file_digest(open('file.iso', 'rb'), 'sha256').hexdigest()
Node.js crypto.createHash('sha256').update(data).digest('hex')
Why doesn't my SHA-256 hash match?
SHA-256 works on bytes, not on what the text looks like. One extra or different byte changes the whole digest, so two tools disagree only when they were given different bytes. Every row below looks like the word Hello, and every row has a different hash:
| What was hashed | Bytes | SHA-256 |
|---|---|---|
Hello | 5 | 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969 |
Hello + newline (echo, <<<, most text editors) | 6 | 66a045b452102c59d840ec097d59d9467e13a3f34f6494e539ffd32c1bb35f18 |
Hello + Windows line ending (CR LF) | 7 | 05ade08fcfb104f40b2536a14dfcd6e916d643f5cf8044b19028b607ae8f4908 |
Hello + one trailing space | 6 | 2ec5a3f0c2fc3e6dcee0f6f3a5735a6c69d2056579a5452095b75802094043a8 |
hello (lowercase h) | 5 | 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 |
Hello saved as UTF-8 with a byte order mark | 8 | be9e32376ecea97570d2df69cd10e0e7beb2007da30586c3f2cdb19f6dfac4d1 |
Hello saved as UTF-16 LE (no BOM) | 10 | a07e4f7343246c82b26f32e56f85418d518d8b2f2dae77f1d56fe7af50db97af |
Hello saved as UTF-16 LE with a byte order mark (Notepad "UTF-16 LE") | 12 | e92c383bb44d7233b120c0a799d77f92de3502ca7f43b5c7d39cbdbfee7928e3 |
- >Trailing newline: use
printf 'Hello'orecho -ninstead ofecho. The byte counter under the input tells you when the text ends with a line break. - >Line endings: the same text file has different hashes with LF and CR LF. Git's
autocrlf, FTP text mode and some editors convert them silently. - >Encoding: this page hashes typed text as UTF-8. If the other system uses UTF-16 or a legacy code page, hash the file itself rather than pasted text.
- >Hex pasted as text: if the input is a hex or Base64 representation of binary data (a key, a digest, a transaction), set INPUT ENCODING to hex or Base64 so the decoded bytes are hashed.
- >Unicode look-alikes:
écan be one code point oreplus a combining accent, and a non-breaking space is not a space. They look the same and hash differently. - >Another algorithm: SHA3-256, BLAKE2s, BLAKE3 and SHA-512/256 also give 64 hex characters. Check which algorithm the other side really used.
SHA-256 test vectors and common values
Use these values to check any SHA-256 implementation, including this one. The first four are the standard test messages published with the Secure Hash Standard examples and in RFC 6234. The last rows show why a plain SHA-256 of a weak password protects nothing: the hash of a common input is found by lookup.
| Input | SHA-256 |
|---|---|
"" (empty) | e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 |
abc | ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad |
abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq | 248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1 |
one million a characters | cdc76e5c9914fb9281a1c7e284d73e67f1809a48a497200e046d39ccc7112cd0 |
hello | 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 |
Hello | 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969 |
hello world | b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9 |
Hello World | a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e |
The quick brown fox jumps over the lazy dog | d7a8fbb307d7809469ca9abcb0082e4f8d5651e46d3cdb762d02d0bf37c9e592 |
test | 9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08 |
password | 5e884898da28047151d0e56f8dc6292773603d0d6aabbdd62a11ef721d1542d8 |
123456 | 8d969eef6ecad3c29a3a629280e686cf0c3f5d5a86aff3ca12020c923adc6c92 |
SHA-256 vs MD5, SHA-1, SHA-512, SHA-3 and BLAKE3
Use SHA-256 when the other side expects it or when you need a widely supported, standardized hash. Use MD5 or SHA-1 only to match an existing system, never to protect against deliberate tampering. To tell which algorithm produced a hash you were given, try the hash identifier.
| Algorithm | Digest | Hex length | Status | Typical use |
|---|---|---|---|---|
| MD5 | 128 bits | 32 | Broken: practical collisions since 2004 | Legacy systems, non-security checksums |
| SHA-1 | 160 bits | 40 | Broken: practical collision in 2017 (SHAttered); NIST plans to retire it by the end of 2030 | Legacy systems, Git object IDs |
| SHA-256 | 256 bits | 64 | No practical attack known | Download checksums, TLS certificates, signatures, Bitcoin |
| SHA-512 | 512 bits | 128 | No practical attack known | Same family; 64-bit arithmetic, larger digest |
| SHA3-256 | 256 bits | 64 | No practical attack known | Different design (sponge); not affected by length extension |
| BLAKE3 | 256 bits by default | 64 | No practical attack known | Very fast hashing of large data on multiple cores |
| CRC32 | 32 bits | 8 | Not a cryptographic hash | Detecting accidental transmission errors |
SHA-256 parameters and security
Length extension: SHA-256(secret + message) is not a safe message authentication code. Given that hash and the length of the secret, anyone can compute a valid hash for the message with extra data appended, without knowing the secret. Use HMAC-SHA-256 whenever a key is involved. SHA-3, BLAKE2 and the truncated SHA-512/256 are not affected.
Passwords: SHA-256 is designed to be fast, which is the wrong property for password storage. Use Argon2id, scrypt, bcrypt or PBKDF2 with a per-user salt, and keep SHA-256 for checksums, signatures and HMAC.
| Property | Value |
|---|---|
| Standard | FIPS 180-4 (SHA-2 family), also described in RFC 6234 |
| Digest size | 256 bits = 32 bytes = 64 hex characters = 44 Base64 characters |
| Block size | 512 bits (64 bytes) |
| Internal state and rounds | Eight 32-bit words, 64 rounds per block |
| Maximum message length | Less than 264 bits |
| Construction | Merkle–Damgård with a Davies–Meyer compression function |
| Collision resistance | About 2128 operations (birthday bound) |
| Preimage resistance | About 2256 operations |
| Length extension | Affected: use HMAC for keyed hashing |
// OTHER LANGUAGES
References
How we make sure
We check this tool with the automated test suites linked below. Example checks are shown in their original language.
- Verification method
- Unit tests run the same hashing module the page loads (the @noble/hashes SHA-256 implementation plus this tool's input decoding, chunked file reading, output formatting and checksum-list parsing). They compare its digests with the published SHA-256 example messages and with a second, independent implementation for identical bytes: empty input, Unicode text, message lengths on both sides of the 55/56-byte and 63/64/65-byte padding boundaries, hex and Base64 input, double hashing, and data read in chunks whose total size falls just below, exactly on and just above a chunk boundary.
- Comparison reference
- Standard vectors: the SHA-256 example messages published with FIPS 180-4 and in RFC 6234 ("abc", the 448-bit two-block message, one million "a"). Independent implementation: Node.js crypto (OpenSSL), which shares no code with the JavaScript implementation used on the page.
- Verification scope
- These samples and boundaries do not prove correctness for every input. The tests run in Node.js: the browser worker that reads files, the progress display and drag-and-drop are not covered by automated tests, and files larger than the test fixtures (a few megabytes) are not hashed in the test suite.
Test source and cases (select a file to read it)
-
sha256-hash.test.js
- SHA-256 digest: FIPS 180-4 example messages and the one-million-a vector
- SHA-256 digest: text bytes agree with Node crypto across UTF-8 and padding boundaries
- SHA-256 double hash: two rounds agree with Node crypto and the published hello vector
- SHA-256 file hashing: chunked blobs agree with Node crypto at every chunk boundary
- SHA-256 input encodings: hex and Base64 input hash the decoded bytes, invalid input is rejected
- SHA-256 output formats: hex, uppercase hex, Base64 and Base64URL render the same 32 bytes
- SHA-256 checksum parsing: bare, prefixed, spaced, Base64, GNU and BSD checksum lines
- SHA-256 verification: digests match by value, and by file name when the list names files
These checks cover the listed examples and boundaries, not every possible input. Round trips and checks using the same library are not independent verification.