Skip to content

Hash Generator

Generate SHA-1, SHA-256, SHA-384 and SHA-512 hashes from text or files.

Updated · Examples checked by automated tests

LOCAL WORKSPACENO UPLOAD REQUIRED

Note: MD5 is not offered because the Web Crypto API deliberately excludes it — it has been considered broken for collision resistance since 2004. Use SHA-256 or stronger.

About Hash Generator

A cryptographic hash reduces any input to a fixed-length fingerprint. The same input always yields the same digest, while any change - even one bit - produces a completely different one, which is what makes hashes useful for integrity checks.

This generator uses the browser native crypto implementation, so the digests are computed by the same audited code your browser uses for TLS, and your input never leaves the page.

How Hash Generator works in your browser

Hashing uses the Web Crypto API — crypto.subtle.digest — which is the browser’s own audited implementation of SHA-1, SHA-256, SHA-384 and SHA-512, the same primitive used for TLS. Your text is encoded to UTF-8 bytes, digested, and the resulting buffer is rendered as lowercase hexadecimal.

Web Crypto is only available over HTTPS or on localhost, because a hashing function delivered over a connection an attacker can modify offers no assurance at all. That restriction is enforced by the browser, not by this page.

One thing worth being clear about: a hash is a fingerprint, not encryption. It cannot be reversed, but identical input always produces identical output, so a plain hash of a common password is trivially reversed with a lookup table. For storing passwords you want a deliberately slow, salted algorithm such as bcrypt, scrypt or Argon2 — not any of the functions here.

When to use it

  • Verifying that a downloaded file matches the SHA-256 checksum its publisher listed.
  • Producing a stable cache key or content fingerprint from a string.
  • Checking that two files with different names are byte-for-byte identical.
  • Generating a test digest while developing, without sending the input to an online hashing service that logs it.

Worked examples

Hash a short string

Settings: Text input

Input

abc

Expected output

SHA-1: a9993e364706816aba3e25717850c26c9cd0d89d
SHA-256: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad

These are the standard test vectors for “abc”, so you can use them to check another implementation. The same input always gives the same hash.

See how one character changes everything

Settings: Text input

Input

abd

Expected output

SHA-1: cb4cc28df0fdbe0ecf9d9662e294b118092a5735
SHA-256: a52d159f262b2c6ddb724a61840befc36eb30c88877a4030b65cbe86298449c9

Changing the last letter produces a completely different digest. That property is what makes a hash useful for detecting changed files.

Limits and checks before you use the result

  • SHA-1 is broken for collision resistance. Use SHA-256 or stronger for anything security-related.
  • Text is hashed as UTF-8 exactly as typed, including trailing spaces and line breaks. A copied value with a trailing newline gives a different hash.
  • Do not store passwords as plain SHA hashes; use a slow password hash such as Argon2 or bcrypt on your server.

Frequently asked questions

How do I generate a SHA-256 hash?

Type or paste your text and pick SHA-256. Hashing uses the browser Web Crypto API, so the input never leaves your device.

Can I use this to hash passwords?

No. Use a deliberately slow, salted algorithm such as bcrypt, scrypt or Argon2. A plain SHA or MD5 hash of a common password is trivially reversed with a lookup table.

Why is MD5 not offered?

The Web Crypto API deliberately omits MD5 because it is cryptographically broken. Use SHA-256 for anything that matters.

Is SHA-1 safe to use?

No, not for signatures or security. It is included only for compatibility with legacy systems that still require it.

Can I hash a file?

Yes, drop a file into the tool and its bytes are hashed directly, which is the usual way to verify a download checksum.

Related tools