SHA-1 Hash Generator - Generate SHA-1 Hashes Online
—Generate a SHA-1 Hash
Paste or type text and the 40-character SHA-1 digest appears below. The
text is encoded as UTF-8 and hashed with the browser's Web Crypto API,
so the result matches printf '%s' "text" | sha1sum on
Linux or shasum on macOS. Nothing is uploaded.
Where SHA-1 Is Still Used
- Git. Commit, tree, blob and tag IDs are SHA-1 by
default. Git hashes a type-and-size header with the content, which is
why hashing a file's text here does not give its blob ID. Git can use
SHA-256 instead (
git init --object-format=sha256), but most hosting and tooling still expects SHA-1 repositories. - TOTP codes. Most authenticator apps generate six-digit codes with HMAC-SHA1, the RFC 6238 default.
- Have I Been Pwned. The Pwned Passwords API takes the
first five hex characters of a password's SHA-1, so you can check a
password without sending it. The SHA-1 of
passwordstarts with5baa6. - Older checksums and APIs. Some package indexes, OAuth 1.0 signatures (HMAC-SHA1) and legacy file formats still use it.
Collision Risk in Practice
A collision attack lets someone who controls both inputs produce two files with the same SHA-1. That breaks signatures and certificates, where an attacker can get one document signed and swap in the other. It does not affect cases where you only need to detect accidental changes, and it does not let anyone reverse a hash. Git added collision detection after SHAttered, so known attack files are rejected. For anything new that needs collision resistance, use SHA-256.
Reversing SHA-1
There is no way to turn a SHA-1 back into its input. Short or common inputs can be found by guessing, which is how millions of unsalted SHA-1 passwords from the 2012 LinkedIn breach were cracked within days. Passwords belong in bcrypt, scrypt or Argon2. If you need to read a value back later, encode it with Base64 or encrypt it instead of hashing.
Related Tools
JWT Decoder
Decode JSON Web Tokens and inspect header, payload and signature.
Base64 Encode / Decode
Encode text to Base64 or decode Base64 strings back to plain text.
URL Encode / Decode
Percent-encode or decode URLs and query-string parameters safely.
Hash Generator
Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes from text.