Hash Generator
Generate SHA-1, SHA-256, SHA-384, and SHA-512 hashes from text. Uses browser's Web Crypto API for secure hashing.
What is Hash Generator?
A hash generator creates fixed-length cryptographic digest values (fingerprints) from input text using algorithms like MD5, SHA-1, SHA-256, and SHA-512. Hash functions have a critical property: the same input always produces the same hash, but it's computationally infeasible to reverse the hash back to the original input or to find two different inputs that produce the same hash. This makes them essential for password storage, data integrity verification, file deduplication, digital signatures, and checksums.
How It Works
Enter your text and select a hash algorithm. The tool converts your text to bytes (using UTF-8 encoding), then processes those bytes through the selected cryptographic hash function using the Web Crypto API. The algorithm performs a series of mathematical operations (bitwise operations, modular addition, compression functions) that produce a fixed-size output regardless of input length. MD5 produces 128-bit hashes (32 hex characters), SHA-256 produces 256-bit hashes (64 hex characters). The same input always gives the same hash, but even a one-character change produces a completely different output.
Examples
hello world
MD5: 5eb63bbbe01eeed093cb22bb8f5acdc3 SHA-1: 2aae6c35c94fcfb415dbe95f408b9ce91ee846ed SHA-256: b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
hello world.
SHA-256: 7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9
Quick Reference
| Algorithm | Output size | Hex characters | Safe for security use? |
|---|---|---|---|
| MD5 | 128 bits | 32 | No - practical collisions since 2004 |
| SHA-1 | 160 bits | 40 | No - collision demonstrated in 2017 |
| SHA-256 | 256 bits | 64 | Yes - current general-purpose default |
| SHA-384 | 384 bits | 96 | Yes |
| SHA-512 | 512 bits | 128 | Yes - faster than SHA-256 on 64-bit CPUs |
| bcrypt / Argon2id | Varies | n/a | Passwords only - deliberately slow and salted |
Common Use Cases
- •Generating file checksums to verify data integrity after downloads or transfers
- •Creating hashed passwords for development and testing (never use MD5/SHA for production password hashing — use bcrypt)
- •Computing content hashes for cache invalidation and deduplication systems
- •Generating deterministic identifiers from text data for database lookups
- •Verifying that configuration files haven't been tampered with using SHA-256 checksums
- •Creating HMAC signatures for API authentication and webhook verification
Frequently Asked Questions
Is the hashing secure?▼
Yes, it uses the Web Crypto API (crypto.subtle.digest) which provides cryptographically secure hash functions.
Which hash algorithm should I use?▼
SHA-256 is the sensible default for integrity checking and general use. MD5 and SHA-1 are both cryptographically broken — practical collision attacks exist for each — so restrict them to non-security uses such as cache keys or checksums against accidental corruption. Never select a hash for password storage on this basis; see the next answer.
Can I use this to hash passwords?▼
No, and this is important. General-purpose hashes are designed to be fast, which is exactly wrong for passwords because it lets an attacker try billions of guesses per second. Password storage needs a deliberately slow, salted algorithm such as bcrypt, scrypt or Argon2id, with Argon2id the current recommendation.
Is hashing reversible?▼
Not mathematically — a hash discards information, so there is no decrypt operation. It can still be defeated by guessing: common passwords and short strings are readily found in precomputed rainbow tables. Hashing is not encryption and provides no confidentiality for low-entropy input.
What is a hash collision and does it matter?▼
A collision is two different inputs producing the same hash. Because the output is a fixed size, collisions must exist; what matters is whether anyone can construct one deliberately. For MD5 and SHA-1 they can, cheaply, which is why those algorithms are unfit for signatures or certificates. No practical collision is known for SHA-256.
Why does my hash not match the checksum published by a project?▼
Usually one of three reasons: a different algorithm than the one published, hashing the text of a file rather than its raw bytes, or an invisible difference in the input such as a trailing newline or Windows line endings. Confirm the algorithm and hash the exact bytes.
Does the length of my input change the length of the hash?▼
No. Each algorithm always produces a fixed-size output: MD5 gives 128 bits (32 hex characters), SHA-1 gives 160 bits (40 characters), SHA-256 gives 256 bits (64 characters) and SHA-512 gives 512 bits (128 characters), whether you hash one letter or a gigabyte.
Further Reading
Password Security in 2026: What Actually Matters
Evidence-based password security advice. Learn what makes passwords strong, why length beats complexity, and how to protect your accounts.
3 min readData Encoding Explained: Base64, URL Encoding, and HTML Entities
Understand when and why to use Base64, URL encoding, and HTML entity encoding. Clear explanations with practical examples for web developers.
3 min readRelated Tools
More from Developer Tools:
Base64 Encoder/Decoder
Encode and decode Base64 strings instantly. Free online Base64 converter tool for text and files. Works entirely in your browser.
UUID Generator
Generate random UUID v4 strings instantly. Bulk generate unique identifiers for databases, APIs, and testing. Free online UUID/GUID generator.
Password Generator
Generate strong, random passwords instantly. Customize length, include symbols, numbers, and uppercase letters. Free secure password generator.