What is SHA-256?

SHA-256 is a secure 256-bit cryptographic hash function from the SHA-2 family, widely used for integrity, signatures, and blockchains.

SHA-256 is a cryptographic hash function that produces a 256-bit output, shown as a 64-character hexadecimal string. Part of the SHA-2 family designed by the NSA and published by NIST, it is one of the most widely deployed secure hash functions in the world, trusted for verifying integrity, generating digital signatures, and securing systems like TLS certificates and cryptocurrencies.

Unlike MD5 and SHA-1, SHA-256 has no known practical collision or preimage attacks. Its large output space and robust design make it computationally infeasible to find two inputs with the same hash or to reverse a hash back to its input. This security margin is why it remains the default recommendation for general-purpose cryptographic hashing today.

SHA-256 appears throughout modern infrastructure. It verifies that software downloads and system files have not been tampered with, forms the basis of digital signatures and certificate fingerprints, is the proof-of-work hash behind Bitcoin, and is a component of HMAC-based message authentication and many key-derivation schemes. Its combination of speed and strength suits a broad range of integrity tasks.

One important caveat concerns passwords. SHA-256 is intentionally fast, which is a liability for password storage because attackers can compute billions of guesses per second. Passwords should instead use slow, salted algorithms like bcrypt, scrypt, or Argon2. For everything else - file integrity, signatures, fingerprints - SHA-256 is an excellent, standard choice.

Examples

  • SHA-256 of 'hello' → 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
  • Publishing a file's SHA-256 checksum so users can verify their download
  • The proof-of-work hash securing the Bitcoin blockchain

Common questions

Is SHA-256 secure?
Yes. There are no known practical collision or preimage attacks against SHA-256. It is a current, recommended standard for cryptographic integrity and signatures.
Can I use SHA-256 to store passwords?
It is not ideal alone because it is fast, letting attackers brute-force quickly. Use a slow, salted password hashing algorithm like bcrypt, scrypt, or Argon2 instead.
What is the difference between SHA-256 and SHA-1?
SHA-1 produces a 160-bit hash and is deprecated due to demonstrated collision attacks. SHA-256 produces a 256-bit hash and remains secure, which is why it has replaced SHA-1 in modern systems.

Related tools

Related terms for SHA-256