SHA-1 Hash Generator
Generate SHA-1 hashes of text, bytes or files, hash lists line by line and verify files against published SHA-1 checksums.
Tool guide
What this tool does
SHA-1 Hash Generator computes the 160-bit SHA-1 digest from FIPS 180-4 for text, hex or Base64 bytes and files of any size. Large files are streamed with progress, lists can be hashed line by line, and results can be compared with an expected value or exported as a sha1sum checksum file.
SHA-1 produces a 160-bit digest, shown as 40 hex characters. Designed by the NSA and published in 1995, it became the default integrity hash for a generation of software: Git identifies every commit, tree and file by a SHA-1 hash, older package repositories publish SHA-1 checksums, and many APIs still sign requests with HMAC-SHA1. You often need to produce or check a SHA-1 value to work with those systems, even though new designs should choose something stronger.
This tool computes SHA-1 exactly as specified in FIPS 180-4. Text is converted to UTF-8 bytes first, or you can provide raw bytes as hex or Base64. Files are processed in 4 MB chunks, so even very large disk images can be hashed without exhausting memory, with a progress bar and throughput figure. Batch mode hashes each line of a list, the comparison field verifies against a published checksum, and the checksum export uses the format sha1sum -c expects. All work happens locally in your browser.
How to use SHA-1 Hash Generator
- Pick Text or Files as the input source.
- Enter text, or drop the files you want to hash.
- Choose “Input is” Text, Hex bytes or Base64 bytes when hashing raw data.
- Select the Output format and, for lists, switch on “Hash each line separately”.
- Paste an expected value into “Compare with expected hash” to verify.
- Copy the result or download the checksum file.
Tips for better results
- Git does not hash the raw file: it hashes the header “blob <size>” plus a null byte followed by the content, so a plain SHA-1 of a file differs from its Git blob ID.
- The SHA-1 of an empty input is da39a3ee5e6b4b0d3255bfef95601890afd80709, a useful sanity check.
- If your hash differs from a Linux result, check whether echo added a newline; use echo -n to match this tool.
- Base64 output is common in HTTP headers and some APIs, such as WebSocket handshakes.
Common use cases
- Checking a download against a SHA-1 value published by an older project.
- Debugging a WebSocket handshake, whose Sec-WebSocket-Accept header is a Base64 SHA-1.
- Generating test data for software that stores SHA-1 fingerprints.
- Detecting duplicate files in a folder by comparing their hashes.
Common mistakes to avoid
- Choosing SHA-1 for new digital signatures or certificates; browsers stopped trusting SHA-1 certificates in 2017.
- Hashing passwords with SHA-1, which is fast enough for attackers to brute-force; use a slow password hash instead.
- Comparing a hex result with a Base64 value. Pick the same output format as the reference.
Frequently asked questions
Is SHA-1 broken?
Its collision resistance is. In 2017 researchers published two different PDF files with the same SHA-1 (the SHAttered attack), and later work made such collisions cheaper. Finding an input that matches a given hash is still impractical.
Why does Git still use SHA-1?
Git uses a hardened SHA-1 that detects known collision attacks, and newer versions support SHA-256 repositories. Most hosting platforms still use SHA-1 object IDs today.
How long is a SHA-1 hash?
Always 160 bits: 40 hexadecimal characters or 28 Base64 characters including padding, whatever the input size.
Feedback & suggestions
Help us improve SHA-1 Hash Generator. We read every message.