SHA Hash Generator (SHA-1, SHA-256, SHA-512)

Hash text with SHA-1, SHA-256 or SHA-512.

What this SHA hash generator does

This tool creates a SHA-1, SHA-256 or SHA-512 hash of any text you enter. The hash is computed in your browser with the built-in Web Crypto API, and the result is shown as a lowercase hexadecimal string you can copy. Your text is not sent to a server.

It is useful for developers comparing values, testers checking that two inputs are identical, students learning about cryptographic hash functions, and anyone who needs a quick SHA-256 of a string. If you need MD5, ZapTools has a separate MD5 Hash tool.

How to use the hash generator

  1. Type or paste your text into the Text box.
  2. Choose an Algorithm: SHA-256 (the default), SHA-1 or SHA-512.
  3. Click Generate.
  4. Copy the hexadecimal hash with the Copy button.

The text is encoded as UTF-8 before hashing, which matches what most programming languages and command-line tools do with text.

How to read the result

A hash is a fixed-length fingerprint of the input. The length depends only on the algorithm, not on how long your text is:

  • SHA-1 – 160 bits, shown as 40 hex characters.
  • SHA-256 – 256 bits, shown as 64 hex characters.
  • SHA-512 – 512 bits, shown as 128 hex characters.

Examples

  • SHA-256 of "hello": 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
  • SHA-256 of "Hello": 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969
  • SHA-1 of "hello": aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d

Changing a single character (here, a lowercase h to an uppercase H) produces a completely different hash. This "avalanche effect" is what makes hashes useful for detecting changes.

Hash functions in brief

SHA-1 and the SHA-2 family (which includes SHA-256 and SHA-512) are standardised by NIST in FIPS 180-4. A cryptographic hash function is designed to be one-way: it is easy to compute the hash from the input, but not feasible to recover the input from the hash, or to find two different inputs with the same hash.

SHA-1 is no longer considered secure against collisions: practical collision attacks have been demonstrated, and it should not be used for digital signatures or new security designs. It is still found in older systems and for non-security checksums. SHA-256 and SHA-512 are current, widely used choices.

Common use cases

  • Checking that two strings, keys or configuration values are exactly the same without showing them side by side.
  • Generating expected values for unit tests of code that computes hashes.
  • Creating a stable identifier or cache key from a piece of text.
  • Understanding how signatures, checksums and content-addressed storage work.
  • Comparing a published SHA-256 value with one you computed from the same text.

Tips and common mistakes

  • Whitespace counts. A trailing space or line break changes the hash. Command-line echo adds a newline unless you use echo -n or printf, which is a common reason hashes don't match.
  • Case counts. Upper and lower case letters are different bytes, so they produce different hashes.
  • Don't hash passwords with plain SHA for storage. Fast hashes are easy to brute-force. Password storage should use a dedicated, slow password-hashing function such as Argon2, scrypt, bcrypt or PBKDF2 with a unique salt.
  • Hashing is not encryption. You cannot "decrypt" a hash. Sites that claim to reverse hashes simply look up precomputed values for common inputs.
  • This tool hashes text. To verify a downloaded file, hash the file itself with a local tool such as sha256sum (Linux), shasum -a 256 (macOS) or Get-FileHash (Windows PowerShell).

Frequently asked questions

What is SHA-256?

SHA-256 is a member of the SHA-2 family of cryptographic hash functions. It produces a 256-bit value, usually shown as 64 hexadecimal characters.

Can a SHA-256 hash be reversed?

Not by computation. Hash functions are designed to be one-way. Short or common inputs can sometimes be guessed by trying many candidates, which is why secrets should be long and random.

Which is better, SHA-256 or SHA-512?

Both are secure for general use. SHA-512 produces a longer hash. Choose whatever your system, protocol or specification requires.

Is SHA-1 still safe?

Not for security purposes such as signatures, because collisions can be produced in practice. Use SHA-256 or stronger for new work.

Why don't I get the same hash as my code?

Check for hidden whitespace, different letter case, a different text encoding, or output in Base64 instead of hex.

Is my text sent anywhere?

No. Hashing uses your browser's Web Crypto API and runs on your device.

Related tools

  • MD5 Hash – create an MD5 hash for legacy checksums.
  • Password Generator – create strong random passwords.
  • Base64 Encode / Decode – reversible encoding for text data.
  • UUID Generator – create random unique identifiers.
  • JWT Decoder – inspect tokens that are signed with SHA-based algorithms.