SHA256 Hash Generator

Calculate SHA-256 hashes instantly online. Supports UTF-8, UTF-16, Hex, and Base64 input encodings. Enable HMAC-SHA256 for JWT signing, webhook verification, and API authentication codes.

Input
Output
Share Link
Settings

Related Hash Tools

Frequently Asked Questions

What is SHA-256?
SHA-256 is a member of the SHA-2 family, producing a 256-bit (64 hex character) digest. It was designed by the NSA and standardized by NIST in 2001. It is currently the most widely used hash algorithm for certificates, blockchain, and software distribution.
How many characters is a SHA-256 hash?
A SHA-256 hash is 256 bits long, displayed as 64 hexadecimal characters (e.g., e3b0c44298fc1c149afb...). In Base64 format, the same digest is 44 characters.
SHA-256 vs SHA-512 — which should I choose?
SHA-256 is optimized for 32-bit systems and is the default in TLS, code signing, and most protocols. SHA-512 is faster on 64-bit systems and offers a larger digest. For most applications SHA-256 is the right choice; SHA-512 is preferred for high-security storage like password hashing helpers and certificate chains.
What is HMAC-SHA256 used for?
HMAC-SHA256 is used to authenticate messages using a shared secret. Common uses: JWT (JSON Web Token) HS256 signatures, AWS SigV4 request signing, GitHub webhook payload verification, and TOTP/HOTP one-time passwords (RFC 6238/4226).
Is SHA-256 used in Bitcoin?
Yes. Bitcoin uses Double-SHA256 (SHA256 applied twice) to hash block headers and transaction IDs. The Proof-of-Work mining algorithm also hashes block headers with Double-SHA256, searching for outputs beginning with a required number of zero bits.

About SHA256 Hash Generator

SHA-256 (Secure Hash Algorithm 256) is a cryptographic hash function from the SHA-2 family, published by NIST as FIPS 180-4. It produces a 256-bit (32-byte) digest from input of any length, displayed as a 64-character hexadecimal string. SHA-256 is the most widely deployed hash algorithm in the world, underpinning TLS certificates, code signing, software package verification, blockchain networks, and modern authentication protocols.

How SHA-256 Works

SHA-256 pads the input to a multiple of 512 bits and processes it in 512-bit blocks. Each block goes through 64 rounds of bitwise operations using eight 32-bit state variables (A through H) and a schedule of 64 derived message words. The constants used are derived from the fractional parts of cube roots of the first 64 prime numbers, ensuring no hidden structure. The final eight state values are concatenated to form the 256-bit output.

SHA-256 in TLS and Web Security

Every HTTPS connection negotiated today uses SHA-256 in certificate signature verification and the TLS handshake's Finished message. All major Certificate Authorities have issued SHA-256 certificates since 2016, replacing the deprecated SHA-1. When you see a padlock in your browser, SHA-256 is part of what makes that connection trustworthy.

HMAC-SHA256

HMAC-SHA256 adds a secret key to the hashing process, producing a keyed message authentication code. It is the standard algorithm for JWT HS256 tokens (used by Auth0, Firebase, and most REST APIs), AWS Signature Version 4 request signing, GitHub webhook payload authentication, and RFC 6238 TOTP one-time passwords. Enable the HMAC option above and enter your secret key to compute HMAC-SHA256.

SHA-256 in Blockchain

Bitcoin and many derived cryptocurrencies apply SHA-256 twice (Double SHA-256) to transaction IDs and block headers. Proof-of-Work mining consists of repeatedly hashing a block header (varying the nonce field) until the output begins with a required number of zero bits. This requires an enormous number of hash computations, making the ledger tamper-resistant.

SHA-256 vs SHA-1 and MD5

SHA-256 produces a 256-bit digest compared to SHA-1's 160 bits and MD5's 128 bits. Unlike SHA-1 (which was broken by SHAttered in 2017) and MD5 (broken since 1996), no practical collision attacks exist against SHA-256. It is NIST-approved for use in federal systems through 2030 and beyond under the SHA-2 standard.