Hash Generator (SHA-256)
A cryptographic hash function converts any input of any length into a fixed-size output called a hash or digest. SHA-256, part of the SHA-2 family standardised by NIST, produces a 256-bit (32-byte) output represented as a 64-character hexadecimal string. It has three properties that make it useful in computing: it is deterministic (the same input always gives the same output), it is fast to compute in one direction but computationally infeasible to reverse, and it has the avalanche effect (changing even one character in the input produces an entirely different hash). These properties underpin a wide range of applications: verifying downloaded files have not been corrupted or tampered with, storing password hashes in databases instead of plain text, generating digital signatures, building Merkle trees in blockchain systems, and creating message authentication codes. This tool computes the SHA-256 hash of any text you type, directly in your browser using the SubtleCrypto Web API, part of the modern Web Crypto standard. Because the computation runs locally, nothing you enter is transmitted to any server. The hash updates as you type. The default input "Hello World" produces a specific 64-character hex string you can use to verify the tool is working correctly.
SHA-256 only. Computed in your browser using SubtleCrypto. Nothing is uploaded or stored.
How it works
The input text is encoded to UTF-8 bytes using a TextEncoder. Those bytes are passed to window.crypto.subtle.digest('SHA-256', ...) which returns a Promise resolving to an ArrayBuffer of 32 bytes. The bytes are converted to a lowercase hexadecimal string by iterating over each byte value, calling toString(16), and padding to two characters. The result is always exactly 64 hex characters regardless of input length. Because SubtleCrypto is asynchronous, the hash is computed with a .then() callback and the display updates when the Promise resolves.
Worked example
Input "Hello World" (11 characters). SHA-256 processes the UTF-8 bytes through 64 rounds of bitwise operations and produces the 256-bit digest: a591a6d40bf420404a011733cfb7b190d62c65bf0bcda32b57b277d9ad9f146e. This is always 64 hexadecimal characters (256 bits). This matches the default pre-filled in the calculator above.
Related calculators
- Base64 Encoder/Decoder: encode or decode text using Base64.
- Bitwise Calculator: AND, OR, XOR and NOT operations with binary output.
- Hexadecimal Calculator: arithmetic in hexadecimal with decimal and binary equivalents.
- Wingdings Translator: text to Wingdings and Back.
- Arrow Speed Calculator: Estimate Bow Arrow Speed in FPS.