SHA-1 / SHA-256 / SHA-512 Generator
Generate SHA-1, SHA-256, SHA-384 and SHA-512 hashes from any text — all four at once, computed by the browser's native Web Crypto API.
SHA-2 is the family of hash functions that replaced MD5 and SHA-1 for anything that matters. SHA-256 in particular is the current default for file integrity, digital signatures, certificate fingerprints, API request signing and blockchain.
Paste any text and get all four digests at once, computed by your browser's native Web Crypto API — the same implementation the browser uses for TLS, not a JavaScript approximation of it.
Which SHA should I use?
- SHA-256 — industry default. Used by Bitcoin, TLS, JWT signatures.
- SHA-512 — same security level as SHA-256 but faster on 64-bit systems for large data.
- SHA-1 — deprecated for security (broken by chosen-prefix attacks). Still useful for integrity checks / non-security purposes.
- Never use plain SHA for storing passwords — use bcrypt/argon2 (SHA is too fast, easy to brute-force).
How to use the SHA Hash Generator
-
Enter your text
Any length, any language. Input is encoded as UTF-8 before hashing, which is what every other correct implementation does — so your results will match server-side tools.
-
Pick the digest you need
All four are computed simultaneously. SHA-256 is the right default for almost everything.
-
Copy and compare
When verifying a download or a certificate fingerprint, compare against the published value character by character. Case does not matter, but every character does.
-
Watch for whitespace
A trailing newline or space produces a completely different digest. If a comparison fails unexpectedly, check for invisible characters before anything else.
What this tool does
Which one should you use?
| Algorithm | Output | Status | Use it for |
|---|---|---|---|
| SHA-1 | 160 bits, 40 hex | Broken (2017) | Legacy compatibility only — Git object IDs, old APIs |
| SHA-256 | 256 bits, 64 hex | Secure | The default for everything |
| SHA-384 | 384 bits, 96 hex | Secure | Where a specification requires it, e.g. some TLS suites |
| SHA-512 | 512 bits, 128 hex | Secure | Long-term archival, 64-bit-optimised systems |
The short answer: use SHA-256 unless something explicitly tells you otherwise. It is the industry default, universally supported, and there is no practical attack against it.
A common misconception is that SHA-512 is meaningfully "more secure" for everyday use. It is not, in any way you will notice — SHA-256 already has a security margin far beyond current and foreseeable computing power. SHA-512 is often faster on 64-bit hardware because of how it is structured, which is a better reason to choose it than perceived strength.
SHA-1 is no longer usable for security
In 2017, Google and CWI Amsterdam published SHAttered, the first practical SHA-1 collision — two different PDF files with the same SHA-1 hash. In 2020 a chosen-prefix collision attack brought the cost down further. Browsers stopped trusting SHA-1 TLS certificates years ago.
SHA-1 survives in places where it acts as an identifier rather than a security guarantee. Git uses it for object IDs, and has been migrating slowly. Some older APIs still specify SHA-1 HMAC signatures. Where you must interoperate, you must — but never choose SHA-1 for anything new.
Real uses for SHA-256
File and download integrity
Publishers list a SHA-256 checksum alongside downloads. Hash the file you received and compare. Unlike MD5, a matching SHA-256 is meaningful even against deliberate tampering.
API request signing
Most modern payment gateways and platform APIs — Razorpay, Stripe, AWS — sign requests and webhooks with HMAC-SHA256. The recipient recomputes the signature using a shared secret and compares. That is how you know a webhook genuinely came from the provider and was not forged.
Important detail: HMAC-SHA256 is not the same as hashing the secret and the message concatenated together. HMAC is a specific construction that protects against length-extension attacks, which plain concatenation does not. Use your language's HMAC function — hash_hmac('sha256', $payload, $secret) in PHP — rather than rolling your own.
And always compare signatures with a timing-safe function, hash_equals() in PHP, not ==. A normal string comparison returns early on the first differing character, which leaks information about the correct value over many attempts.
Certificate fingerprints
TLS certificates are identified by their SHA-256 fingerprint. Certificate pinning in mobile apps compares against a known fingerprint to detect interception.
Content addressing
Deduplication systems, content-addressable storage and blockchain all use SHA-256 to derive an identifier from content itself, so identical data always resolves to the same address.
Subresource integrity
When loading a script from a CDN, an SRI hash lets the browser verify the file has not been altered:
<script src="https://cdn.example.com/lib.js"
integrity="sha384-oqVuAfXRKap7fdgcCY5uykM6+R9GqQ8K/uxy9rx7HNQlGYl1kPzQho1wx4JwY8wC"
crossorigin="anonymous"></script>
If the file changes by even one byte, the browser refuses to execute it. Worth adding to any third-party script on a production site.
Still not for passwords
SHA-256 is secure, but it is also fast — and as with MD5, speed is exactly wrong for password storage. A GPU can compute billions of SHA-256 hashes per second, which is why Bitcoin mining hardware exists in the first place.
Password hashing needs to be deliberately slow and memory-hard. Use bcrypt, scrypt or Argon2. In PHP, password_hash($password, PASSWORD_DEFAULT) handles the salt, the algorithm choice and the cost factor for you.
The one exception is PBKDF2-SHA256, which wraps SHA-256 in tens of thousands of iterations to make it slow on purpose. That is acceptable where a standard requires it, though Argon2 is the better modern choice.
Why the Web Crypto API matters
This tool calls crypto.subtle.digest(), the browser's built-in cryptographic implementation, rather than a hand-written JavaScript version of SHA-2.
Two consequences. It is considerably faster, because it runs as native code, so large inputs do not freeze the page. And it is the implementation the browser already trusts for TLS, which means it is heavily reviewed and correct — including the awkward edge cases around padding and multi-byte characters where hand-rolled implementations tend to quietly disagree with everyone else.
When digests do not match
- Encoding. Input here is encoded as UTF-8 before hashing. If your server hashes the same string as ISO-8859-1, the bytes differ and so does the digest.
- Whitespace. A trailing newline is the most common invisible culprit.
- Line endings. CRLF versus LF, especially on files that have crossed platforms through Git.
- Hex case. Some tools output uppercase. The value is the same — compare case-insensitively.
- Base64 versus hex. Many APIs expect the digest base64-encoded, not as hex. Reading the same bytes in the wrong representation produces a mismatch that looks like a hashing error but is not.
Privacy
Everything is computed locally by your browser. Nothing is transmitted, logged or stored — which matters, given that people routinely paste API secrets and webhook payloads into hash tools while debugging a signature mismatch.
Frequently asked questions
Which SHA algorithm should I use?
Is SHA-1 still safe?
Can I use SHA-256 to hash passwords?
What is the difference between SHA-256 and HMAC-SHA256?
Why do my hashes differ from my server output?
Why does this use the Web Crypto API?
How do I compare two signatures safely in code?
Is my input sent anywhere?
Need a custom tool or app built?
From CRMs to admin panels — Vikram builds fast, secure, tailor-made software.
Web Design & Development
Award-winning WordPress, ecommerce & custom sites — from concept to launch.
ExploreSEO & Growth
Technical SEO, content playbooks & local ranking — measurable growth every month.
ExploreSoftware Development
PHP + Laravel + Node.js — custom CRMs, admin panels & APIs. Scale-ready.
Explore
