SHA256 Hash Generator
HG-03Paste text to get its SHA-256 hash as 64 hex characters or as Base64. It is a sound general-purpose hash for checksums and fingerprints, though not a password hash on its own.
Runs in your browser. Nothing is uploaded.
Text (hashed as UTF-8)
SHA-256 hash
How to use it
- Type or paste your text into the input box. Sample loads the quick brown fox example.
- The SHA-256 appears as you type. Under Output, pick lowercase hex, uppercase hex or Base64.
- Tick Ignore one trailing line break if your text ends with a newline you did not mean to include.
- Copy the hash, or download it as a .txt file.
What the tool computes
Your text is encoded as UTF-8 and hashed with SHA-256 by your browser's built-in Web Crypto. The output is 256 bits, shown as 64 hex characters or 44 characters of Base64. Every character counts: a trailing space, a line break or a different letter case gives a completely different hash. Empty input is valid and gives e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. The tool hashes text, not binary files.
Where SHA-256 fits
SHA-256 is part of the SHA-2 family and has no known practical collision attack, so it is the usual choice for file checksums, content fingerprints, cache keys and many signature schemes. It is not meant to store passwords by itself, because it is fast and so lets an attacker test guesses quickly. Passwords need a slow, salted function such as bcrypt, scrypt or Argon2. If you need a keyed hash to prove a message came from someone, use the HMAC Generator instead.
Matching a hash from another tool
If your result differs from sha256sum, openssl or a library call, the input bytes differ. Look for a trailing newline added by echo, Windows line endings, a byte order mark at the start of a file, or text saved in an encoding other than UTF-8. Ignore one trailing line break removes a single final line break here. Output case never changes the value, since hex in either case is the same bytes.
Questions people ask
How do I generate a SHA-256 hash online?
Type or paste your text into the input box and the SHA-256 appears straight away as 64 hex characters. Choose uppercase hex or Base64 if you need a different format, then copy it or download it as a .txt file. The hash is computed in your browser.
What is the SHA-256 hash of an empty string?
It is e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. Clear the input box and this tool shows it, because empty text is valid input. It is a useful check that a tool is hashing the raw bytes and nothing extra.
Is SHA-256 secure?
Yes for checksums, fingerprints and signatures, as far as anyone has shown: no practical way to find two inputs with the same SHA-256 is known. It is not a good way to store passwords by itself, because it is fast. Use bcrypt, scrypt or Argon2 for that.
Why does my SHA-256 not match sha256sum?
The two tools hashed different bytes. The common causes are a newline added by echo, Windows CRLF line endings, a hidden byte order mark, or a non-UTF-8 encoding. Use echo -n on the command line, or tick Ignore one trailing line break here, and compare again.
How long is a SHA-256 hash?
A SHA-256 hash is 256 bits, or 32 bytes. In hex it is always 64 characters, and in Base64 it is 44 characters ending in one = sign. The length is the same for any input, short or long.
What is the difference between SHA-256 and HMAC-SHA-256?
SHA-256 hashes a message on its own, so anyone can recompute it. HMAC-SHA-256 mixes in a secret key, so only someone holding the key can produce or check the value. Use plain SHA-256 for fingerprints and HMAC when a message needs to be authenticated.
About this tool
SHA-256 is computed by your browser's built-in Web Crypto. It is a sound general-purpose hash for checksums and fingerprints. It is too fast to use alone for storing passwords: that needs a slow, salted function such as bcrypt, scrypt or Argon2, which this tool is not. The text is hashed exactly as typed, as UTF-8, so a trailing line break or a space changes the result; "Ignore one trailing line break" removes one. It hashes text, not files: a file saved with different line endings would give a different hash than the same words typed here.