Home › Security Tools › Hash Generator

Hash Generator

Compute SHA-1, SHA-256, SHA-384 and SHA-512 digests of text or a file, as hex or Base64. Runs in your browser.

What do you want to hash?
Output format
SHA-1 (160 bits)
Waiting for input.
SHA-256 (256 bits)
Waiting for input.
SHA-384 (384 bits)
Waiting for input.
SHA-512 (512 bits)
Waiting for input.
Hashes are not for storing passwords. A fast hash like these can be tried against very many guesses, so store passwords with a password hashing function such as bcrypt, scrypt or Argon2. Nothing is sent anywhere: your text and file stay in this browser and are not stored.

How to use

  1. Under What do you want to hash?, choose Text or A file.
  2. For text, type or paste into the box. The digests update as you type. For a file, pick one with the file chooser. It is read into the page in your browser and is not uploaded.
  3. Choose Hex or Base64 under Output format. Tick Upper case hex if the checksum you are comparing against is written in capitals. Changing the format does not hash again.
  4. Press Copy beside the algorithm you need. To verify a download, compare the whole digest with the one the publisher gives, character by character.

Worked example

Type the three letters abc. The tool gives these hex digests:

AlgorithmDigest
SHA-1a9993e364706816aba3e25717850c26c9cd0d89d
SHA-256ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
SHA-512ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f

These match the published test vectors for SHA-1 and SHA-2, which is a good way to check any hashing tool. Switch to Base64 and the SHA-256 digest becomes ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0=, the same 32 bytes written differently.

Now change one letter and type Abc. The SHA-256 digest becomes 06d90109c8cce34ec0c776950465421e176f08b831a938b3c6e76cb7bee8790b, which shares nothing recognisable with the first one. That sensitivity is what makes a hash useful for detecting change.

How it works

SHA-1, SHA-256, SHA-384 and SHA-512 belong to the Secure Hash Standard, FIPS 180-4. Each reads the input in fixed-size blocks, mixes them through many rounds of bitwise operations, and outputs a fixed-length digest of 160, 256, 384 or 512 bits. A good hash is one-way (you cannot recover the input from the digest), and it is collision resistant, meaning it is infeasible to find two different inputs with the same digest.

The page calls the browser's Web Crypto function SubtleCrypto.digest, so the maths is done by the browser's own tested code, not by script on this page. Text is encoded as UTF-8 first, so the same characters give the same bytes on every device. Web Crypto is only available on secure (HTTPS) pages. In a browser without it, the page switches its inputs off and says why.

SHA-1 is broken for collision resistance. In 2017 researchers produced two different PDF files with the same SHA-1 digest (the SHAttered attack), and NIST has planned to retire SHA-1 by 2030. It still appears in old checksums and in Git for historical reasons. Use SHA-256 or stronger for anything new. MD5 is not offered here because it has been broken for far longer.

Common mistakes and edge cases

Frequently asked questions

Which algorithm should I pick?

SHA-256 is the usual choice. SHA-384 and SHA-512 are fine when a system asks for them. Use SHA-1 only to match an existing checksum.

Can a hash be reversed?

Not by calculation. Short or common inputs can still be found by guessing and hashing the candidates, which is why unsalted password hashes are weak.

Is my file uploaded?

No. The browser reads it into memory on your device and hashes it there. Very large files may be slow because the whole file is loaded.

Why does the page ask for a secure connection?

Browsers expose the Web Crypto API only in secure contexts, so it is unavailable on plain HTTP pages.

Is a longer digest always better?

Longer digests give more margin against collision attacks, but SHA-256 is already far beyond any practical attack.

Related tools