SHA-1 Hash Generator
SHA-1 Hash Generator — Free Online Tool
Generate a 160-bit SHA-1 digest, and see why the SHAttered collision ended SHA-1 for anything that matters. Enter your text below and press SHA-1.
SHA-1 Hash Generator
Generate a 160-bit SHA-1 digest, and see why the SHAttered collision ended SHA-1 for anything that matters.
What SHA-1 Is
SHA-1 produces a 160-bit digest, written as 40 hexadecimal characters. It was published by NIST in 1995 as a corrected version of the withdrawn SHA-0, and for roughly fifteen years it was the standard hash behind TLS certificates, code signing and Git object identifiers.
| Algorithm | SHA-1 (SHA-1 family) |
|---|---|
| Digest length | 160 bits — 40 hexadecimal characters |
| Block size | 512 bits |
| Designed by | the NSA, published by NIST, 1995 |
| Specification | FIPS 180-1 |
| Status in 2026 | Broken - collision demonstrated |
A worked example
Hashing the five characters hello with SHA-1 gives:
Change a single character of the input and the entire digest changes, with no resemblance to the previous one. That property is called the avalanche effect, and every cryptographic hash is designed to have it.
How SHA-1 Got Here
Theoretical weaknesses were published from 2005 onward, when Wang, Yin and Yu showed that a collision could be found in far fewer operations than brute force. Browsers and certificate authorities began a managed retirement, and by January 2017 the major browsers rejected SHA-1 certificates outright. The following month Google and CWI Amsterdam published SHAttered, the first practical SHA-1 collision: two PDF files with different content and identical digests, at a cost of about 6,500 CPU-years and 100 GPU-years of computation. In 2020 Leurent and Peyrin published a chosen-prefix collision - a far more dangerous variant - for around $45,000 of cloud compute, and used it to forge PGP web-of-trust signatures.
Security Status of SHA-1
SHA-1 is broken against collisions, and chosen-prefix collisions are within reach of a well-funded attacker. Preimage resistance is still intact, so SHA-1 is not trivially reversible, but no new system should use it and no trust decision should depend on it. Git still uses SHA-1 for object naming, which is why the project has been migrating toward SHA-256 - though Git also applies collision detection to mitigate the practical risk.
Use SHA-1 for
- Reading or verifying legacy data that was already hashed with SHA-1 and cannot be re-hashed.
- Non-adversarial integrity checks inside a closed system, where MD5 would also do.
- HMAC-SHA1 in existing protocols - HMAC constructions do not rely on collision resistance, so HMAC-SHA1 has not been broken, though SHA-256 is the better choice for anything new.
Do not use SHA-1 for
- TLS certificates or any part of a certificate chain - browsers reject them.
- Code signing, software update verification, or package integrity against tampering.
- Digital signatures and document signing.
- Password storage, for the same speed reason that rules out MD5.
How to Use This SHA-1 Generator
- Paste or type your text into the input box above, or upload a plain-text file.
- Press the SHA-1 button.
- The digest appears in the output box, ready to copy.
The same input always produces the same output@if($algo['status'] === 'password') — except with bcrypt, where the random salt makes every result different@endif, on this page or in any correct implementation. If a digest from another tool disagrees with this one, the cause is almost always a difference in the input: a trailing newline, a different character encoding, or invisible whitespace.
Frequently Asked Questions About SHA-1
What was the SHAttered attack?
In February 2017 researchers at Google and CWI Amsterdam published two different PDF files that produced the same SHA-1 digest. It was the first demonstrated full SHA-1 collision, and it cost roughly nine quintillion computations - expensive, but decisively cheaper than the brute-force cost the algorithm was supposed to guarantee. It ended any remaining argument for SHA-1 in security contexts.
Is SHA-1 the same as SHA-2 or SHA-256?
No. SHA-1 is a single 160-bit algorithm from 1995. SHA-2 is a family published in 2001 that includes SHA-224, SHA-256, SHA-384 and SHA-512, built on a different and stronger construction. A weakness in SHA-1 does not imply a weakness in SHA-2.
Why does Git still use SHA-1?
Git chose SHA-1 in 2005 for content addressing, not for security, and changing the identifier of every object in every repository in the world is a slow migration. Git now runs a hardened SHA-1 implementation that detects the byte patterns used by known collision attacks and refuses those objects, and SHA-256 repository support has been available since Git 2.29.
How long is a SHA-1 hash?
160 bits, written as 40 hexadecimal characters. That is eight characters longer than MD5 and 24 shorter than SHA-256.
Hashing in One Minute
A hash function takes input of any length and returns a fixed-length digest. Three properties define a cryptographic hash: the same input always yields the same digest, it is infeasible to recover the input from the digest, and it is infeasible to find two inputs that produce the same digest. Hashing is one-way and keyless, which is what separates it from encryption — there is nothing to decrypt, because nothing was encrypted.
Where hashes go wrong is almost always a mismatch between the job and the tool. A checksum for detecting a corrupted download and a password hash protecting a leaked database are different problems, and an algorithm that is excellent at one can be disqualifying at the other. For the full treatment — how the algorithms work internally, salting, HMAC, rainbow tables and the rest — see the complete guide to hash generation.
The Other Algorithms in This Tool
The generator above supports every algorithm below. Each has its own page explaining what it is for.