SHA-256 Hash Generator
Compute the SHA-256 hash of any text or file and check it against a published checksum, without uploading anything.
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.
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
| System | Command |
|---|---|
| Linux | sha256sum file.iso |
| macOS | shasum -a 256 file.iso |
| Windows PowerShell | Get-FileHash file.iso (SHA-256 is the default) |
| Windows cmd | certutil -hashfile file.iso SHA256 |
| OpenSSL | openssl 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.