SHA-1 Hash Generator

Generates a SHA-1 digest — 40 hexadecimal characters — using the browser's own cryptography engine. SHA-1 is broken for anything an adversary can influence, and still in daily use everywhere from Git to legacy APIs, which is why the tool exists.

Live demo · real result from this tool
Output
With a key, the result is HMAC-SHA-1 (RFC 2104).

SHA-1

2fd4e1c67a2d28fced849ee1bb76e7391b93eb12
Digest length
160 bits (40 hex characters)
Input size
43 bytes

SHA-1 has practical collisions (SHAttered, 2017). Use SHA-256 for anything new; HMAC-SHA1 is still considered sound.

Processed on your device — nothing is uploaded.

How to use SHA-1 Hash Generator

  1. Paste the text you want to hash.
  2. The 40-character digest appears immediately.
  3. Copy it, and compare the whole string case-insensitively when verifying.
  4. Output is always 160 bits — 40 hexadecimal characters.
  5. The digest of the empty string is da39a3ee5e6b4b0d3255bfef95601890afd80709.
  6. Computed with Web Crypto in your browser; nothing is transmitted.

How broken it is, precisely

Collision resistance is gone. Google and CWI demonstrated the first practical collision in 2017 with SHAttered — two different PDFs with the same SHA-1 — and the 2020 SHA-1 is a Shambles work produced a chosen-prefix collision, which is the dangerous kind, for around $45,000 of cloud compute. That cost has only fallen since. Preimage resistance is intact: you still cannot take a digest and find an input that produces it. So SHA-1 remains adequate for non-adversarial integrity checking and is unfit for signatures, certificates or anything where someone benefits from a forgery.

Where you still legitimately meet it

Git object names are SHA-1, which is why every commit hash is 40 hex characters. Git has known about this since 2017 and mitigates with collision detection, and SHA-256 repositories exist, but the transition is slow and most repositories today are still SHA-1. HMAC-SHA1 is used in TOTP and in older AWS request signing, and — importantly — is not broken, because HMAC’s security does not rest on collision resistance. Legacy APIs and checksums for older archives make up most of the rest.

What replaced it

SHA-256 for new work, everywhere. Certificate authorities stopped issuing SHA-1 certificates in 2016 and browsers stopped accepting them in 2017. NIST formally deprecated SHA-1 in 2022 with a 2030 end date for federal use. If you are choosing today there is no argument for SHA-1: SHA-256 is unbroken, widely supported and no slower in any way that matters.

Frequently asked questions

How long is a SHA-1 hash?
160 bits, written as 40 hexadecimal characters. That length is the quickest way to tell a SHA-1 digest from an MD5 (32 characters) or a SHA-256 (64).
Is SHA-1 still safe to use?
Not for anything an attacker can influence — practical chosen-prefix collisions exist and are affordable. It is still fine for non-adversarial integrity checks and for HMAC, whose security does not depend on collision resistance. Use SHA-256 for anything new.
Where is SHA-1 still used?
Git uses SHA-1 to identify commits and objects, and some legacy systems still rely on it for integrity checks.
Why does Git still use SHA-1?
History and inertia. Git predates the practical attacks, and object names are woven through the format. Git added collision detection in 2017 that rejects the known attack patterns, and SHA-256 repositories are supported, but converting existing history is disruptive so most repositories remain SHA-1.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close