SHA1 Generator
Enter any text and the tool returns its SHA-1 digest: a 40-character hexadecimal fingerprint. The guide explains what that value means and why SHA-1 is now a legacy choice.
Related calculators
Created by the Reeliy Editorial Team. Last updated: Oct 19, 2026
What is SHA-1?
SHA-1 (Secure Hash Algorithm 1) is a cryptographic hash function. It reads a message of any length and condenses it into a fixed 160-bit value, usually written as 40 hexadecimal characters. The algorithm was published by the US standards body NIST in 1995 and is defined today in the Secure Hash Standard, FIPS 180-4.
Inside, SHA-1 cuts the padded message into 512-bit blocks, splits each block into sixteen 32-bit words, stretches them to eighty words and runs eighty rounds of bitwise operations and additions over five 32-bit state registers. The five registers, written one after another, are the digest.
These reference values are handy for checking any SHA-1 implementation:
| Input | SHA-1 digest |
|---|---|
| (empty message) | da39a3ee5e6b4b0d3255bfef95601890afd80709 |
| abc | a9993e364706816aba3e25717850c26c9cd0d89d |
| abd | cb4cc28df0fdbe0ecf9d9662e294b118092a5735 |
How to use the SHA1 generator
- Type or paste your text into the String box.
- Press Calculate. The 40-character hash appears in the results table, with a button to copy it.
- Compare it with the hash you were given, or keep it as a fingerprint of that exact text.
What is hashed. The tool hashes the UTF-8 bytes of the text exactly as you typed it. Nothing is trimmed, normalised or added, and the digest is shown in lower-case hexadecimal. A few details decide whether your hash matches one produced elsewhere:
- Every character counts. Spaces, tabs, capital letters and invisible trailing spaces all change the result.
Helloandhellogive completely different hashes. - UTF-8 encoding. A plain ASCII character is one byte,
éis two (c3 a9),日is three (e6 97 a5) and an emoji such as😀is four (f0 9f 98 80). This is what most programming languages and command-line tools do by default. - Line breaks are kept as they arrive. A browser text box stores each line break as a single line-feed character (LF, byte
0a), and text pasted with Windows CR LF line endings normally arrives as LF too. The tool does not convert it to anything else, so the digest equals whatprintfpiped intosha1sumgives for the same text. A final line break counts as a byte of its own. - An empty box gives no result, even though the SHA-1 of an empty message is a perfectly valid value.
- The hash is computed by code running in your browser. If you share a direct link to a result, the text you typed is part of that link, so avoid sharing results for passwords or other secrets.
| You type | Bytes hashed (hex) | SHA-1 digest |
|---|---|---|
| hello | 68 65 6c 6c 6f | aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d |
| hello, then Enter | 68 65 6c 6c 6f 0a | f572d396fae9206628714fb2ce00f72e94f2258f |
| a, Enter, b | 61 0a 62 | fcd127ffa1016069006ad91f3f361248f9bdf272 |
To get the digest of a file that uses Windows CR LF line endings, hash the file itself with a command-line tool. This page can only hash text the way a browser text box holds it.
What makes a hash function useful
A cryptographic hash function is designed around a handful of properties, and SHA-1 was built to have them all:
- Deterministic: the same input always yields the same digest.
- Fixed length: one letter or one gigabyte, the output is always 160 bits.
- One-way: knowing the digest should give no practical way to reconstruct the input.
- Avalanche effect: a tiny change in the input flips about half of the output bits. Changing
abctoabdalters 93 of the 160 bits of the SHA-1 digest. - Collision resistance: it should be infeasible to find two different inputs with the same digest. This is the property SHA-1 has lost.
A hash is not encryption. There is no key and nothing to decrypt: the original text cannot be read back from a hash, although short or common inputs can be found by guessing candidates and hashing them.
Is SHA-1 secure?
Not for anything that depends on collision resistance. With 160 output bits, a generic birthday attack needs about 280 hash evaluations to find a collision, which was already considered uncomfortably close to feasible in the early 2000s. Researchers published better-than-generic attacks from 2005 onward.
In February 2017 a team from CWI Amsterdam and Google announced the first real collision for full SHA-1, nicknamed SHAttered: two different PDF files with the same SHA-1 digest, found with roughly 263 evaluations. In 2020 researchers followed up with the first chosen-prefix collision on SHA-1, the more dangerous kind, because the attacker can pick two meaningful documents or keys and then append data that makes their hashes match.
Browsers and certificate authorities stopped accepting SHA-1 certificates years ago, and NIST has set a timetable to retire SHA-1 entirely. The attacks found so far break collision resistance. Recovering an input from a given digest (preimage resistance) is still out of reach.
SHA-1 is not suitable for storing passwords, salted or not. It is built to be fast, so an attacker with a graphics card can test many billions of guesses per second. Passwords need a deliberately slow, salted, purpose-built function such as Argon2, scrypt or bcrypt. For other new work, use SHA-256 or SHA-512.
Where SHA-1 is still used
SHA-1 has not disappeared, because many systems were built on it and some uses do not need collision resistance:
- Git has long identified commits and files by their SHA-1 hash. Modern Git detects the known collision patterns and can also be set up with SHA-256 repositories.
- Legacy checksums and download lists that publish a SHA-1 next to a file to catch accidental corruption.
- One-time-password apps based on RFC 6238 default to HMAC-SHA-1. The HMAC construction is not weakened by the collision attacks above.
- The WebSocket handshake derives its accept key from a SHA-1 of the client key plus a fixed string. It is a protocol identifier, not a security boundary.
- De-duplication and caching keys where nobody is trying to craft colliding inputs.
SHA-1 compared with SHA-2
| Algorithm | Digest size | Hex characters | Block size | Rounds | Word size |
|---|---|---|---|---|---|
| SHA-1 | 160 bits | 40 | 512 bits | 80 | 32 bits |
| SHA-256 | 256 bits | 64 | 512 bits | 64 | 32 bits |
| SHA-512 | 512 bits | 128 | 1024 bits | 80 | 64 bits |
If you need a stronger hash, try the SHA-256 generator or the SHA-512 generator. To compare against an even older and weaker digest, see the MD5 generator; for error detection rather than security, a CRC calculator is the usual choice. If you are choosing a secret rather than hashing one, the random password generator can help.
Frequently asked questions
How long is a SHA-1 hash?
A SHA-1 digest is 160 bits, which is 40 hexadecimal characters. It is always that length, whatever the size of the input.
Can a SHA-1 hash be reversed or decrypted?
No. A hash is a one-way function and does not contain the original data. Short or predictable inputs can be recovered by hashing guesses until one matches, which is why common passwords are easy to crack from an unsalted hash.
Why does my SHA-1 differ from the one in another tool?
Almost always the input differs by an invisible character: a trailing space or line break, a different line ending, a different capitalisation or a different text encoding. This generator hashes the UTF-8 bytes of the text as typed, with a line break as the single LF byte, whereas files saved on Windows often use CR LF.
Is SHA-1 still safe to use?
It is fine for non-adversarial jobs such as spotting accidental corruption, but it is broken for digital signatures and certificates because practical collisions exist. Choose SHA-256 or stronger for new work.
Can I store passwords as SHA-1 hashes?
No. SHA-1 is fast by design, so attackers can test many billions of guesses per second, and a salt does not change that speed. Use a slow, salted password-hashing function such as Argon2, scrypt or bcrypt.
References
- NIST FIPS 180-4, Secure Hash Standard (SHS), 2015
- RFC 3174: US Secure Hash Algorithm 1 (SHA1)
- Stevens, Bursztein, Karpman, Albertini, Markov. The first collision for full SHA-1. CRYPTO 2017
- Leurent G, Peyrin T. SHA-1 is a Shambles: first chosen-prefix collision on SHA-1 and application to the PGP web of trust. USENIX Security 2020
Cite this calculator and page
If you use this page in your work, you can cite it as:
Reeliy Editorial Team. (2026). SHA1 Generator. Reeliy. https://reeliy.com/calculators/sha1-online-generator“SHA1 Generator.” Reeliy, 2026, https://reeliy.com/calculators/sha1-online-generator.