SHA-1 Hash Generator

Generate the SHA-1 hash of text or a file in your browser, check a SHA-1 checksum, and see why SHA-1 is retired for security.

Digest

What It Does

This tool produces the SHA-1 digest of your text or file: 160 bits, shown as 40 hexadecimal characters. SHA-1 was the internet's standard hash for two decades, and it still identifies every object in a Git repository and signs a long tail of older API requests. Since the 2017 SHAttered collision it is considered broken for security, so the page shows the hash together with an honest note about which jobs it can still do.

When to Use It

  • You are reproducing a SHA-1 value an older API or webhook expects in its signature header.
  • You want to understand how Git names objects, or confirm a blob's ID by hashing its content.
  • A vendor still publishes SHA-1 checksums for its downloads and you need to verify one.
  • You are auditing a codebase and want to see what a stored SHA-1 value was computed from.

Worked Examples

abc

The FIPS 180 test vector: a9993e364706816aba3e25717850c26c9cd0d89d. If your implementation does not produce this, it is wrong.

hello world

Gives 22596363b3de40b06f981fb85d82312e8c0ed511 — what echo hello world | sha1sum prints, because echo adds the newline. Git's object IDs differ again: git hash-object prepends a type-and-length header before hashing.

The quick brown fox jumps over the lazy dog

Gives 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12. Change dog to cog and every character of the digest changes — the avalanche effect.

Features

SHA-1 digest as you type
Hash files as raw bytes without uploading
Hex / HEX / Base64 output
Hash each line separately
Checksum comparison that recognises the wrong algorithm
Warnings for line endings
BOMs and passwords

How to Use

1. Type or paste text, or choose Hash a file to hash a file's raw bytes. 2. Pick the output encoding the value will be compared against — hex is the usual one. 3. To check a published checksum, paste it into the comparison box; the tool tells you whether it matches and, if not, whether it is even the same algorithm.

Common Mistakes

  • Hashing text that is not byte-for-byte what the other side hashed. A trailing newline, Windows line endings or a byte-order mark each produce a completely different SHA-1 value, and none of them are visible.
  • Comparing a hex digest with a Base64 one. They encode the same bytes differently, so they never look alike even when they match — switch the output format before deciding two values disagree.
  • Comparing digests in mixed case and concluding they differ. Hex is case-insensitive; ABCDEF and abcdef are the same value.
  • Using a plain SHA-1 digest where a secret is involved. To prove a message came from someone holding a key, you need HMAC, not hash(secret + message).

Frequently Asked Questions

Everything runs in your browser. Text and files are hashed locally — nothing is uploaded, logged or stored.

Explore related topics

#Hash #Checksum