SHA-256 Generator
Generate SHA-256 hashes online — text, files and HMAC-SHA256 for API signing. Output in hex, Base64 or uppercase. Paste an expected hash to verify and compare instantly. All algorithms available: MD5, SHA-1, SHA-256, SHA-384, SHA-512. 100% client-side — nothing sent to any server.
Enter a known hash above — matching algorithm will show Match.
Enter a secret key above to compute HMAC — used for API signatures, webhooks (GitHub, Stripe) and message authentication.
Related Tools
Frequently Asked Questions
What is SHA-256 and what is it used for?▾
SHA-256 (Secure Hash Algorithm 256-bit) is a cryptographic hash function that produces a fixed 256-bit (32-byte) output, represented as 64 hexadecimal characters. It belongs to the SHA-2 family, designed by the NSA and published by NIST in 2001.
Common uses: verifying file integrity (checksums for software downloads), digital signatures (TLS/SSL certificates, code signing), HMAC for API authentication (GitHub webhooks, Stripe, AWS Signature v4), blockchain (Bitcoin uses SHA-256 for proof-of-work), and password hashing with a proper algorithm like PBKDF2 or bcrypt that uses SHA-256 internally.
Can SHA-256 be decrypted or reversed?▾
No — SHA-256 is a one-way function, not encryption. There is no algorithm that can compute the original input from a SHA-256 hash. This is a mathematical property, not a limitation of current computing power.
What you may have seen advertised as 'SHA-256 decryptors' are rainbow table lookups — precomputed databases of hash → input pairs for common strings and passwords. They only work if the original input is short, common, or previously seen. A SHA-256 hash of a strong unique string cannot be reversed by any known method.
Is SHA-256 safe for hashing passwords?▾
Not on its own. SHA-256 is extremely fast — a modern GPU can compute billions of SHA-256 hashes per second, making brute-force attacks feasible against unsalted or weakly salted hashes.
For password storage, use a purpose-built slow hashing algorithm: bcrypt, scrypt, Argon2 (recommended by OWASP), or PBKDF2-SHA256 with a high iteration count. These are designed to be slow and memory-intensive, making GPU attacks impractical.
SHA-256 is appropriate for checksums and message authentication — not for storing user passwords.
What is the difference between SHA-256 and HMAC-SHA256?▾
SHA-256 hashes data with no secret — anyone can compute the same hash for the same input. This makes it useful for integrity checks but not for authentication.
HMAC-SHA256 (Hash-based Message Authentication Code) combines SHA-256 with a secret key. The output proves both that the message has not been tampered with AND that the sender knows the secret key. This is why APIs like GitHub webhooks, Stripe, and AWS use HMAC-SHA256 for request signing — it authenticates the source, not just the content.
SHA-256 vs SHA-512 — which should I use?▾
SHA-256 outputs 64 hex characters (256 bits). SHA-512 outputs 128 hex characters (512 bits) and is theoretically more resistant to brute-force, but for most applications both are computationally infeasible to break.
SHA-512 is faster on 64-bit processors for large data. SHA-256 is faster on 32-bit processors and constrained hardware. For TLS certificates, code signing, and API authentication, SHA-256 is the current standard and widely supported. SHA-512 is overkill for most use cases — choose SHA-256 unless you have a specific reason to use SHA-512.
Why does SHA-256 return 64 characters in some tools and 44 in others?▾
The hash itself is always 256 bits, but the encoding differs:
— Hex encoding: 64 lowercase characters (e.g. a665a45920422f9d417e4867efdc4fb8) — Base64 encoding: 44 characters ending in = (e.g. pmWkWSBCL51Bfkhn79treu3afyga=) — UPPERCASE hex: same 64 characters in uppercase
Our tool lets you switch between all three formats. When comparing hashes, always ensure both sides use the same encoding.
How do I generate a SHA-256 hash in JavaScript, Python, and the terminal?▾
JavaScript (browser, using SubtleCrypto): const hash = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(text)); const hex = Array.from(new Uint8Array(hash)).map(b => b.toString(16).padStart(2,'0')).join('');
JavaScript (Node.js): const { createHash } = require('crypto'); const hex = createHash('sha256').update(text).digest('hex');
Python: import hashlib hex = hashlib.sha256(text.encode()).hexdigest()
Terminal (macOS): echo -n 'text' | shasum -a 256 Terminal (Linux): echo -n 'text' | sha256sum