๐Ÿ› ๏ธ Developer ยท Updated November 21, 2026 ยท 8 min read

SHA-256 Password Hashing: Why Plain SHA-256 Falls Short

password a1b2c3... ๐Ÿ”’

You can hash a password with SHA-256 in a second: type it into GrabCast's Hash Generator and copy the 64-character hex value. You should not store that value as a login credential, because SHA-256 is designed to be fast, and a single modern graphics card can test billions of SHA-256 guesses per second against a leaked database. This guide explains what actually happens when a password meets SHA-256, what salts and peppers fix and what they do not, and which slow algorithms security teams recommend instead, with the parameters OWASP publishes. It also covers the jobs where SHA-256 genuinely belongs in a login system, such as storing reset tokens, so you can use the right tool for each part rather than dropping SHA-256 entirely.

๐Ÿ”’ Try the Hash Generator tool now โ€” freeOpen โ†’
Value changed to password124 with a completely different MD5 e28a09fe9d8ded87ea3a909ffc35cc45 and SHA-256 33631376724e5d54..., the avalanche effect
Change one character and every digest changes completely.
๐Ÿ’ก Why the choice of algorithm decides breach damage

Databases leak. When they do, the storage algorithm decides whether attackers recover most user credentials in an afternoon or almost none in a year. Because people reuse credentials, a weak choice on one site becomes account takeovers on email, banking and shopping sites. Fast digests like SHA-256 make guessing cheap; slow, memory-hard functions make every guess expensive. Regulators and auditors increasingly treat plain or merely salted SHA-256 storage as a finding, and it is also one of the first things a security reviewer checks in a new app.

What SHA-256 does to a password, step by step

SHA-256 turns any input into 256 bits, shown as 64 hex characters. It is deterministic: password123 always becomes ef92b778bafe771e89245b89ecbc08a44a4e166c06659911881f383d4473e94f, on every site and every computer. That property is perfect for file checks and terrible for stored credentials.

Salts, peppers and why they are not enough alone

A salt is a random value, typically 16 bytes, generated per user and stored next to the digest. Hashing salt plus secret defeats precomputed lists and makes identical secrets look different. A pepper is an extra secret key kept outside the database, often applied with HMAC.

What to use instead: Argon2id, bcrypt, scrypt, PBKDF2

The OWASP Password Storage Cheat Sheet lists slow, tunable functions and minimum settings. Choose the first one your platform supports well, then raise the cost until a login takes a fraction of a second on your server.

If you also need to create or test passwords, use the Password Generator for new ones and the Password Breach Checker to see whether an old one has leaked.

Where SHA-256 does belong in a login system

SHA-256 is still the right choice for secrets that are long and random rather than chosen by people. Guessing a 32-byte random token is impossible regardless of digest speed, so a fast function is fine.

Step-by-step

1234
1Open the Hash Generator and type a sample value such as password123 on the Text tab to see its SHA-256, SHA-1 and MD5 digests side by side.
Hash Generator Text tab with the sample value password123 typed into the text box
Type a sample value such as password123 on the Text tab.
2Change one character and note that every digest changes completely, then tick HMAC and add a key to see how a pepper transforms the output.
Value changed to password124 with a completely different MD5 e28a09fe9d8ded87ea3a909ffc35cc45 and SHA-256 33631376724e5d54..., the avalanche effect
Change one character and every digest changes completely.
3In your application, replace any raw SHA-256 storage with Argon2id, bcrypt, scrypt or PBKDF2 using your framework's built-in password API.
4Rehash old SHA-256 records on the next successful login, and use SHA-256 only for random tokens such as reset links and API keys.
HMAC checkbox ticked with the key pepper-2026 entered and the rows relabelled HMAC-MD5, HMAC-SHA-1 and HMAC-SHA-256 with new keyed digests
Tick HMAC and add a key to see how a pepper transforms the output.

Common mistakes to avoid

โš ๏ธStoring SHA-256 of the secret with no salt, which lets attackers reverse common choices with a lookup table in seconds.
โš ๏ธWriting your own salting scheme around SHA-256 instead of calling a vetted library such as password_hash or argon2-cffi.
โš ๏ธKeeping the pepper in the same database as the digests, so a single dump exposes both.
โš ๏ธForgetting bcrypt's 72-byte input limit and assuming a 100-character passphrase is fully protected.

Pro tips

โœ“Benchmark your chosen cost on production hardware; aim for roughly 250 to 500 milliseconds per verification and revisit it every year or two.
โœ“Store the algorithm and parameters with each record, which modern formats like the Argon2 encoded string do automatically, so you can upgrade later.
โœ“Compare digests with a constant-time function to avoid leaking timing information during verification.
โœ“Add rate limiting and multi-factor authentication; even perfect storage does not stop online guessing against the login form.
โœ“When testing with the Hash Generator, use obviously fake values like password123 so screenshots and logs never contain a real secret.

Frequently asked questions

Is SHA-256 secure for passwords?

Not on its own. SHA-256 is cryptographically strong for integrity, but it is fast, which makes brute-force guessing cheap. Use Argon2id, bcrypt, scrypt or PBKDF2, which are designed to be slow and tunable.

Does adding a salt make SHA-256 safe?

It defeats precomputed tables and hides duplicate secrets, which is important, but each guess still costs one fast SHA-256 calculation. A slow key-derivation function is still needed.

Can a SHA-256 value be decrypted?

No. It is a one-way function, not encryption. Attackers recover inputs by guessing and comparing, which is why common and short secrets fall quickly while long random ones do not.

Can I generate a bcrypt or Argon2 value in the Hash Generator?

No. The tool computes MD5, SHA-1, SHA-256, SHA-384, SHA-512, CRC32 and HMAC variants. For bcrypt or Argon2, use your framework's password API or a dedicated library.

How do I migrate existing SHA-256 records?

Wrap them: compute Argon2id or bcrypt over the existing SHA-256 digest for every user immediately, then replace each wrapped value with a direct slow digest the next time that user signs in successfully.

๐Ÿ“Œ Bottom line

SHA-256 is an excellent integrity function and a poor way to store secrets people choose. Salt and pepper help, but only a slow function such as Argon2id or bcrypt makes stolen records expensive to crack. Keep SHA-256 for random tokens and API keys, and use the Hash Generator to learn and test with sample values.

Open the Hash Generator tool โ†’

Related guides

Browse more: all text and developer guides ยท the Hash Generator tool