Hash Generator

Crypto

Generate SHA-1/256/384/512 hashes from text with hex output, plus MD5 and RIPEMD-160. Switch between hex and Base64 output, then compare against a published.

Ready
Text to hash
0 chars
Digests
MD5— type something above to get hashes —
CRC32— type something above to get hashes —
SHA-1— type something above to get hashes —
SHA-256— type something above to get hashes —
SHA-384— type something above to get hashes —
SHA-512— type something above to get hashes —

About Hash Generator

Hashes answer questions like "did this file arrive intact", "are these two texts really identical", and "give this content a fixed-length fingerprint". Typical uses: publishing a SHA-256 so users can verify an installer, deduplicating log lines by content, deciding whether an HTTP cache entry is still valid, or demonstrating the avalanche effect where one changed character rewrites the whole digest. The mechanism compresses input of any length into a fixed-length digest with three properties: the same input always yields the same output, different inputs are extremely unlikely to collide, and the output cannot be reversed into the input. This tool uses the browser-native Web Crypto for SHA-1, SHA-256, SHA-384 and SHA-512, with local implementations filling in MD5 and RIPEMD-160. Practical notes: When verifying a download, always confirm the algorithm as well as the value; checking a digest without agreeing on the algorithm verifies nothing. Publishers often list both SHA-256 and SHA-1, and SHA-256 should win. Hash the file contents, not the filename, and be aware that some systems rewrite line endings on download, since a CRLF versus LF difference changes the digest and makes text-file hashes inherently fragile. Limits: Practical collisions exist for both MD5 and SHA-1, so they remain usable for spotting transport errors but not for signatures, password storage or tamper protection, which must start at SHA-256. The other common misconception is treating a hash as encryption: hashes are one-way, no "decrypt" operation exists, and a forgotten password can only be reset, never recovered. Passwords specifically need a salted algorithm with a work factor (see the bcrypt tool), because an unsalted SHA-256 can be tried billions of times per second on modern GPUs. Data and privacy: what people hash is often a password, a national ID, a signed token or an unpublished document. Hashing is one-way, but for short inputs such as a six-digit PIN an attacker can enumerate every candidate and compare digests, so uploading plaintext alongside its digest is still a disclosure. This tool computes everything in the browser and the input never leaves the device; disconnect the network and it still works, or keep the Network panel open and confirm no requests are made. Some experience on algorithm choice and engineering practice. SHA-256 is sufficient for file verification, with SHA-512 or SHA-3 when stronger collision resistance is needed. Keep MD5 and SHA-1 only for legacy interoperability where the other side supports nothing else, and document that as a compatibility concession rather than a security decision. Never read a large file into memory to hash it: stream it in chunks into the digest function and even multi-gigabyte images finish on ordinary hardware. When using hashes to decide whether content changed, watch line-ending normalization, because the same text yields different digests on Windows and Linux thanks to CRLF versus LF, so cross-platform manifests should pin the line ending at generation time. Finally, if you use a hash as a unique key, remember that truncating it (say to the first 8 characters) as a deduplication key sharply raises collision probability; keep the full digest or lengthen the prefix. Also distinguish hashes from checksums: CRC32 and similar are designed to catch random bit flips in transit, are fast, and are trivially forgeable, so they serve only as a quick screen. Deciding whether content was maliciously replaced requires a cryptographic hash, and confusing the two rests a security decision on a fragile assumption.

How It Works Internally

A hash compresses input of any length into a fixed-length output and guarantees the same input always gives the same output, different inputs are extremely unlikely to collide, and the output cannot be reversed. The avalanche effect is a consequence of those properties: flip one input bit and about half the output bits change. It is one-way, so there is no decryption step — the original can only be replaced, not recovered.

First 16 hex digits of SHA-256
Inputabc
Outputba7816bf8f01cfea… (full digest is 64 hex characters)

Measured on This Page

Six digestsAll six values match hashlib / zlib for the seven non-empty inputs, including Chinese and emoji
Padding boundaries55, 56 and 64 bytes — the MD5 padding split points — all correct, so the hand-written padding is right
UTF-8 basisChinese and emoji are hashed as UTF-8 bytes: the MD5 of 中文测试 equals hashlib.md5('中文测试'.encode())
CRC32 formatEight lowercase hex digits without a 0x prefix, matching the number from zlib.crc32
Empty inputNo digests shown (treated as no input) — use the file mode to verify an empty file checksum

MD5 should not be used for security (practical collisions since 2004) but remains common for file integrity and for matching hashes handed out by older systems. This page implements MD5 by hand rather than calling a library, and the classic failure mode of such code is padding length (missing a whole block at exactly 56 bytes); the 55/56/64 cases were tested specifically to rule that out. For collision resistance use SHA-256.

How this was measured: Eight inputs (empty, abc, Chinese, emoji, 55/56/64-byte padding boundaries, a long sentence) were hashed and the MD5 / SHA-1 / SHA-256 / SHA-384 / SHA-512 / CRC32 values displayed by the page compared character by character with Python hashlib and zlib.crc32. · Measured 2026-10-28

How to Use

  1. Open the Hash Text tool
  2. Paste the text to hash in the input field
  3. Automatically computes and displays MD5, SHA-1, SHA-256, SHA-512, and more
  4. Supports file hashing: switch to File mode and upload a file
  5. Click the copy button next to any hash value

Use Cases

  • File integrity check — Compare a downloaded file's SHA-256 against the publisher's announced value to confirm it has not been tampered with.
  • Password preprocessing — Useful with a salt, but for password storage prefer bcrypt (see our Bcrypt Hash tool).
  • Git commit verification — Git identifies commits by SHA-1; this tool lets you manually recompute and verify a commit's content hash.
  • API request signing — Combine with HMAC (see our HMAC Generator) to produce signed API requests.
  • Deduplication and cache keys — Use a content hash as a cache key — identical content stores only once.
  • File integrity verification — Compute SHA-256 hashes of downloaded files and compare against the publisher's checksum to detect corruption or tampering.
  • Avalanche effect demo — Demonstrate how even a single-character change in input produces a completely different hash output for educational purposes.

FAQ

Is SHA-1 still safe?

Not for cryptographic purposes (Google demonstrated a collision in 2017), but it remains acceptable for non-adversarial uses like checksums and Git commit IDs.

SHA-256 vs SHA-512 — which is safer?

Both are secure. SHA-512 outputs longer hashes (128 hex chars vs 64) but is slightly slower. SHA-256 is sufficient for nearly all use cases.

Why no MD5?

MD5 was broken in 2004 (Wang Xiaoyun et al.) and should not be used in any new code. Modern browsers also no longer expose MD5 in Web Crypto API.

Will the same input always produce the same hash?

Yes. Hash functions are deterministic — the same input always yields the same output, which is exactly why they work for verification.

Can I reverse a hash back to the original text?

No. Hashes are one-way. However, short or weak inputs are vulnerable to dictionary or rainbow-table attacks — which is why password storage uses bcrypt + salt.

Why does the same password hash differently each time?

Because a salt was added. Hashing itself is deterministic, but password schemes generate a random salt per registration and hash it together with the password, so identical passwords produce different digests — defeating rainbow tables and same-password linkage. The salt is stored with the hash (e.g., bcrypt's salt prefix) and reused on verify. If results differ and the format shows no salt, the likely cause is a byte-level mismatch like differing encoding or a trailing newline, so normalize to UTF-8 and retry.

Why does the same text hash differently across tools?

Usually an encoding or whitespace difference: UTF-8 vs UTF-16, capitalization, a trailing newline, or leading/trailing spaces all alter the bytes fed to the hash and therefore the digest. For example a file saved in Windows Notepad may carry a BOM or CRLF line endings, which differ byte-for-byte from Linux LF. Inspect the input as hex to confirm the bytes are identical, then normalize to UTF-8 with LF newlines — every tool then returns the same digest.

The hash is identical for the same text every time — is that insecure?

Hash functions are deterministic by design; identical input must produce identical output, which is what makes them useful for integrity checks. The risk is using a raw password hash without a salt: salting makes the same password hash differently per user, defeating rainbow tables.