What Is SHA-256?

Understand how SHA-256 works, why it's considered secure, and where it's used — from TLS certificates to Bitcoin to HMAC API authentication.

5 min read Updated Jun 2026

Quick Answer

SHA-256 is a cryptographic hash function that produces a 64-character hexadecimal digest. It's part of the SHA-2 family, designed by the NSA, and has been the baseline secure hash algorithm for over two decades. Unlike MD5 and SHA-1, it has no known collision attacks.

To generate a SHA-256 hash from text, paste your input into this SHA-256 generator and copy the 64-character result. The same input always produces the same SHA-256 hash.

If you need a SHA-256 hash right now, use the tool directly.

Try the SHA-256 Hash Generator →

What Is SHA-256?

SHA-256 stands for Secure Hash Algorithm 256-bit. It takes any input and produces a fixed 256-bit digest: always 64 hexadecimal characters, always deterministic. Feed it the same input twice and you get the same output. Change one character and roughly half the output bits change.

It's one of six members of the SHA-2 family (SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224, SHA-512/256) designed by the NSA and standardized by NIST in 2001, replacing SHA-1. The design used a Merkle–Damgård construction with a Davies–Meyer compression function, processing data in 512-bit blocks through 64 rounds of operations.

The string "hello" produces 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824. A 5 GB file would still produce a 64-character output: same length, different value.

Why It's Considered Secure

Two properties define a secure hash function: collision resistance and preimage resistance.

Collision resistance means it's computationally infeasible to find two different inputs that produce the same hash. The best published attacks on SHA-256 break 52 of its 64 rounds. The full algorithm remains unbroken.

Preimage resistance means given a hash, you can't work backwards to find any input that produces it. Even with 256 bits, the search space is 2²⁵⁶: a number so large that brute force is effectively impossible.

The avalanche effect reinforces both: a single-bit change to the input produces a completely different hash, so there's no gradient to follow when searching for collisions or preimages. SHA-256 has been scrutinized publicly for over two decades and has no practical attacks.

Real-World Uses

SHA-256 is everywhere in modern software infrastructure:

  • TLS/SSL certificates, Every HTTPS connection uses certificates signed with SHA-256. When your browser checks a certificate's signature, it recomputes the SHA-256 hash of the certificate data and verifies the signature matches.
  • Code signing: Software distribution platforms sign package manifests and binaries with SHA-256 hashes so users can verify they downloaded what was published.
  • Bitcoin proof of work: Mining requires finding a nonce such that SHA-256(SHA-256(block header)) falls below a target value. The double application of SHA-256 is a design choice specific to Bitcoin.
  • File integrity: Linux distributions publish SHA-256 checksums for ISO images. Download the file, compute the hash, and compare: a match confirms the file wasn't corrupted or tampered with in transit.
  • HMAC-SHA256: Keyed-hash message authentication codes using SHA-256 are used in API authentication, JWT signatures, and webhook verification across virtually every major platform.
  • Content-addressable storage: Git's SHA-256 migration, Docker image layers, and package managers like npm and Cargo use SHA-256 to name artifacts by their content.

Common Mistakes