SHA-256 hash generator
Compare text or file contents using a SHA-256 digest. Choose UTF-8 text or a file up to 20 MB; the input is processed in this browser.
SHA-256 hash generator
Runs on your deviceA digest describes exact bytes
SHA-256 produces a fixed-length digest from an input. A changed letter, an extra space, or a different line ending can change the result completely. Text mode encodes the field as UTF-8 and does not trim it. File mode hashes the bytes of the selected file, not its filename. The same file renamed without changing its contents should therefore produce the same digest.
Use a trusted reference for comparison
A matching digest is useful when you already have a trustworthy expected value. If an attacker can replace both a file and the hash displayed next to it, the two matching values do not establish authenticity. Compare the complete hash from an independent trusted source, and use signed distribution mechanisms when authenticity is important. This page cannot certify that a downloaded program is safe.
Hashing is not encryption or password storage
A hash cannot be decoded to recover the original text in the way that Base64 can, but short or predictable inputs can still be guessed and compared. Plain SHA-256 alone is not a suitable password storage design. The tool is a content-digest utility, not a password database, signature verifier, or malware scanner. Web Crypto needs a secure context such as HTTPS, and the local file limit prevents large in-memory allocations.
Worked examples
| Input | Mode | SHA-256 beginning |
|---|---|---|
| abc | UTF-8 text | ba7816bf8f01cfea… |
| The empty string | UTF-8 text | e3b0c44298fc1c14… |
Good questions.
Does changing a filename change the hash?
No. File mode hashes the file’s contents, not its name.
Why does an extra line break matter?
It changes the bytes being hashed. Copy the exact same text when comparing digests.
Does a matching hash prove a file is safe?
No. It establishes equality to a given expected digest, whose source must itself be trusted.
References & further reading
Updated 5 November 2026 · Methods & corrections