Security / Data tool
Hash Generator
Generate SHA-256, SHA-384, or SHA-512 digests from text or a local file using Web Crypto.
Files are read locally. Maximum file size: 20 MB.
Result
Your result will appear here.
How to use Hash Generator
- Enter text or choose a file up to 20 MB.
- Select a SHA algorithm to compute the hexadecimal digest.
Example
hello worldCommon use cases
- Comparing the SHA-256 digest of a downloaded file with the value published on a release page before you run it.
- Creating a content fingerprint for a short text snippet during development, such as a cache key for a generated file.
- Checking whether two long text values are identical by comparing their digests instead of pasting both side by side.
Input and output examples
| Input | Output | Notes |
|---|---|---|
hello | 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824 | SHA-256. The digest is 64 hexadecimal characters. |
Hello | 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969 | SHA-256. One capital letter changes the whole digest. |
Common mistakes to avoid
- A trailing newline changes the result. The text hello and the text hello followed by a line break produce completely different SHA-256 digests.
- Case matters. Hello and hello give different SHA-256 digests, so normalize text before comparing digests.
- A hash is not a password hash. Fast digests let an attacker test many guesses per second. Use a slow password hashing function for passwords.
Technical details
Digests are computed with the SubtleCrypto.digest method of the Web Crypto API. The SHA-256, SHA-384, and SHA-512 algorithms are defined in FIPS 180-4. Text is encoded as UTF-8 before hashing. Files are read in the browser and limited to 20 MB, because the whole input is hashed in memory. MD5 and SHA-1 are not offered.
Frequently asked questions
Can this hash passwords securely?
No. SHA digests are fast by design, so they are not password hashing functions. Use a purpose-built algorithm such as Argon2id, scrypt, or bcrypt on your server.
Is my text or file uploaded?
No. Text and files are hashed in your browser, and the tool code does not send them to a server.
Why does my hash differ from a command-line tool?
The input bytes must match. The text hello and the text hello followed by a newline produce different digests, and text is hashed as UTF-8. A file is hashed byte for byte.
Why are MD5 and SHA-1 missing?
Web Crypto does not provide MD5. This tool offers only SHA-256, SHA-384, and SHA-512, which are the algorithms it was designed for.
Why does the tool say Web Crypto is unavailable?
The SubtleCrypto interface exists only in secure contexts, such as pages served over HTTPS and localhost. Open the page over one of those.
Is a hash the same as encryption?
No. A digest cannot be reversed into the input, but the same input always gives the same digest. That makes it useful for comparing a file with a published checksum.