Developer 🔒 Runs in your browser — no data sent to servers

SHA-256 Hash Generator

Compute the SHA-256 hash of any text or file and check it against a published checksum, without uploading anything.

Input Text

Generate SHA-256 Hashes Online

SHA-256 is the everyday workhorse of cryptographic hashing. It turns any input into a 256-bit fingerprint that changes completely if a single bit of the input changes, and no one has found a practical way to produce two inputs with the same hash. Software vendors publish SHA-256 checksums so you can confirm a download is genuine and intact.

This page opens the Hash Generator with SHA-256 highlighted. Text is hashed as UTF-8, and files are read locally with the browser's Web Crypto API; nothing is uploaded.

Diagram: the SHA-256 digests of “hello” and “hello.” are completely different, but both are 64 hex characters long.InputSHA-256 digesthelloSHA-2562cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824hello.SHA-2561589999b0ca6ef8814283026a9f166d51c70a910671c3d44049755f07f2eb910One character addedAlways 64 hex characters (256 bits)
Adding a single full stop changes the whole SHA-256 digest, yet its length never changes. The same input always gives the same digest, which is why a published checksum can prove a download arrived intact.

Common uses

  • Verifying downloads of operating system images, installers and packages.
  • Integrity checks in CI pipelines and lock files.
  • Content addressing, where a file is identified by the hash of its content, as in Docker image digests and Git's newer object format.
  • Signing: TLS certificates and code signatures hash the data with SHA-256 before signing it.

SHA-256 on the command line

SystemCommand
Linuxsha256sum file.iso
macOSshasum -a 256 file.iso
Windows PowerShellGet-FileHash file.iso (SHA-256 is the default)
Windows cmdcertutil -hashfile file.iso SHA256
OpenSSLopenssl dgst -sha256 file.iso

When hashing a string in a shell, use printf '%s' "text" | sha256sum or echo -n; a plain echo adds a newline and gives a different hash from the one shown here.

SHA-256 in code

JavaScript in the browser: crypto.subtle.digest('SHA-256', new TextEncoder().encode(text)). Python: hashlib.sha256(text.encode()).hexdigest(). PHP: hash('sha256', $text). All three return the same hex string for the same UTF-8 input.

Choosing between hash functions

For new work, SHA-256 is the safe default. SHA-512 gives a longer digest and can be faster on 64-bit machines; MD5 is only for legacy checksums. To check a downloaded file step by step, see File Checksum Checker.

Guides