How to Generate SHA-256, SHA-512 and SHA-1 Hashes in the Browser
Learn how to compute SHA-256, SHA-512 and SHA-1 digests for any text using the Web Crypto API, and when each algorithm is the right choice.
Cryptographic Hash Generator
Introduction
Hashes verify that data has not changed, whether that is a download checksum, a cache key or a stored fingerprint. The Cryptographic Hash Generator computes SHA-256, SHA-512 and SHA-1 digests of any text as you type, using the browser's built-in Web Crypto API. Input text never leaves the page.
Step-by-Step Instructions
- Type or paste the text into the Input Text String box.
- Wait a moment while the three digests recalculate automatically on every change.
- Read the SHA-256 field for the most widely used general-purpose digest.
- Read the SHA-512 field when a longer 128-character digest is required by a spec or API.
- Click Copy next to any algorithm to copy the lowercase hexadecimal hash to the clipboard.
Key Use Cases
- Checksum comparison: Hash a configuration string and compare it with the value recorded in a deployment log.
- Cache keys: Derive a stable SHA-256 key from a request body or query string.
- Legacy verification: Produce a SHA-1 digest to compare against older systems that still publish SHA-1 checksums.
Frequently Asked Questions
Is the text sent to a server to compute the hash?
No. The digests are produced by crypto.subtle.digest in the browser, so the input stays on the device. This makes the tool suitable for hashing values that should not be shared.
Which algorithms are supported, and is MD5 available?
The tool outputs SHA-256, SHA-512 and SHA-1 only. MD5 is not provided because the Web Crypto API does not implement it. SHA-1 is included for compatibility with older checksums but should not be used for new security-sensitive work.
What format is the output?
Each hash is shown as lowercase hexadecimal: 64 characters for SHA-256, 128 for SHA-512 and 40 for SHA-1. The text is encoded as UTF-8 before hashing, and an empty input produces empty fields.