SHA-1 Generator

A SHA1 generator for text: type or paste a string and get its 40-character SHA-1 hash, then compare it with a value you already have.

Hashed in your browser. Your text is not uploaded.

Hashed as UTF-8. A trailing space or line break changes the hash.

Algorithms

How to use the SHA-1 Generator

  1. Enter the text in Text to hash. The SHA-1 row follows each keystroke.
  2. Choose the output format. Hex is what most tools print; Base64 is shorter and shows up in some HTTP headers.
  3. Paste a known hash into Compare with to see Match or No match.
  4. Tick more algorithms if you need several hashes of the same text side by side.

How SHA-1 works

SHA-1 was published by NIST in 1995 in FIPS 180-1. Like MD5 it works on 512-bit blocks, but it keeps five 32-bit words instead of four and runs 80 rounds per block. The result is 160 bits, which is 40 hex characters.

The page uses crypto.subtle.digest('SHA-1', ...), the hashing built into your browser, on the UTF-8 bytes of your text. The text stays on your device.

Examples

InputSHA-1
abca9993e364706816aba3e25717850c26c9cd0d89d
helloaaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
empty textda39a3ee5e6b4b0d3255bfef95601890afd80709

The abc row is the standard test vector from the SHA-1 specification, so it is a quick way to confirm that another SHA-1 tool behaves the same way.

Limitations

  • SHA-1 is no longer safe against attackers. In 2017 Google and CWI Amsterdam published two different PDF files with the same SHA-1 hash. Browsers stopped trusting SHA-1 certificates the same year.
  • Use it to match an existing SHA-1 checksum or identifier. For anything new, pick SHA-256.
  • Files cannot be dropped in. Paste the text content instead, or use sha1sum on the command line for a file.

Frequently asked questions

Is SHA-1 still secure?

Not against collisions. An attacker with enough computing power can make two inputs with the same SHA-1. It still detects accidental damage, so old checksums keep working for that.

Does Git use SHA-1?

Yes. Git names commits and files by SHA-1 by default, and it added a hardened version that detects the known collision attack. Newer Git versions can also create repositories that use SHA-256.

How long is a SHA-1 hash?

160 bits. That is 40 characters in hex or 28 characters in Base64.

Often used together with SHA-1 Generator.

  • MD5 Generator

    MD5 hash of text, with a compare box for an expected checksum.

  • SHA-256 Generator

    SHA-256 hash of text in hex or Base64, compared with a checksum when you paste one.

  • HMAC Generator

    Signs text or files with HMAC-SHA256 and other hashes, and checks signatures.