Need a quick fingerprint of some text? A SHA1 hash generator turns the text you paste into a fixed 40-character digest right in your browser, so you can verify a value, compare two inputs or reproduce a legacy checksum. It is a free online tool: paste your text, read the output, copy it to your clipboard, and move on. No account, no upload.
How a SHA1 Hash Generator Turns Text into a Hash Value
SHA-1 stands for Secure Hash Algorithm 1. As a cryptographic hash function, it reads your input as bytes and returns a 160-bit (20-byte) value, written as 40 hexadecimal characters. The NSA designed it in 1995, and RFC 3174 and FIPS 180-4 both specify it. A hash calculator like this one is deterministic: identical text always gives the same hash value, so the result works as a fixed-length fingerprint of whatever you fed in. Collisions make MD5 cryptographically broken for signatures, so the md5 hash generator suits cache keys and deduplication instead.
The process is also one-way. A hash is not encryption, so it cannot be decrypted back into your original text. The only way to "reverse" one is to guess inputs and hash each guess.
Paste your input string
Paste or type the input text you want to hash. A single word, a JSON snippet, a license key or a long paragraph all work, and most pages update as you type, so there is nothing to wait for.
Read the output as lowercase or uppercase hex
The result appears as lowercase hexadecimal by default. Switch to uppercase when the system you are matching expects capital letters, then confirm the length is exactly 40 characters.
How to Create a SHA-1 Hash Step by Step
- Enter your text in the box and check it for stray characters.
- Pick the algorithm (here, SHA-1) and the format for the result.
- Press the calculate button, or let the page refresh live.
- Copy the value and compare it with your reference.
Every character matters, so one extra space gives a completely different answer. If you want to generate SHA1 hash values for salted data, add the salt to the text before hashing it. A good SHA1 calculator never trims or rewrites your input, and a dependable hash calculator shows the exact bytes it processed, so you can trust the answer you copy. In a production system, if you want to generate a password hash you can trust, use a vetted library and treat browser values as a reference.
Compare a checksum before you trust a download
Publishers often list a SHA1 checksum beside a file. Hash your copy, then compare both values character by character. A match supports file integrity; a mismatch points to file corruption or tampering. Any checksum calculator follows the same routine, though a published sha-256 value is the better reference when one exists.
Example: one changed letter, a new hash
Hashing invoice-2026-1187 returns 2fd732367d51d1491380ed56e7be42a00568ca6a. Change only the last number to invoice-2026-1188 and you get bbd2cc629df5d3e9dcbf2a993b47918eaae8994c. Capitalise the first letter instead and the result is f62c10b5f70460aab043684d611694ab2f592b0e. This is the avalanche effect: a tiny edit produces an unrelated result, which is why two matching hashes are strong evidence that the text matches too.
SHA-1 Encoding Options: UTF-8, Base64 and HMAC
The hash works on bytes, not characters, so the encoding you choose matters. The same text hashed as UTF-8 and as UTF-16 produces different hashes. For invoice-2026-1187, UTF-16 gives db2a7e7e9bd3a0f02eee0d0e5d77283326e895a9. Hidden differences such as line endings (LF versus CRLF) and trailing spaces change the result too, which is why copied text sometimes fails to match. Before changing PASSWORD_HASHERS, the django password hash generator lets you compare Argon2id, bcrypt and PBKDF2 against what the framework uses.
Some pages also accept hex or Base64 input and can show the result in Base64. Others add HMAC, which mixes a secret key into the hash so a receiver can authenticate the sender. Switch it on only when your protocol requires a keyed value; a plain digest cannot prove who produced it. When a checksum from another tool does not match yours, compare the encoding and line endings first, since they explain most mismatches.
Checking a Legacy Payment Signature with a SHA-1 Hash Generator
Dana maintains a small shop that still talks to a payment gateway from 2014, and webhook calls are rejected with "bad signature". The gateway's old documentation says the signature is the SHA-1 hash of order|amount|secret. Before touching any code, Dana opens an online SHA1 hash generator to see what the gateway should be receiving.
The values on hand are order ORD-48213, an amount of 172.40 and the test secret k7q. Dana pastes ORD-48213|172.40|k7q as UTF-8 text and reads 00d19277e816b198232352f0d750c3a62050330e. That is 40 hexadecimal characters, matching the 160-bit length the gateway's documentation promises, but it does not match the 55d4... value the shop's code is sending.
| Input text | SHA-1 result |
|---|---|
ORD-48213|172.40|k7q | 00d19277e816b198232352f0d750c3a62050330e |
ORD-48213|172.04|k7q | 5b4a9b82cc12230bb92ed8a87a7bde4fe70b2df7 |
ORD-48213|172.40|k7q plus a trailing newline | 55d47ca5c819ee84309d2399ab5f5282d2cdf2c0 |
The third row is the culprit: the shop's code reads the secret from a file and keeps its newline. The sensitivity rerun makes the point sharper. Swapping two digits in the amount (172.04) changes every character of the result, so no near-match can mislead anyone. What stands out is that the hash looked "valid" every time, since any input yields 40 well-formed characters. Length proves nothing; only an exact string comparison does. That is the real job of a SHA-1 calculator here: it gives Dana a trusted reference value for the exact text, so the argument shifts from "is the gateway broken?" to "which bytes did our code actually hash?" Answering that took about five minutes instead of an afternoon of guessing.
Dana trims the secret and re-sends a test call; the signatures now agree. The caveat remains: with no real key mixing, anyone who learns the secret can forge calls, so the legacy endpoint should move to HMAC when the gateway allows.
SHA-1 Security: Collision Attacks and Encryption Myths
This hash was meant to be collision resistant, meaning no two inputs should share a result. Practical attacks have since broken that promise, and browsers stopped trusting SSL certificates signed with it in 2017. Treat it as unsuitable for digital signatures, certificates and TLS. Remember too that nobody can recover your data from a hash, but nobody should rely on one to protect it either.
Why passwords need bcrypt, not SHA-1
A fast hash is a poor way to store a password, because attackers can test billions of guesses per second against a stolen list of plain hashes. Modern hardware can run brute force guesses at enormous speed, and a stolen database would expose weak passwords within hours. Password hashing needs bcrypt, scrypt or Argon2, which add a unique salt and a tunable work factor. A salted hash beats a bare one, yet the password text still deserves a slow, purpose-built scheme.
Legacy uses and MD5 comparisons
The algorithm survives where legacy compatibility counts: Git object names, older update feeds and published checksums. MD5 is weaker still and suits only non-security deduplication of text or files. Typical examples are Git object IDs, older update feeds and vendor checksums that were published before stronger options existed.
SHA-1 vs SHA-256: Picking the Right Algorithm
| Algorithm | Output size | Status |
|---|---|---|
| MD5 | 128 bits (32 hex) | Broken; only for non-security checks |
| SHA-1 | 160 bits (40 hex) | Legacy; avoid for new signatures |
| SHA-256 | 256 bits (64 hex) | Standard default in SHA-2 |
| SHA-384 | 384 bits (96 hex) | Used in some TLS suites |
| SHA-512 | 512 bits (128 hex) | Strong; fast on 64-bit CPUs |
Developers and programmers building anything new should pick SHA-256 or stronger. Blockchain projects and modern TLS rely on that family for exactly this reason, and the extra length costs you almost nothing.
Hash Calculator Code in Python, JavaScript, PHP and Perl
Need the same result inside your own program? Each language ships a built-in call:
- Python:
hashlib.sha1(s.encode()).hexdigest() - JavaScript:
crypto.subtle.digest('SHA-1', bytes), on https pages only - PHP:
sha1($string) - Perl:
sha1_hex($string)withDigest::SHA
Hash the same text in code and on this page, then compare the two outputs. If they differ, check the encoding and whitespace first. Our SHA-1 tool and your script should always agree for identical bytes.
Frequently Asked Questions
- What is SHA-1 used for?
- SHA-1 is a legacy cryptographic hash function still used for Git commit identifiers, some legacy checksums, and older authentication protocols. It's been deprecated for security purposes since 2017, when researchers demonstrated a practical collision attack (the SHAttered attack) -- use SHA-256 or stronger for anything requiring collision resistance.
- Is SHA-1 safe for hashing passwords?
- No -- SHA-1 (like every hash function on this page except the dedicated password-hashing tools) is designed to be fast, which is exactly the wrong property for password storage: fast hashes let an attacker try billions of guesses per second on stolen data. Use this site's Bcrypt Generator, Password Hash Generator's Argon2id notes, or a dedicated slow KDF (PBKDF2, scrypt, Argon2) for anything storing real user passwords.
- Is the output the same every time for the same input?
- Yes -- SHA-1 is deterministic: the exact same input text always produces the exact same hash, with no randomness involved. That's what makes it useful for integrity checks (comparing two files or messages) but unsuitable on its own for password storage, where each user needs a unique, unpredictable salt.
- Can a hash be reversed back to the original text?
- Not directly -- hash functions are one-way by design. The only practical way to "reverse" one is to guess inputs and hash each guess until a match is found (a dictionary or brute-force attack), which is exactly why fast hashes like this one are unsuitable for protecting secrets on their own.
- Is my text sent anywhere?
- No. The hash is computed entirely in your browser -- nothing is transmitted to a server or stored.