How to Hash Text with SHA-256
To hash text with SHA-256, paste it into a SHA-256 generator and read the 64-character hexadecimal digest. The same input always produces the same digest, and any change produces a completely different one. Use it for integrity checks and signatures. Do not use it to store passwords — it is far too fast, which is exactly what an attacker cracking a stolen database wants.
SHA-256 Hash Generator
Generate a SHA-256 digest — the modern default.
SHA-256 produces a 256-bit digest, written as 64 hexadecimal characters. It is deterministic, so the same input always gives the same output, and it is one-way, so the input cannot be recovered by computation.
That speed is a feature for checksums and a liability for passwords. A modern GPU computes billions of SHA-256 hashes per second, so a stolen database of SHA-256 password hashes falls quickly. Password storage needs a deliberately slow, salted function such as bcrypt, scrypt or Argon2.
Step by step
-
Paste the exact text
Hashing is byte-exact. A trailing newline, a different line ending or a stray space produces an entirely different digest, which is the usual reason two hashes of "the same" text disagree.
-
Choose the output encoding
Hexadecimal is the conventional form and is what published checksums almost always use. Base64 is more compact and appears in HTTP headers such as Subresource Integrity.
-
Compare against the published value
Paste the expected checksum next to the generated one and compare. Comparing the first and last few characters is not sufficient — a deliberate collision attempt would target exactly that habit.
-
Use HMAC when a secret is involved
To authenticate a message with a shared key, use HMAC-SHA256 rather than hashing the key and message together. A plain hash of secret plus message is vulnerable to a length-extension attack.
-
Use bcrypt for passwords
If the input is a password destined for storage, SHA-256 is the wrong function. Use bcrypt, scrypt or Argon2, which are deliberately slow and salt each hash automatically.
Example
Note how a single character change produces a completely unrelated digest — the avalanche effect.
Input
hello
hello.
SHA-256 (hex)
2cf24dba5fb0a30e26e83b2ac5b9e29e
1b161e5c1fa7425e73043362938b9824
…
5891b5b522d5df086d0ff0b110fbd9d2
1e41b71104f81d92d5e5e2e0f1d19e14
Frequently asked questions
Can a SHA-256 hash be reversed?
Why do two hashes of the same text differ?
Is SHA-256 still considered secure?
Is my input transmitted?
Should I use SHA-256 or SHA-512?
Tools used in this guide
All tools →- SHA-256 Hash Generator Generate a SHA-256 digest — the modern default. In your browser
- Hash Generator Generate MD5, SHA-1, SHA-256 and SHA-512 digests at once. In your browser
- SHA-512 Hash Generator Generate a 512-bit SHA-2 digest. In your browser
- HMAC Generator Sign a message with a secret key using HMAC. In your browser
- Bcrypt Generator and Verifier Create and verify bcrypt password hashes. Server-side
Related guides
All guides →- SHA-256 vs MD5 Why MD5 is broken, what that actually means, and where it is still acceptable.
- SHA-256 vs SHA-512 Both are secure. Which to pick depends on hardware and interoperability, not strength.
- How to Generate a Secure Password Produce a genuinely random password or passphrase, and understand what actually makes one strong.
Last reviewed .