SHA-1 Generator
Generate a 160-bit SHA-1 digest — 40 hexadecimal characters. Still everywhere in Git and older systems; no longer suitable for new security-sensitive work.
{{ textCount }}
{{ textError }}
{{ r.value }}
{{ legacyNames }} {{ legacyNames.indexOf(' and ') === -1 ? 'is' : 'are' }} selected. Practical collisions are public for both, so treat the result as a checksum for spotting accidental corruption — not as evidence that a file is authentic.
Drop files here to hash them
Up to 100 files · any size · read in 4 MB chunks, never uploaded
Files are read, not uploaded. Each one is streamed through the hash function in chunks straight from disk, so a multi-gigabyte image never lands in memory and never leaves your device.
{{ f.error }}
{{ r.value }}
The key never leaves this page. It is not sent to a server, not saved to local storage, and not written into the exported files.
{{ hmacError }}
{{ hmacResult }}
HMAC is not a hash with the key glued on the front. It runs the key through the hash
twice with two different pads, which is what makes it resistant to the length-extension
attacks that break a naïve hash(key + message).
Drop the file you want to check
Hashed in your browser · never uploaded
{{ lengthProblem || vError }}
Hash matches
The {{ vResult.label }} digest of {{ vFile.name }} is identical to the hash you supplied, so this is the file that checksum describes. Letter case and surrounding whitespace were ignored.
Both {{ vResult.computed }}
Hash does not match
This file is not the one that checksum describes. Either the download is incomplete or corrupted, or the file has been altered. Downloading it again is the first thing to try.
Computed {{ vResult.cHead }}{{ vResult.cChar }}{{ vResult.cTail }}
Expected {{ vResult.eHead }}{{ vResult.eChar }}{{ vResult.eTail }}
First difference at character {{ vResult.diffAt + 1 }}.
Paste a hash into both boxes to compare them.
Hashes match
Both are the same {{ cmpResult.len }}-character value, so they identify identical content.
Ignored while comparing: letter case, spaces, line breaks, and any
sha256:-style prefix.
Both {{ cmpResult.a }}
Length {{ cmpResult.len }} — consistent with {{ cmpResult.guess }}.
Hashes are different
These are different lengths — {{ cmpResult.a.length }} and {{ cmpResult.b.length }} characters — so they are digests from two different algorithms, and comparing them tells you nothing about the content.
These two digests differ, so they describe different content.
Hash A {{ cmpResult.aHead }}{{ cmpResult.aChar }}{{ cmpResult.aTail }}
Hash B {{ cmpResult.bHead }}{{ cmpResult.bChar }}{{ cmpResult.bTail }}
First difference at character {{ cmpResult.diffAt + 1 }}.
Text, files and secret keys are hashed in your browser. Nothing you enter is ever uploaded to a server.
About SHA-1
SHA-1 produces 160 bits, written as 40 hexadecimal characters. Published by NIST in 1995, it secured most of the web's certificates for over a decade. It should not be chosen for new security-sensitive work, but it is far from gone.
The 2017 collision
Weaknesses were theorised from 2005, and in 2017 a Google and CWI team produced two different PDF files with the same SHA-1 digest — the SHAttered attack. In 2020 a cheaper chosen-prefix collision followed. Browsers and certificate authorities had already dropped SHA-1 certificates by then. As with MD5, the break is in collision resistance, not in recovering an input from a digest.
Why Git still uses it
Git uses SHA-1 to name objects by their content, not as a security boundary, and it now ships collision detection while migrating toward SHA-256. A commit hash you produced yourself remains a perfectly good identifier — it is only untrusted content from elsewhere that raises questions.
HMAC-SHA1 is a separate question
The collision attacks do not break HMAC-SHA1, which is still widely deployed in request signing, including older AWS APIs and many TOTP implementations. It is safe where it already exists; there is simply no reason to select it for something new.
See also the SHA-256 generator.
Frequently asked questions
What does SHA-1 produce?
160 bits, written as 40 hexadecimal characters.
Why is SHA-1 deprecated?
A practical collision was demonstrated in 2017: two different PDFs with the same SHA-1. Certificate authorities and browsers dropped it years ago. It is not broken in the sense of revealing its input, but it can no longer prove that content is unaltered.
Why does Git still use it?
Git adopted SHA-1 as a content address rather than a security boundary, and has been migrating to SHA-256. In practice a Git object ID you generated yourself is still a perfectly good identifier.
Is SHA-1 better than MD5?
Marginally, and not enough to matter. Both are broken for collision resistance; SHA-1 is merely more expensive to attack. If you have the choice, neither — use SHA-256.
What about HMAC-SHA1?
HMAC-SHA1 is not broken by the SHA-1 collision attacks and is still widely deployed, for instance in older AWS request signing. There is no reason to pick it for new work.