Generate a SHA-256 hash of text or a file, in hex or Base64
Compute the SHA-256 of text or a file, for example to check a download against its published checksum.
How to use it
Paste text, or open the file you downloaded. Paste the publisher's checksum under the list: it says whether the SHA-256 matches. Switch to Base64 if you need the value for Subresource Integrity or an API signature.
Example
Empty input
Input
(nothing)
Result
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
If you see this hash for a file, the file is empty.
Verifying a download
macOS / Linux: shasum -a 256 file.iso Windows: certutil -hashfile file.iso SHA256
SHA-256 in code
import { createHash } from 'node:crypto';
createHash('sha256').update('hello', 'utf8').digest('hex');
// '2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824'Questions
- Is my text or file uploaded?
No. Everything runs in your browser, so your data stays on your device. Nothing you paste is uploaded unless you share it. SHA-1 and SHA-2 come from your browser’s Web Crypto API, the others from open-source code loaded with the page (the SHA-3, BLAKE and RIPEMD families from the audited @noble/hashes), which matters when you hash passwords or keys. - Can I use these hashes to store passwords?
No. MD5 and SHA are fast by design, which makes password guessing fast too. Store passwords with a slow, salted algorithm such as Argon2id, scrypt or bcrypt. - Why is my SHA-256 different from the one in my terminal?
The bytes differ, almost always: echo adds a newline at the end (printf or echo -n don’t), Windows line endings add a carriage return, or the text isn’t UTF-8. The same bytes give the same SHA-256 everywhere; an empty input gives e3b0c442…b855.