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

Same input across algorithms — note the fixed output lengths
Input
hello world
Output
MD5:     5eb63bbbe01eeed093cb22bb8f5acdc3
SHA-1:   2aae6c35c94fcfb415dbe95f408b9ce91ee846ed
SHA-256: b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
A one-character change alters the entire hash (avalanche effect)
Input
hello world.
Output
SHA-256: 7509e5bda0c762d2bac7f90d758b5b2263fa01ccbc542ab5e3df163be08e6ca9

Quick Reference

AlgorithmOutput sizeHex charactersSafe for security use?
MD5128 bits32No - practical collisions since 2004
SHA-1160 bits40No - collision demonstrated in 2017
SHA-256256 bits64Yes - current general-purpose default
SHA-384384 bits96Yes
SHA-512512 bits128Yes - faster than SHA-256 on 64-bit CPUs
bcrypt / Argon2idVariesn/aPasswords 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

Related Tools

More from Developer Tools: