Vaultools
Menu

SHA-256 (Secure Hash Algorithm, 256-bit)

SHA-256 is a cryptographic hash function from the SHA-2 family that turns any input into a fixed 256-bit digest, usually written as 64 hexadecimal characters. The same input always gives the same output, and it is infeasible to work backwards from the digest.

What it does

A hash function reads input of any length and produces a short, fixed-size fingerprint. SHA-256 always outputs 32 bytes:

SHA-256("hello") =
2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

A good cryptographic hash has these properties:

Where it is used

How it compares

AlgorithmDigest sizeStatus
MD5128 bitsBroken for collisions. Fine only for non-security checksums
SHA-1160 bitsPractical collisions demonstrated in 2017. Avoid for security
SHA-256256 bitsCurrent general-purpose choice
SHA-512512 bitsSame family, larger digest, often faster on 64-bit CPUs

SHA-3 is a separate design with a different internal structure, not a stronger SHA-2.

Common pitfalls

Doing it in a browser

The Web Crypto API provides it natively: crypto.subtle.digest('SHA-256', bytes). No library is needed, which is how the generator linked below computes it locally.

References

Ads on this page

Non-personalized ads help keep Vaultools free — Google decides where they appear on the page.

Go Pro to remove them →