sha1 hash generator online
LegacyCreate the sha1 hash of any text: 40 hex characters, the same result as PHP's hash(). Check a hash or a file below. Nothing leaves your browser.
Compare, hash a file, copy any format
Type text in the tool above or choose a file. Case, spaces and prefixes like sha1: don't matter.
hello world- Hex
2aae6c35c94fcfb415dbe95f408b9ce91ee846ed- HEX (upper case)
2AAE6C35C94FCFB415DBE95F408B9CE91EE846ED- Base64
Kq5sNclPz7QV2+lfQIuc6R7oRu0=
Files are read in your browser and never uploaded.
What is SHA-1?
SHA-1 produces a 160-bit hash, written as 40 hex characters. NIST published it in 1995; in 2017 the SHAttered attack showed two different PDF files with the same SHA-1. Git still identifies objects with (hardened) SHA-1, but for signatures and certificates SHA-1 is no longer accepted.
- Git object IDs
- Legacy systems and old signatures
- HMAC-SHA1 (still acceptable)
- Checksums of old downloads
Change one letter, see what happens
A cryptographic hash changes about half of all bits when one input character changes. Nothing about the old hash tells you what the new one will be.
……Calculating…
Is it a common password?
No one can decrypt a hash. What "decrypt" sites do is compare it with hashes of known words. This check does the same in your browser with about 11,000 common passwords, PINs and years, so you can see how quickly weak passwords fall.
Nothing is sent anywhere. The list is part of this page.
Free course: why hashes can’t be decrypted, and how to store passwords →
The same result in your code
Every snippet prints 2aae6c35c94fcfb415dbe95f408b9ce91ee846ed for hello world, the same as the tool. They are run against PHP's hash() before each release.
echo hash('sha1', 'hello world');
import hashlib print(hashlib.sha1("hello world".encode()).hexdigest())
import { createHash } from "node:crypto"; console.log(createHash("sha1").update("hello world").digest("hex"));
const data = new TextEncoder().encode("hello world"); const buf = await crypto.subtle.digest("SHA-1", data); console.log([...new Uint8Array(buf)].map((b) => b.toString(16).padStart(2, "0")).join(""));
import java.nio.charset.StandardCharsets; import java.security.MessageDigest; import java.util.HexFormat; public class Hash { public static void main(String[] args) throws Exception { byte[] digest = MessageDigest.getInstance("SHA-1") .digest("hello world".getBytes(StandardCharsets.UTF_8)); System.out.println(HexFormat.of().formatHex(digest)); // Java 17+ } }
package main import ( "fmt" "crypto/sha1" ) func main() { fmt.Printf("%x\n", sha1.Sum([]byte("hello world"))) }
printf '%s' 'hello world' | sha1sum # macOS: printf '%s' 'hello world' | shasum -a 1 # File on Windows: certutil -hashfile file.zip SHA1
SHA-1 test values
Hashes of common test strings (UTF-8, no line break). Use them to check your own implementation.
| Input | sha1 |
|---|---|
| empty string | da39a3ee5e6b4b0d3255bfef95601890afd80709 |
abc | a9993e364706816aba3e25717850c26c9cd0d89d |
hello world | 2aae6c35c94fcfb415dbe95f408b9ce91ee846ed |
The quick brown fox jumps over the lazy dog | 2fd4e1c67a2d28fced849ee1bb76e7391b93eb12 |
SHA-1 hashes of the 5 most common passwords
These five lead the public lists of leaked passwords year after year, so their hashes are in every cracking list too. If you see one of these values in a database, the password is known. Paste one into the password check above to see it found in a split second.
| Password | sha1 |
|---|---|
123456 | 7c4a8d09ca3762af61e59520943dc26494f8941b |
password | 5baa61e4c9b93f3f0682250b6cf8331b7ee68fd8 |
123456789 | f7c3bc1d808e04732adf679965ccc34ca7ae3441 |
12345678 | 7c222fb2927d828af22f592134e8932480637c0d |
12345 | 8cb2237d0679ca88db6464eac60da96345513964 |
Why your SHA-1 doesn't match
git hash-object hashes "blob <size>\0" plus the content, so a file's Git ID is not the plain SHA-1 of the file.
With SHA-256, SHA-512, SHA-1 and MD5, hash(secret + message) is not a safe signature: an attacker can append data and compute a valid hash without the secret. Use HMAC.
A fast hash lets attackers try billions of guesses per second. Store passwords with Argon2id, bcrypt or scrypt, which are slow on purpose and use a salt.
echo "hello world" | sha256sum hashes 12 bytes: the text plus a line break. Use printf '%s' 'hello world' or echo -n to hash exactly 11 bytes.
The tool hashes UTF-8 bytes, like most languages. Windows APIs and .NET's Encoding.Unicode use UTF-16, older systems Latin-1. "ü" is 2 bytes in UTF-8, 1 in Latin-1, 2 in UTF-16, and each gives a different hash.
Hex is not case-sensitive: 5EB63BBB… and 5eb63bbb… are the same hash. Compare in one case, and watch for spaces or a prefix like "sha256:".
The MD and SHA-1 family side by side
The same text, every MD and SHA-1 algorithm. Shown for hello world; type in the tool above to use your text.
How fast is SHA-1?
Hashes up to 4 MB of random data in your browser and compares with sha256, xxh3. Browser numbers are lower than native code, but the ranking holds.
Questions about SHA-1
Can SHA-1 be decrypted?
No. SHA-1 is a one-way function: there is no key and no way to compute the input from the hash. Sites that "decrypt" SHA-1 look the hash up in large tables of known inputs, which only works for short or common strings.
How long is a SHA-1 hash?
A SHA-1 hash is always 160 bits, written as 40 hexadecimal characters (20 bytes), no matter how long the input is.
Is SHA-1 secure?
No. Collisions for SHA-1 can be created on purpose, so it must not be used for signatures, certificates or anything an attacker could exploit. It is still fine to detect accidental corruption.
Should I hash passwords with SHA-1?
No. SHA-1 is fast, so attackers can test huge numbers of guesses. Use Argon2id, bcrypt or scrypt with a unique salt per password.
Is SHA-1 still used?
Yes, mainly in Git and in older systems. Browsers stopped trusting SHA-1 TLS certificates in 2017.