Home › Developer Tools › SHA-256 Hash Generator

SHA-256 Hash Generator

Type text to see its SHA-256 hash instantly, add a secret key for HMAC-SHA256, hash a list line by line, or drop files of any size to get their checksums. Everything runs in your browser and nothing is uploaded.

Last updated:

0 characters · 0 bytes
Advertisement
Advertisement

How to use the SHA-256 Hash Generator

  1. Choose Text or Files. Type or paste text, or drop one or more files onto the box.
  2. Pick the output: lowercase hex (most common), uppercase hex or Base64.
  3. Tick HMAC and enter a secret key if you need a keyed HMAC-SHA256 signature, for example to test a webhook.
  4. Paste an expected hash in the Verify box to check a download or a signature.
  5. Copy the result or press Download to save all hashes in sha256sum format.

SHA-256 test vectors

Official values from FIPS 180-4 and RFC 4231 for checking any SHA-256 or HMAC implementation. Type the input above (without quotes) to compare.

InputResult
SHA-256 of "" (empty)e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
SHA-256 of "abc"ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
Same, as Base64ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0=
SHA-256 of "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"248d6a61d20638b8e5c026930c3e6039a33ce45964ff2167f6ecedd419db06c1
HMAC-SHA256, key "key", message "The quick brown fox jumps over the lazy dog"f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8
HMAC-SHA256, key 0b0b…0b (20 bytes, hex), message "Hi There" (RFC 4231 case 1)b0344c61d8db38535ca8afceaf0bf12b881dc200c9833da726e9376c2e32cff7

How SHA-256 and HMAC work

SHA-256 pads the message to a multiple of 512 bits, appends the message length, then mixes each 512-bit block into eight 32-bit state words over 64 rounds of additions, rotations and bitwise functions. The final state is the 256-bit hash. Because each round depends on all previous ones, a change to a single input bit flips about half of the output bits.

HMAC adds a secret key: HMAC(K, m) = SHA-256((K ⊕ opad) ‖ SHA-256((K ⊕ ipad) ‖ m)), where the key is padded to 64 bytes (or hashed first if it is longer), ipad is the byte 0x36 repeated and opad is 0x5c repeated. This construction stays secure even though plain SHA-256(key ‖ message) would be open to length-extension attacks.

Common uses of SHA-256

  • Download verification: Linux distributions, Node.js, Python and most open-source projects publish SHA256SUMS files. Compare the hash of your download with the published one.
  • Webhook signatures: GitHub sends X-Hub-Signature-256: sha256=<hex HMAC> and Stripe signs timestamp.payload with HMAC-SHA256. Use the HMAC option with the exact raw body to debug a failing check.
  • Subresource Integrity and CSP: sha256- followed by the Base64 hash of a script lets browsers refuse a file that was changed.
  • Content addressing: Docker image digests (sha256:…), Git's SHA-256 object format and many backup tools name data by its hash.

SHA-256 on the command line

TaskCommand
Hash a file (Linux)sha256sum file.iso
Hash a file (macOS)shasum -a 256 file.iso
Hash a file (Windows PowerShell)Get-FileHash file.iso
Hash text without a newlineprintf '%s' 'abc' | sha256sum
HMAC with OpenSSLprintf '%s' 'message' | openssl dgst -sha256 -hmac 'key'
Check a list of checksumssha256sum -c checksums.sha256

Frequently asked questions

What is SHA-256?

SHA-256 is a member of the SHA-2 family of hash functions standardised by NIST in FIPS 180-4. It turns any input into a 256-bit value, usually written as 64 hexadecimal characters. It is used for file checksums, TLS certificates, Git's newer object format, code signing and Bitcoin.

Is SHA-256 secure?

Yes. No practical collision or preimage attack on SHA-256 is known, so it is a sound choice for integrity checks and digital signatures. For storing passwords, though, use a deliberately slow algorithm such as bcrypt, scrypt or Argon2, because SHA-256 is fast enough to test billions of guesses per second on a GPU.

What is HMAC-SHA256?

HMAC combines a secret key with the hash function (RFC 2104) so that only someone who knows the key can create or check the value. Services such as Stripe, GitHub and Slack sign webhooks with HMAC-SHA256, and AWS Signature Version 4 is built on it. Enter the shared secret and the exact request body to reproduce a signature.

Why is my SHA-256 different from another tool?

The hash depends on every byte. This tool hashes text as UTF-8 exactly as typed, including spaces and line breaks. A trailing newline added by echo, Windows CRLF line endings, a different text encoding or a different key format for HMAC will give a different result.

What is the Base64 form of a SHA-256 hash?

It is the same 32 bytes written in Base64 instead of hex, which gives 44 characters ending in '='. Base64 hashes appear in Subresource Integrity attributes, Content-Security-Policy hashes and many API signatures.

How do I check a file's SHA-256 on my computer?

Run sha256sum file on Linux, shasum -a 256 file on macOS, or Get-FileHash file (SHA-256 is the default) in Windows PowerShell. The downloaded checksum list can be verified later with sha256sum -c.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Hash GeneratorGenerate MD5, SHA-1, SHA-256 and SHA-512 hashes of text or files.Base64 Encoder DecoderEncode or decode Base64 text and files, and make data URIs.File Info ViewerCheck file size, type, date and MD5/SHA hashes.Password GeneratorCreate strong passwords and passphrases.API Key GeneratorCreate secure API keys and secrets with prefixes, checksums and SHA-256 hashes for storage.Bcrypt Hash Generator & CheckerCreate bcrypt password hashes and check a password against a hash.CRC32 Checksum CalculatorCalculate CRC-32, CRC-32C, CRC-16 and Adler-32 checksums of text or large files.HMAC GeneratorGenerate and verify HMAC signatures with SHA-256, SHA-512, SHA-1 or MD5.URL Encoder DecoderPercent-encode or decode URLs, query strings and form data.HTML Entity Encoder / DecoderEscape and unescape HTML entities, named or numeric.Binary TranslatorConvert text to binary, hex, octal and back.JWT DecoderDecode JSON Web Tokens, read the claims and expiry, and verify HS256 signatures.Caesar CipherEncode and decode Caesar shift ciphers and crack unknown shifts with a ranked brute force.Vigenère CipherEncrypt and decrypt Vigenère and Autokey ciphers, and crack unknown keys with frequency analysis.Atbash CipherEncode and decode Atbash ciphers (A↔Z, B↔Y) in Latin or Hebrew, with a live letter mapping table.ASCII TableFull ASCII code chart 0–255 in decimal, hex, octal, binary and HTML, with search and copy.Unicode Character LookupFind Unicode characters by name or code point and copy them with UTF-8, HTML and code escapes.Punycode ConverterConvert international domain names, emails and URLs between Unicode and xn-- Punycode, in bulk.JSON Escape / UnescapeEscape text for a JSON string, unescape \n and \" back to text, or stringify a whole object.Binary to HexConvert binary to hex instantly with steps and signed mode.Hex to BinaryConvert hex to binary instantly with steps and signed mode.Binary CalculatorAdd, subtract, multiply, divide, AND, OR, XOR and shift binary numbers with decimal values.Hex CalculatorHexadecimal + − × ÷ and AND, OR, XOR, NOT, shifts with decimal and binary equivalents.Base32 Encoder / DecoderEncode and decode Base32 (RFC 4648), Base32hex, Crockford and z-base-32 from text, hex or files.Base58 Encoder / DecoderEncode and decode Base58 and Base58Check (Bitcoin alphabet) from text or hex, with checksum verification.Unicode Escape / UnescapeConvert text to \uXXXX, \u{...}, \x, &#...; or CSS escapes and decode them back.File Hash CheckerGet MD5, SHA-1, SHA-256 and SHA-512 checksums of files and verify them against a hash.TOTP GeneratorGenerate 2FA one-time codes from a secret key, create otpauth QR codes and verify codes.RSA Key GeneratorGenerate 2048, 3072 or 4096-bit RSA key pairs as PEM, PKCS#1, JWK or OpenSSH, locally.SSL Certificate DecoderDecode PEM SSL/X.509 certificates: subject, issuer, expiry, SANs, key and fingerprints.Text Encryption ToolEncrypt and decrypt text with a password using AES-256-GCM, entirely in your browser.Argon2 Hash GeneratorHash passwords with Argon2id, Argon2i or Argon2d and verify them against an encoded hash.Base64 to PDFDecode a Base64 string to a PDF with preview and download, or encode a PDF to Base64.Bitwise CalculatorCalculate AND, OR, XOR, NOT and bit shifts at 8–64 bits with a bit grid and all bases.CSR GeneratorCreate a certificate signing request (CSR) and private key with SANs, RSA or ECDSA, in your browser.MongoDB ObjectId to TimestampDecode a MongoDB ObjectId to its creation date, or build ObjectIds from dates for range queries.PGP Encrypt / DecryptEncrypt, decrypt, sign and verify PGP messages with your armored keys, entirely offline.PGP Key GeneratorGenerate an OpenPGP key pair (Curve25519, NIST ECC or RSA) with passphrase and expiry, offline.Quoted-Printable Encoder / DecoderEncode or decode quoted-printable email text (MIME) with UTF-8 and 76-character soft line breaks.Self-Signed Certificate GeneratorCreate a self-signed SSL certificate and key for localhost or dev servers, as PEM or PFX.SHA-1 Hash GeneratorSHA-1 and HMAC-SHA1 of text or files in hex or Base64, plus Git blob hashes and verify.SHA-512 Hash GeneratorSHA-512 and SHA-384 hashes of text or files in hex or Base64, HMAC and hash verification.SRI Hash GeneratorCreate Subresource Integrity hashes (sha256/384/512) and ready <script> or <link> tags.String Escape / UnescapeEscape or unescape strings for JavaScript, Java, C#, Python, C, SQL, regex, CSV and shell.UTF-8 Encoder / DecoderConvert text to UTF-8 bytes in hex, decimal, binary, \x or % and decode bytes back to text.UUID Decoder & ValidatorDecode any UUID: version, variant, v1/v6/v7 timestamp and MAC node, plus bulk validation.Base64 to FileDecode Base64 or a data URI to a downloadable file; detects the real file type and previews it.File Encryption ToolEncrypt and decrypt any file with a password using AES-256-GCM, entirely in your browser.Passphrase GeneratorMake strong, memorable diceware passphrases from a 7,776-word list, with entropy in bits.CSR DecoderDecode a PEM certificate signing request: subject, SANs, key size, signature and CA readiness checks.Enigma Machine SimulatorEncrypt and decrypt with a virtual Enigma I, M3 or M4: rotors, rings, plugboard and lampboard.Hex Opacity CalculatorConvert opacity percent to a 2-digit HEX alpha code and full #RRGGBBAA color, with a 0-100% table.Playfair CipherEncrypt and decrypt Playfair ciphers from a keyword, with the 5x5 key square and every digraph step.Pwned Password CheckerCheck if a password appeared in data breaches; only 5 characters of its SHA-1 hash are sent.RSA Encryption ToolEncrypt text with an RSA public key and decrypt it with the private key using RSA-OAEP in your browser.SAML DecoderDecode SAMLRequest and SAMLResponse messages to readable XML, attributes and validity times.SSL Certificate ConverterConvert SSL certificates and keys between PEM, DER, PFX/P12 and P7B in your browser.Checksum CalculatorCompute 8-bit sum, two's complement LRC, XOR/BCC, NMEA, Fletcher and Internet checksums of bytes.PBKDF2 Hash GeneratorDerive PBKDF2 keys from a password, salt and iteration count with SHA-1, SHA-256 or SHA-512.Protobuf DecoderDecode raw Protocol Buffers hex or Base64 without a schema, or add a .proto for field names.XML Escape / UnescapeEscape & < > " ' for XML text and attributes, unescape entities back, or wrap text in CDATA.Binary Search Tree VisualizerInsert, delete and find in BST, AVL and red-black trees with animated rotations and traversals.
See all 65 Encoders, Hashes & Crypto →