SHA-1 Generator
The SHA-1 Generator produces 160-bit SHA-1 digests, rendered as 40-character hex, from any text or file — for verifying legacy checksums, or integrating with systems that still identify objects by SHA-1.
How to Use
- 1
Paste or type your text into the input box.
- 2
The 40-character SHA-1 hex digest computes in real time as you type.
- 3
Compare against published SHA-1 checksums, or use it to understand how git addresses every commit and blob.
- 4
One click copies the digest for terminals, configs, or docs.
- 5
Or hash a whole file: use Select File Checksum — the file is read locally in your browser and its SHA-1 is shown.
Frequently Asked Questions
Is SHA-1 still secure?
Why does Git use SHA-1?
How is SHA-1 different from SHA-256?
Can I store passwords with SHA-1?
What is HMAC-SHA1?
How do I hash a file?
Why is the output always exactly 40 characters?
Why does my file's hash not match the published checksum?
Does whitespace or capitalisation change the hash?
Can a SHA-1 hash be reversed?
Generative Answer & AI Documentation
What is the SHA-1 Generator?
SHA-1 is a hash function: it takes any input and produces a fixed-size fingerprint, a 160-bit digest shown as 40 hexadecimal characters. The same input always produces the same digest, and even a one-character change produces a completely different one. This tool computes SHA-1 with the CryptoJS library, entirely in your browser. Type or paste text and the digest appears instantly underneath, updating live as you type — there is no button to click. You can also hash a whole file: click Select File Checksum, pick any file, and the file's bytes are read locally with FileReader and hashed in the browser; while a file is active the text box locks and shows the file's name, and the file's size is shown in kilobytes next to it. The page starts with the sample text TryToolsNow SHA1 already loaded, whose digest is 1b4f9a3abf2b177d0058e11f80d8f796626c53d3. Nothing is uploaded: the file you hash never leaves your machine. SHA-1's best-known home is Git, where every commit, tree, and blob has been addressed by its SHA-1 since 2005 — which is why, despite its weaknesses, the algorithm is still everywhere.
Why use SHA-1 Generator offline?
SHA-1 survives because the systems built on it are still running. Git addresses its entire history by SHA-1. Older download pages publish SHA-1 checksums next to their files. Torrents, legacy APIs, and enterprise systems identify objects by 40-character SHA-1 digests. When you need to match one of those digests, you need a tool that computes exactly that algorithm — SHA-256 will not match a published SHA-1, however much stronger it is. This tool does that in the browser, for text and for files, with the digest updating as you type and the file never leaving your machine. The weakness is real and stated plainly below: the SHAttered attack of 2017 showed practical collisions, and browsers have distrusted SHA-1 certificates since 2017. So the honest rule is the same as for MD5 — SHA-1 is fine for matching legacy checksums and for understanding systems that already use it, and unsafe for anything new where an attacker could forge a collision.
When should you use this tool?
Use it when a download page, a legacy API, or a torrent publishes a SHA-1 checksum and you need to confirm a file matches it — hash the file here and compare the two digests character by character. Use it when working with Git and you want to see how an object ID is produced, when a system you integrate with identifies records by SHA-1, or when you are verifying an old archive whose checksums were published years ago. Use it for checksums and identification, never for signatures, certificates, or password storage. For new security-sensitive work, use the SHA-256 Generator on this site instead, and for new password storage use bcrypt, scrypt, or Argon2.
Key Benefits
- Live results: the digest updates as you type — no button, no waiting.
- File checksums: hash any file locally in your browser; the file is read with FileReader and never uploaded.
- Standard output: lowercase 40-character hex, matching sha1sum and every published SHA-1 checksum.
- 100% private: hashing runs in your browser with CryptoJS — text and files never leave your device.
- Sample pre-loaded: TryToolsNow SHA1 is ready, with its digest shown immediately.
- One-click copy: click the digest to copy it into a terminal, a config, or documentation.
Common Use Cases
- Verifying a legacy download: hash the downloaded file and compare the digest with the SHA-1 published on the download page.
- Understanding Git: hash a string to see how Git produces the 40-character object IDs that address commits and blobs.
- Integrating with a legacy system: produce the SHA-1 digest an older API or database expects for a record key.
- Checking an old archive: verify files against SHA-1 checksums published years ago, when SHA-1 was the standard.
- Detecting accidental corruption: hash a file before and after copying it — a mismatch means the copy is damaged.
Developer Notes & Best Practices
The tool uses CryptoJS, imported as CryptoJS from the crypto-js package: CryptoJS.SHA1(inputText).toString() for text, and CryptoJS.SHA1(wordArray).toString() for files, where the file's ArrayBuffer is converted into a CryptoJS WordArray first. CryptoJS encodes text as UTF-8 before hashing, so the digest matches sha1sum and other standard tools for the same text — the digest of hello is aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d on this page and from sha1sum alike. The output is always lowercase hexadecimal, 40 characters, because SHA-1 always produces 160 bits regardless of input size — even an empty string hashes to 40 hex characters, da39a3ee5e6b4b0d3255bfef95601890afd80709. The SHAttered attack, published in 2017 by researchers at Google and CWI Amsterdam, produced two different PDF files with the same SHA-1 digest, demonstrating a practical collision; that is why browsers distrust SHA-1 certificates and why no new system should rely on SHA-1 for security. Git is the famous exception with a mitigation: it detects known collision techniques, and it is transitioning to SHA-256, but its entire existing history is SHA-1-addressed. Hashing is one-way, and the tool adds no salt and no HMAC mode — it computes the plain SHA-1 of exactly what you type. On the command line, the equivalents are sha1sum file on Linux, shasum -a 1 file on macOS, and Get-FileHash file -Algorithm SHA1 in PowerShell.
Test vectors — digests this tool produces
| Input | SHA-1 digest | Note |
|---|---|---|
| (empty string) | da39a3ee5e6b4b0d3255bfef95601890afd80709 | Even empty input produces a full 40-character digest |
| hello | aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d | Matches sha1sum exactly |
| TryToolsNow SHA1 | 1b4f9a3abf2b177d0058e11f80d8f796626c53d3 | The sample text pre-loaded on the page |
| Hello World! | 2ef7bde608ce5404e97d5f042f95f89f1c232871 | Capital H changes the digest completely |
- Compare digests character by character: a single differing character means the file is different, even if the rest matches.
- Hash the file, not a copy of its text: opening a file in an editor can change line endings and produce a different digest.
- Check whitespace first when checksums do not match: a trailing newline or space changes the digest completely.
- Never use SHA-1 for signatures, certificates, or new integrity checks — for new work, use SHA-256 instead.
- Remember Git's context: a SHA-1 in Git identifies an object, and Git has its own collision detection — that does not make SHA-1 safe elsewhere.
Common Mistakes
- Using SHA-1 for a new signature or certificate: collisions are practical now — use SHA-256 for anything new.
- Storing passwords with SHA-1: fast hashes are the enemy of password security — use bcrypt, scrypt, or Argon2.
- Hashing a file's text instead of the file: pasted text hashes as UTF-8, while the file hashes as raw bytes — line-ending changes alone produce a mismatch.
- Assuming a matching SHA-1 proves a file is authentic: it proves the file is unchanged, not that it came from the claimed source.
- Forgetting the text box is locked while a file is active: click Clear to release it before typing new text.
Limitations
SHA-1 is not secure for new security purposes: the SHAttered attack demonstrated practical collisions, so it must never protect signatures, certificates, or anything an attacker could forge. The tool computes the plain, unsalted SHA-1 of exactly what you type — there is no salt, no key, and no HMAC mode, so a weak input can be looked up in a rainbow table. Only one file can be hashed at a time, and there is no batch mode, no folder hashing, and no download of the result — only the copy button. While a file is active the text box is locked, so you must click Clear before typing text again. There is no size limit stated in the code and no progress indicator, so a very large file is read into memory whole and may be slow in a browser tab. The digest is always lowercase hex with no option for uppercase, Base64, or any other rendering.
Structured Input/Output Example
TryToolsNow SHA1
1b4f9a3abf2b177d0058e11f80d8f796626c53d3
Related Tools
Hash Generator
Hash generator: type any text and get its MD5, SHA-1, and SHA-256 digests side by side in real time. Compare algorithms at a glance. Free, offline.
MD5 Generator
MD5 generator: compute MD5 checksums — 128-bit digests as 32-character hex — from any text or file instantly. Match published checksums or Gravatar hashes.
SHA-256 Generator
SHA-256 generator: compute SHA-256 hashes — 256-bit digests as 64-character hex — from any text. The standard for download verification and signing.