JustGenerator
Hashing 100% Client-Side Privacy

SHA-256 Hash Generator

Compute 64-character SHA-256 cryptographic checksums for text strings or local files directly in your browser using the native Web Crypto API.

0 chars · 0 bytes

How SHA-256 works on text and files

SHA-256 is defined in NIST FIPS 180-4 as part of the SHA-2 family. It pads your input to a multiple of 512 bits, runs 64 rounds of bitwise mixing over 32-bit words, and outputs a fixed 256-bit digest. Written in hexadecimal, that digest is always 64 characters long whether you hash a single letter or a 1 GB disk image.

This page calls your browser's native crypto.subtle.digest("SHA-256", bytes) implementation. Text strings are first converted with new TextEncoder().encode(text) so the UTF-8 byte sequence matches what Python's hashlib.sha256, Node.js crypto.createHash("sha256"), Go's crypto/sha256, and OpenSSL produce. When you switch to the File Checksum tab, your browser reads the file into an ArrayBuffer locally and hashes it in memory without uploading anything.

Known test vectors to sanity-check your code

When debugging an API signature or a file-integrity script, comparing against two known vectors catches encoding bugs fast:

  • Empty string (0 bytes): e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
  • hello (5 bytes, no trailing newline): 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

If your shell gives you 5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03 for hello, you have a trailing \n byte. That happens every time someone runs echo "hello" | shasum -a 256 instead of printf "hello" | shasum -a 256. Watch the byte counter above the text box on this page: hello should read 5 chars and 5 bytes.

Verifying a downloaded file without terminal flags

Software vendors usually publish a SHA256SUMS file next to their installers. To check a download here, open the File Checksum tab and drop the `.zip`, `.dmg`, `.exe`, or `.iso` file into the dashed box. Then paste the publisher's 64-character string into the comparison field at the bottom of the tool. The badge switches to Exact Match or Mismatch right away, ignoring uppercase versus lowercase differences so you never have to compare 64 characters by eye.

If you prefer the command line for multi-gigabyte ISOs that might strain browser memory, run shasum -a 256 file.iso on macOS, sha256sum file.iso on Linux, or Get-FileHash file.iso -Algorithm SHA256 in Windows PowerShell.

When to use SHA-256, and when to pick something else

Older hashes like MD5 and SHA-1 have known practical collision attacks, meaning someone can craft two different files that share the same digest. SHA-256 has a 2²⁵⁶ output space and no practical collision attack, which is why TLS certificates, Git's newer object format, container image digests, and software package managers rely on it.

There are two situations where SHA-256 is not the best fit. First, if a vendor publishes a 128-character checksum or you want faster hashing on 64-bit servers, use our SHA-512 Hash Generator. Second, never store raw user passwords with plain SHA-256. A single consumer GPU can compute billions of SHA-256 hashes per second against a leaked database. For password storage, use a deliberately slow, salted algorithm like our Bcrypt Hash Generator.

Common questions

Can a SHA-256 hash be reversed or decrypted?

No. SHA-256 is a one-way cryptographic hash function. It maps any input into a fixed 256-bit fingerprint, and there is no mathematical formula to reverse that digest back into the original text or file. Short or common words can only be guessed by hashing candidates and comparing outputs.

How long is a SHA-256 hash?

A SHA-256 digest is always 256 bits (32 bytes) long, regardless of whether you hash a single letter or a 2 GB video file. When written in standard hexadecimal format, it always contains exactly 64 characters using the digits 0 through 9 and letters a through f.

What is the SHA-256 hash of an empty string?

Hashing an empty input with zero bytes always produces e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. Developers frequently use this known value to test that a hashing library or file reader is working properly.

Is SHA-256 still considered secure?

Yes. SHA-256 is part of the NIST-standardized SHA-2 family and remains secure for digital signatures, TLS certificates, software checksums, Git commits, and blockchain verification. No practical collision attack has ever been demonstrated against full SHA-256.

Why does my SHA-256 hash change when I copy text from a terminal or editor?

SHA-256 exhibits the avalanche effect, meaning even one hidden character changes the entire output. A trailing newline (LF or CRLF), an extra space at the end of a line, or a different character encoding (UTF-8 versus UTF-16) will produce a completely different 64-character string.

Should I use plain SHA-256 to hash user passwords?

No. SHA-256 is intentionally fast, which lets attackers test billions of password guesses per second on modern GPUs if a database leaks. For password storage, use a slow, salted memory-hard algorithm such as Argon2id, bcrypt, or scrypt.