About this SHA-1 generator
SHA-1 turns any input into a 160-bit fingerprint, written as 40 hexadecimal characters. It is still everywhere in older systems: Git uses it to name commits and files, many download pages list SHA-1 checksums, and webhook and OAuth 1.0 signatures are built on HMAC-SHA1. Paste the checksum a publisher lists into Expected hash and this tool tells you whether your text or file matches. SHA-1 is no longer collision resistant, so do not use it for new digital signatures or certificates; choose SHA-256 or SHA-512 instead.
How to generate a SHA-1 hash
- Add text or a file. Type or paste text, press an example, or press Hash a file to hash a file’s exact bytes.
- Pick the format. Lowercase hex is the usual format; choose uppercase hex or Base64 if your system expects it. Paste an expected hash to compare.
- Press Generate SHA-1 hash. The hash appears below, with a match or no-match message when you pasted an expected hash.
- Copy the hash. Press Copy hash, or copy it in another format from the list.
Frequently asked questions
How long is a SHA-1 hash?
Always 160 bits: 40 hexadecimal characters, or 28 characters in Base64. The length does not depend on the input, so one letter and a large file produce hashes of the same size.
Is SHA-1 still safe to use?
Not for security. In 2017 researchers produced two different PDF files with the same SHA-1 hash, so attackers can forge signatures. It remains fine for non-security jobs such as spotting duplicate files or reading old Git object names.
What is the SHA-1 hash of an empty input?
It is da39a3ee5e6b4b0d3255bfef95601890afd80709. Leave the box empty and press the button to confirm it; the tool hashes zero bytes.
Why does my SHA-1 differ from Git’s hash?
Git hashes a short header with the object type and size in front of the content, so the SHA-1 of a file’s text alone will not equal the blob ID that Git prints for it.
Why does my hash differ from another tool?
Every byte counts. Text is hashed as UTF-8 with LF line breaks, including spaces and a final line break, so a trailing space or a Windows line break elsewhere changes the hash. Files are hashed byte for byte.