SHA-256 Generator

Share calculator:
Embed this tool:

Paste or type some text and the tool returns its SHA-256 digest, a 64-character hexadecimal fingerprint. The guide covers how to read it, how to check files, and what SHA-256 is trusted for.

What is SHA-256?

SHA-256 is a cryptographic hash function from the SHA-2 family. The family was designed by the US National Security Agency, first published by NIST in 2001 and standardised in 2002. SHA-256 turns any input, from one character to a multi-gigabyte file, into a fixed 256-bit digest, normally written as 64 hexadecimal characters.

The function works on 512-bit blocks of the padded message. Each block is expanded into sixty-four 32-bit words and mixed into eight 32-bit state registers over sixty-four rounds. The starting values of those registers come from the fractional parts of the square roots of the first eight primes, and the 64 round constants come from the cube roots of the first sixty-four primes. Such constants are easy for anyone to recompute, so they cannot have been tuned to hide a weakness.

The table in the section on small changes, further down, lists the SHA-256 of an empty message and of two short strings, which are handy for checking any implementation.

How to use the SHA-256 generator

  1. Enter your text in the String box.
  2. Press Calculate to see the 64-character hash, and use the copy button beside it.
  3. Compare the value with the one you expected, character for character.

What is hashed. The tool hashes the UTF-8 bytes of the text exactly as you typed it. Nothing is trimmed, normalised or added, and the digest is shown in lower-case hexadecimal. Things that change the result:

  • Case and spacing. Hello and hello hash differently, and so does text with an extra space at the end.
  • Encoding. The text is converted to UTF-8 bytes first. A plain ASCII character is one byte, é is two (c3 a9), 日 is three (e6 97 a5) and an emoji such as 😀 is four (f0 9f 98 80), as in most languages and tools.
  • Line breaks. They are kept as they arrive. A browser text box stores each line break as a single line-feed character (LF, byte 0a), and text pasted with Windows CR LF line endings normally arrives as LF too. The tool does not convert it to anything else, so the digest equals what printf piped into sha256sum gives for the same text. A final line break counts as a byte of its own.
  • Empty input. Nothing is shown for an empty box, although the hash of an empty message is defined (it is in the table further down).
Each row can be reproduced on the command line, for example with printf 'a\nb' | sha256sum.
You typeBytes hashed (hex)SHA-256 digest
hello68 65 6c 6c 6f2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
hello, then Enter68 65 6c 6c 6f 0a5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03
a, Enter, b61 0a 627e18f737311b2dc3b2f269dd78396b0351f14fb66efa879f768cb23181883c78

To get the digest of a file that uses Windows CR LF line endings, hash the file itself with one of the commands in the file-verification section below. This page can only hash text the way a browser text box holds it.

The calculation runs in your browser. A direct link to a result carries your input in its address, so do not share links for passwords, keys or other secrets.

A small change gives a completely different hash

Good hash functions behave as if every output bit depends on every input bit. Change abc to abd and 122 of the 256 digest bits flip, close to the one-half you would expect from random chance. The two digests share no visible pattern:

InputSHA-256
(empty)e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
abcba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
abda52d159f262b2c6ddb724a61840befc36eb30c88877a4030b65cbe86298449c9

That behaviour is what makes a hash good at detecting tampering: you cannot nudge a message towards a chosen digest, and any edit, however small, is obvious.

Verifying a downloaded file

Software vendors often publish the SHA-256 of an installer or disk image so you can confirm that the download is intact and unmodified. This page hashes text you type, so for files use a built-in command:

  • Linux: sha256sum file.iso
  • macOS: shasum -a 256 file.iso
  • Windows PowerShell: Get-FileHash file.iso -Algorithm SHA256
  • Windows command prompt: certutil -hashfile file.iso SHA256

Compare the output with the published value. If a single character differs, the file is not the one the publisher hashed. The check only helps if the published hash itself comes from a trustworthy source, such as the vendor's HTTPS page.

Where SHA-256 is used and how secure it is

SHA-256 is the default general-purpose hash of the modern internet. No practical collision or preimage attack on the full algorithm is known. Its 256-bit output gives collision resistance of about 2128 operations, far beyond anything that can be computed.

  • TLS certificates and code signing rely on SHA-256 signatures.
  • Bitcoin applies SHA-256 twice to hash block headers in proof-of-work and as part of address derivation.
  • Container images and package managers identify content by SHA-256 digests, for example the sha256: ids shown by Docker.
  • Subresource Integrity lets a web page pin a script or stylesheet to its expected SHA-256, SHA-384 or SHA-512 hash.
  • HMAC-SHA-256 signs API requests and tokens, including JSON Web Tokens that use the HS256 algorithm.
  • Git can store repositories with SHA-256 object names instead of SHA-1.

SHA-256 is not suitable for storing passwords, salted or not. It is built to be fast, so attackers can test many billions of guesses per second on a graphics card. Store passwords with a deliberately slow, salted, purpose-built function such as Argon2, scrypt or bcrypt (PBKDF2 with a high iteration count if those are unavailable). For message authentication, use HMAC rather than hashing a secret glued to a message, because the digest of a secret-prefixed message lets an attacker compute the digest of a longer, related message without knowing the secret (a length-extension attack).

Choosing between hash functions

For a new project, SHA-256 is a safe default. The SHA-512 generator produces a longer digest and can be faster on 64-bit processors for large inputs. The SHA1 generator and MD5 generator exist for compatibility with older systems, because both have known collision attacks. When you need a random secret rather than a fingerprint, try the random password generator.

Digest length is easy to recognise: 64 hex characters means 256 bits, which is 32 bytes, or 44 characters if the same bytes are written in Base64.

Frequently asked questions

How many characters is a SHA-256 hash?

64 hexadecimal characters. That is 256 bits, or 32 bytes, and it is the same for every input.

Can SHA-256 be decrypted?

No. SHA-256 is a one-way function, not encryption, so there is nothing to decrypt. Someone can only find an input by guessing candidates and hashing each one, which is practical for short, predictable text but not for long random data.

Is SHA-256 the same as SHA-2?

SHA-256 is one member of the SHA-2 family. The others are SHA-224, SHA-384, SHA-512 and two truncated SHA-512 variants. They share a design but differ in word size, digest length and number of rounds.

Why is my SHA-256 different from another tool's result?

Check for a trailing space or line break, different capitalisation or a different text encoding. This generator hashes the UTF-8 bytes of the text as typed, with a line break as the single LF byte, whereas files saved on Windows often use CR LF.

Can I store passwords as SHA-256 hashes?

No. SHA-256 is fast by design, so attackers can test many billions of guesses per second, and a salt does not change that speed. Use a slow, salted password-hashing function such as Argon2, scrypt or bcrypt.

References

  1. NIST FIPS 180-4, Secure Hash Standard (SHS), 2015
  2. RFC 6234: US Secure Hash Algorithms (SHA and SHA-based HMAC and HKDF)
  3. RFC 2104: HMAC: Keyed-Hashing for Message Authentication

Cite this calculator and page

If you use this page in your work, you can cite it as:

Reeliy Editorial Team. (2026). SHA-256 Generator. Reeliy. https://reeliy.com/calculators/sha256-online-generator“SHA-256 Generator.” Reeliy, 2026, https://reeliy.com/calculators/sha256-online-generator.