SHA-256 Hash Generator — Compute SHA-256 Hashes
The industry-standard hash for verifying file downloads and detecting tampering — a unique 64-character fingerprint.
Hash chaining feeds each digest back in as the next input: H(H(…H(input))). Bitcoin uses double SHA-256 (2). This is not a password KDF — use PBKDF2, bcrypt, or scrypt for passwords.
What is SHA-256 Hash?
SHA-256 is a cryptographic hash function in the SHA-2 family, producing a fixed 256-bit (64-character hex) output from any input. It's the workhorse of modern internet security. For a broader SHA comparison, start with our Hash Generator hub.
Zero-Server Tool Data Guarantee
All hashing happens locally in your browser. Your input is never sent to any server.
How to Use
Enter Your Text
Type or paste the text you want to hash into the input area.
View the Hash
The SHA-256 hash is computed instantly as you type. It is displayed as a 64-character hex string.
Verify a Checksum
Switch to the Verify tab and paste a published checksum — sha256sum-style output works too — to confirm it matches the hash of your input.
Copy the Result
Use the copy button to save the hash to your clipboard.
Common Use Cases
File Integrity Verification
Generate a checksum before and after file transfer to confirm nothing was modified in transit.
Password Storage
Hash passwords before storing them. Always combine with a unique per-user salt and a slow KDF like bcrypt.
Data Deduplication
Hash content to detect duplicate files or records without comparing them byte-by-byte.
Digital Signatures
Hash the document first, then sign the hash — this is faster and more secure than signing raw data.
Implementation Examples
async function sha256(message) {const msgBuffer = new TextEncoder().encode(message);const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer);const hashArray = Array.from(new Uint8Array(hashBuffer));return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');}const hash = await sha256('hello world');// "b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9"
SHA-256 vs SHA-512 vs MD5
| Property | SHA-256 | SHA-512 | MD5 |
|---|---|---|---|
| Output size | 256-bit (64 hex) | 512-bit (128 hex) | 128-bit (32 hex) |
| Security level | 128-bit (unbroken) | 256-bit (unbroken) | Broken (collisions found) |
| Speed (64-bit CPU) | Fast | Faster on 64-bit | Fastest |
| Use for passwords? | No (too fast) | No (too fast) | Never |
| Current recommendation | Recommended | Recommended | Avoid for security |
| NIST approved? | Yes | Yes | Deprecated |
Which SHA-2 Size?
| SHA-2 size | Output | Collision resistance | Best for |
|---|---|---|---|
| SHA-224 | 56 hex | 112-bit | Legacy compatibility, compact checksums on constrained systems |
| SHA-256You're here | 64 hex | 128-bit | General purpose — file integrity, TLS, signatures, blockchain |
| SHA-512 | 128 hex | 256-bit | Maximum security margin, high-assurance certificates |
| SHA-512/256 | 64 hex | 128-bit | SHA-256's size with SHA-512's speed — length-extension resistant |
All SHA-2 sizes use the Merkle-Damgård construction from NIST FIPS 180-4. SHA-224 truncates SHA-256's output, and SHA-512/256 truncates SHA-512's — which is what gives it length-extension resistance.
Production Best Practices & Security
Frequently Asked Questions
On Linux or macOS, run: sha256sum filename. On macOS (alternative): shasum -a 256 filename. On Windows PowerShell, run: Get-FileHash -Algorithm SHA256 filename, or on Command Prompt: certutil -hashfile filename SHA256.
Compare the output character-for-character with the checksum published by the software vendor. A mismatch indicates the file was corrupted during download or tampered with.
For text input, paste into BetterPass's SHA-256 tool. For binary files, always use your OS's built-in tool to avoid encoding issues.