Skip to the content

Contact usFree tools · No signup · Files stay on your device

Developer Tools

SHA256 Generator: the complete guide to SHA-256 hashes

SHA256 Generator: the complete guide to SHA-256 hashes

A SHA-256 hash is a 64-character fingerprint of some data. Change one letter in the input and the whole fingerprint changes; give the same input twice and you always get the same result. Our free SHA256 Generator calculates it for text or for a file, in your browser, and can also produce an HMAC-SHA256 signature with a secret key. It is made for developers, system administrators, students and anyone who needs to check that a download is exactly what the publisher released.

This guide walks through every control on the page, explains what the numbers mean, and covers the small details that make two hashes of "the same thing" come out different.

What SHA256 Generator does

You give it text or a file, and it shows the SHA-256 hash at the top of a list. Below it, the same input is also hashed with MD5, SHA-1, SHA-384 and SHA-512, so you can pick whichever one a website or an API asks for.

It can:

  • Hash text as you type, with no button to press.
  • Hash a file, reading it in your browser.
  • Show the result as lower-case hex, upper-case HEX or Base64.
  • Create HMAC signatures with a secret key.
  • Compare the result with a checksum you paste in, and tell you whether it matches.

It does not encrypt anything and it cannot decrypt a hash. A hash is a one-way summary, not a locked box. It also does not store passwords for you: for storing passwords you need a slow, salted method such as Argon2, bcrypt or scrypt, not a plain SHA-256.

How to use SHA256 Generator, step by step

  1. Open SHA256 Generator.
  2. Under Input type, choose Text or File.
  3. For text, type or paste into the box labelled "Text (hashed as UTF-8)". For a file, press Choose file and pick it.
  4. Read the SHA-256 row at the top of the Hashes panel. It is highlighted and listed first. Press Copy beside it to copy the value.
  5. Change Output format to hex, HEX or Base64 if you need a different style.
  6. To check a checksum, paste it into "Compare with expected hash (optional)". A green note says "Match" and the matching row gets a "match" label.

For text, the result updates about 0.2 seconds after you stop typing. Under the box, a hint shows the size in bytes, for example "5 bytes · updates as you type".

Every option explained

Input type: Text or File

Text hashes what you type, encoded as UTF-8. That means Bangla, Arabic or emoji are hashed as their UTF-8 bytes, which matches what almost every programming language does by default. File hashes the raw bytes of a file, whatever its type: a PDF, a ZIP, an installer, a photo.

When you pick a file, its name and size appear beside the button, with a Remove button to clear it and "Choose another file" to swap it. While a big file is being read you see a progress bar and a "Hashing… 40%" label.

Output format: hex, HEX or Base64

All three show exactly the same hash, only written differently.

  • hex is lower-case hexadecimal, 64 characters. It is what sha256sum and most download pages print.
  • HEX is the same in capitals. Some Windows tools and documents use it.
  • Base64 is shorter, 44 characters ending in =. APIs and HTTP headers often use it.

For example, the SHA-256 of the word hello is:

Format Value
hex 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
Base64 LPJNul+wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ=

HMAC (with secret key)

Tick this box and the panel title changes to "HMAC results". A "Secret key" field appears, and every row is relabelled, for example HMAC-SHA-256. An HMAC mixes a secret key into the hash, so only someone who knows the key can produce or check it. Many APIs and webhooks use HMAC-SHA256 to prove a request came from the right sender and was not changed on the way.

The "Key is" list tells the tool how to read what you typed: Text (UTF-8) for an ordinary passphrase, or Hex bytes for a key written as hex. A hex key may include spaces, colons or dashes, and may start with 0x. If the key is not valid hex you get "The key contains characters that aren't hexadecimal (0–9, a–f)." or "A hex key needs an even number of digits."

With the key secret as text and the message hello, HMAC-SHA-256 gives 88aab3ede8d3adf94d26ab90d3bafd4a2083070c3bcce9c014ee04a443847c0b. Use that to test your own code: if your program prints something different, check the key encoding and the message bytes first.

Compare with expected hash (optional)

Paste a checksum you were given. Hex is compared without regard to capitals, spaces are ignored, and a leading 0x is allowed. A Base64 value is compared as written, ignoring trailing = signs. The page checks your value against every hash in the list, not just SHA-256, so a match can show up on any row.

If nothing matches, the red note says "No match with any hash of this text" (or "file") and, when your value is 64 hex digits, adds that its length fits SHA-256 and that the input differs. Paste only the hash itself, not a whole line such as hash filename.

What it accepts and its limits

  • Text: any text. It is hashed as UTF-8, with no trimming. A space or line break at the end counts.
  • Files: any type. SHA hashes need the whole file in memory, so they are limited to 500 MB. Above that, the SHA rows show "File is over 500.00 MB — too large for SHA hashing in the browser." The MD5 row still works, because MD5 reads the file in 4 MB pieces.
  • Algorithms listed: MD5, SHA-1, SHA-256, SHA-384 and SHA-512, plus their HMAC versions.
  • Empty input: hashing nothing is valid. With the text box empty the page shows the hash of an empty string, e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855, and says so.

Privacy

SHA256 Generator runs in your browser. Text, files and keys are not uploaded. The SHA family is calculated with the Web Crypto feature built into your browser, and MD5 with code on the page. You can check this on a computer: open the browser's developer tools, go to the Network tab, and watch that hashing a file makes no request. That also makes it reasonable to use with private files and signing secrets, although you should still avoid pasting a live production key into any website you do not need to.

Why two "identical" inputs give different hashes

This is the most common reason people think the tool is wrong.

  • A trailing newline. hello and hello followed by Enter are different inputs. Their SHA-256 values are 2cf24d… and 5891b5…. Many command-line examples add a newline without telling you.
  • Line endings. A text file saved on Windows uses CRLF, on Linux LF. Hash the file with File instead of pasting the text, and you get the real value for that file.
  • Capital letters. Hello and hello are unrelated hashes.
  • Encoding. The tool uses UTF-8. A system that hashes UTF-16 text, which some Windows programs do, will give another result.

When in doubt, hash the file itself rather than text copied from it.

Tips to work faster

  • Use Copy beside the row you need rather than selecting the text by hand.
  • Keep Output format on hex for download checks, and switch to Base64 only when a service asks for it.
  • To test an HMAC implementation, hash a short message such as hello with a simple key first, then move to real data.
  • The page works on a phone as well; on a small screen each value moves under its algorithm name.
  • To hash a very large file, try the command line: sha256sum file on Linux, shasum -a 256 file on macOS, or Get-FileHash file in PowerShell.

Common problems and how to fix them

"File is over 500.00 MB — too large for SHA hashing in the browser."

The browser cannot hold a larger file in memory for SHA hashing. Use a command-line tool, or ask the publisher whether they also give an MD5 value, which this page can calculate for any size.

"No match with any hash of this file"

Check that you pasted only the hash, that you did not copy a filename or a space-separated line with it, and that you are comparing the right algorithm. Then check the file: an interrupted download is the most common cause. Download it again and compare again.

The hash looks right but the match note does not appear

Match needs a result to compare with. For a file, wait until the "Hashing…" label disappears.

An error says the file could not be read

The page shows "The file couldn't be read (it may have been moved or deleted)." Choose the file again.

To use a published checksum, see how to verify a download with its SHA-256 checksum.

Quick checklist

  • Choose File, not Text, for anything that came from a file.
  • Paste only the 64 characters when comparing.
  • Remember that one extra space or newline changes everything.
  • Use HMAC when a secret key is involved, plain hash when it is not.
  • Do not use a plain hash to store passwords.

Frequently asked questions

How long is a SHA-256 hash?
Always 64 hexadecimal characters (256 bits), whatever the size of the input. The hash of one letter and the hash of a 400 MB file are both 64 characters long.
Why does my hash differ from the one in another tool?
Because the input is not byte-for-byte the same. A trailing space or line break, Windows (CRLF) versus Linux (LF) line endings, or a different text encoding all change the hash completely. This tool hashes text as UTF-8 exactly as typed.
What does the HMAC option do?
It switches the page from a plain hash to an HMAC. You enter a secret key, and every result is a keyed hash labelled HMAC-SHA-256 and so on. The same message with a different key gives a different result.
Is there a file size limit?
Yes, for SHA hashes. They need the whole file in memory, so the page limits them to 500 MB and shows a message for larger files. MD5, shown further down the list, has no such limit.
Can I turn a SHA-256 hash back into the original text?
No. Hashing is one-way. The only way to find the input is to guess it and hash the guess, which is why short or common passwords can be cracked and long random ones cannot.
Found this useful? Share it

Tools in this guide

Main tool

SHA256 Generator

Get the SHA-256 hash of any text or file in hex or Base64, sign messages with HMAC-SHA256,.

Open tool

MD5 Generator

Calculate the MD5 hash of text or files of any size and check downloads against a published MD5 checksum — with SHA-1.

Open tool

JWT Decoder

Paste a JSON Web Token to read its header and claims, see whether it's expired, and optionally verify the signature with a secret or public key.

Open tool

Base64 Encoder/Decoder

Convert text or any file to Base64, or decode Base64 back to readable text or the original file.

Open tool

Back to all guides & blog