Hash text or files with SHA-256, privately
A hash function turns any input, a single word or a file hundreds of megabytes long, into a fingerprint of fixed length. The same input always gives the same fingerprint, and the smallest change gives a completely different one. SHA-256 outputs 256 bits, written as 64 hexadecimal characters; SHA-512 outputs 512 bits, or 128 characters.
This generator shows the SHA-1, SHA-256, SHA-384 and SHA-512 hashes side by side. Everything is computed by your browser's built-in cryptography: the text, the file and the key never leave your device.
How to use it
- Under "Hash", pick "Text" or "A file".
- Type into "Text to hash" and the hashes update as you type. For a file, click "Choose a file" or drop it onto the tool (200 MB max).
- Pick the "Output format": "Lowercase hex", "Uppercase hex" or "Base64".
- To sign a message, tick "HMAC (with a secret key)" and fill in "Secret key".
- Paste the published checksum into "Expected hash (to verify)". The tool answers "Match" or "No match" and highlights the matching row.
Text is encoded as UTF-8, like most programming languages do. A line break counts as one byte.
Known values to test with
| Input | SHA-256 hash |
|---|---|
abc | ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad |
| empty text | e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 |
hello world | b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9 |
Hello world | 64ec88ca00b268e5ba1a35678a1b5316d212f4f366b2477232534a8aeca37f3c |
abc, in Base64 | ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0= |
HMAC, key key, message “The quick brown fox jumps over the lazy dog” | f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8 |
One capital letter is enough to change every character. The SHA-512 hash of abc starts with ddaf35a193617aba and ends with a54ca49f. In Base64, the same SHA-256 of abc takes 44 characters instead of 64.
Checking a downloaded file
Software vendors, open-source projects and public agencies that publish data sets often list a SHA-256 checksum next to each download. Choose the file, paste the published value, and "Match" proves the file arrived intact and unaltered. A line in the hash filename format produced by sha256sum or shasum -a 256 is accepted as is.
SHA-1, SHA-256, SHA-512 and HMAC compared
- SHA-1 (40 characters) should not be used for security: a real collision, two different files with the same hash, was published in 2017. It still catches transfer errors.
- SHA-256 is today's standard for checksums, TLS certificates and code signing.
- SHA-512 gives a hash twice as long; on 64-bit processors without dedicated instructions it is often faster than SHA-256. SHA-384 is a truncated variant of it.
- HMAC mixes a secret key into the calculation, so only someone holding the key can produce or verify the result. That is how APIs sign requests and how webhooks prove where they came from. The last row of the table above shows an example.
A hash is not encryption: there is no key that turns it back into the original. On its own it is also the wrong way to store passwords, because a graphics card can compute billions of SHA-256 hashes per second. Use a slow, salted algorithm designed for the job: bcrypt, scrypt or Argon2.
Frequently asked questions
Can a SHA-256 hash be reversed?
No, not by calculation. Sites that claim to "decrypt" SHA-256 only look the hash up in lists of common words and leaked passwords; a long or random input will not be there.
Why does my hash differ from another tool's?
Almost always the input differs: a trailing space or newline, an encoding other than UTF-8, or an accented letter stored in a different form. Upper or lower case in the hex output changes nothing.
Is my file uploaded?
No. It is read and hashed in your browser's memory, in one block, which is why the limit is 200 MB. Once the page has loaded you can go offline and the tool keeps working.