SHA-256 Hash Generator

📄 wiki page | 🕑 Last updated: Sep 13, 2022

A quick and clean online tool to generate a SHA-256 hash from a string.

Enter your input string:

🔨 More Tools

SHA-256 is a part of the set of SHA-2 cryptographic hash functions designed by NSA. Other novel function in SHA-2 family is SHA-512 (there are also truncated versions SHA-224, SHA-384, SHA-512/224, and SHA-512/256).

SHA-2 is based on Merkle–Damgård construction and is considered safe in most applications.

Examples of use in popular programming languages/environments:


sha256sum (part of the coreutils package) and openssl are two commonly used tools for this purpose:

echo -n "Hello" | sha256sum

echo -n "Hello" | openssl sha256

(echo -n omits the new line, otherwise the new line character will be included as an input to the hashing function)


Until recently, there was no native SHA support in browsers, but new SubtleCrypto interface (part of the Web Crypto API) can be used for this purpose:

async function sha1(message) {
    // encode as UTF-8
    const msgBuffer = new TextEncoder().encode(message);                    

    // hash the message
    const hashBuffer = await crypto.subtle.digest('SHA-256', msgBuffer);

    // convert ArrayBuffer to Array
    const hashArray = Array.from(new Uint8Array(hashBuffer));

    // convert bytes to hex string                  
    const hashHex = => b.toString(16).padStart(2, '0')).join('');
    return hashHex;

sha1('Hello').then(res => console.log)

Alternatively, there are many 3rd party libs, like CryptoJS:


Comments and suggestions

You can use this form to submit a suggestion or a comment.

If you find this site useful, please consider supporting it. Supporters also get access to some extras.