Developer

Hash Generator

Generate SHA-256, SHA-1, MD5 hashes

Loading interactive tool…

Embed this tool on your site

About this tool

Hash Generator computes MD5, SHA-1, SHA-256 and SHA-512 digests of any text, entirely in your browser. Type or paste a string and click Generate hashes; all four digests appear together in lowercase hexadecimal, each with its own copy button. The text is hashed as UTF-8 bytes, and empty input is valid. SHA-family hashes use the Web Crypto API (crypto.subtle.digest), the same algorithms OpenSSL and sha256sum implement; MD5 uses a small JavaScript implementation for legacy checksum comparisons. Developers use it to compare a string against a published test vector, generate deterministic cache keys, identify which algorithm produced a known digest by its length, or see the avalanche effect — a one-character change produces a completely different digest. The tool hashes text only; to hash a file, use File Hash Multi.

Why use it

  • All Four Algorithms Side by Side: MD5, SHA-1, SHA-256 and SHA-512 are computed together on each click. You can compare digest lengths, confirm which algorithm matches a known checksum, or choose the right algorithm without switching tools.

  • Web Crypto API Accuracy for SHA Hashes: SHA-256 and SHA-512 use the browser's native SubtleCrypto implementation — the same cryptographic primitive used in TLS 1.3 and code-signing workflows — so the output is guaranteed to match OpenSSL and other production libraries.

  • Avalanche Effect Demonstration: Change a single character, click Generate hashes again, and all four digests change completely. This makes the tool useful for understanding hash properties, teaching cryptography concepts, or checking that a hash implementation is sensitive to input changes.

  • Zero Network Exposure for Sensitive Strings: Passwords, secret keys, and private identifiers never leave the browser. Unlike server-side hash APIs, the tool has no log files, no request history, and no network traffic to intercept — the hash computation is entirely local.

  • Checksum Checks for Strings: Paste a string whose digest is published — a test vector, a config value or the input to an API signature — and compare the computed digest character by character. For downloaded files, use File Hash Multi.

  • Deterministic Cache and Shard Key Generation: Hashing a canonical string representation of a resource — a URL, a database row key, or a config blob — produces a fixed-length deterministic identifier suitable for cache keys, consistent hashing rings, or distributed shard routing.

How to use

  1. Type or paste the text you want to hash into the Text to hash box.
  2. Click 'Generate hashes' — SHA-256, SHA-1, SHA-512 and MD5 digests appear together.
  3. Click 'Copy SHA-256', 'Copy SHA-1', 'Copy SHA-512' or 'Copy MD5' to copy just that digest.
  4. After editing the text, click Generate hashes again to refresh all four digests.
  5. Compare the displayed hash against a published checksum by pasting the expected value beside it — character-level differences are visible at a glance.
  6. Click Clear to empty the text box and all four results.

When it helps

  • Checking that a string hashes to a published SHA-256 or MD5 test vector.
  • Generating a deterministic identifier for a cache key by hashing a canonical URL or resource descriptor.
  • Checking whether a stored MD5 or SHA-1 hash in a legacy database matches the expected value for a given string.
  • Experimenting with the avalanche effect to understand why even a one-character change produces a completely different hash.
  • Producing a lowercase hex digest of a token or ID to compare against a value stored in logs or a database.
  • Quickly identifying which hashing algorithm was used to produce an unknown digest by comparing output lengths and formats.

Examples

SHA-256 and MD5 of a simple string

Input
hello world
Expected result
SHA-256: b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
MD5: 5eb63bbbe01eeed093cb22bb8f5acdc3

Demonstrate avalanche effect

Input
hello world, then hello World (capital W)
Expected result
SHA-256 of 'hello world': b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9
SHA-256 of 'hello World': db4067cec62c58bf8b2f8982071e77c082da9e00924bf3631f3b024fa54e7d7e

Verify a published MD5 checksum

Input
The quick brown fox jumps over the lazy dog
Expected result
MD5: 9e107d9d372bb6826bd81d3542a419d6
Matches the reference MD5 for this pangram — confirming correct implementation.

Tips

  • When comparing a hash against a published checksum, paste both into adjacent text areas and scan from left to right — a single differing hex character will stand out immediately.
  • To replicate sha256sum output on a string in the terminal, use echo -n 'your text' | sha256sum — the -n flag prevents echo from adding a trailing newline that would change the hash.
  • MD5 is still useful for non-security purposes like generating cache-buster suffixes or quick file change detection in build systems where speed matters more than cryptographic strength.
  • The length of a hex digest tells you the algorithm: 32 chars = MD5, 40 = SHA-1, 64 = SHA-256, 128 = SHA-512.
  • To explore how small changes affect a digest, keep a template string in the box, change one part, and click Generate hashes after each edit.

Frequently Asked Questions

Is MD5 safe to use for password storage?
No. MD5 (and SHA-1) are cryptographically broken for password hashing purposes. They are fast to compute, which makes brute-force and rainbow-table attacks practical. For password storage, use a slow, salted algorithm like bcrypt, scrypt, or Argon2.
What is the difference between SHA-256 and SHA-512?
Both are members of the SHA-2 family and are considered secure. SHA-256 produces a 256-bit (64 hex character) digest; SHA-512 produces a 512-bit (128 hex character) digest. SHA-512 is marginally stronger and may be faster on 64-bit processors, but SHA-256 is more widely used in practice.
Why does my hash not match the expected value?
The most common causes are trailing whitespace or a newline at the end of the input, a different character encoding (UTF-8 vs Latin-1), or uppercase vs lowercase hex output. Ensure the input is identical — including encoding — to what was hashed originally.
Can two different inputs produce the same hash (collision)?
In theory, yes — hash functions map infinite inputs to finite output spaces. In practice, SHA-256 and SHA-512 have no known practical collision attacks. MD5 and SHA-1 do have known collision vulnerabilities and should not be used for security-critical purposes.
Can I hash binary data or files with this tool?
No. The text box is hashed as the UTF-8 bytes of the string you type. To hash a file's raw bytes, use File Hash Multi, which reads the file locally and gives the same result as sha256sum.
Is HMAC the same as a regular hash?
No. HMAC (Hash-based Message Authentication Code) is a hash computed over both the message and a secret key using a specific construction. A plain hash has no key. HMAC is used to verify both integrity and authenticity; a regular hash verifies integrity only.
Are hashes reversible?
No. Hash functions are one-way by design. Given a hash output, you cannot mathematically reverse it to recover the original input. What attackers do is pre-compute hashes for common inputs (rainbow tables) and look up matches — which is why salting passwords before hashing is essential.
Why does the SHA-256 hash computed here match sha256sum on Linux?
The tool uses the browser's SubtleCrypto.digest('SHA-256', ...) API with the UTF-8 byte representation of your string, which produces the same result as echo -n 'your string' | sha256sum (note the -n flag, which omits the trailing newline that echo adds by default).

Explore the category

Glossary

Hash Function
A deterministic function that maps input data of any size to a fixed-size output (digest). Cryptographic hash functions are designed to be one-way and collision-resistant.
SHA-256
A member of the SHA-2 family that produces a 256-bit digest. Widely used in TLS certificates, code signing, Bitcoin, and Git object storage. Considered cryptographically secure.
MD5
A legacy hash algorithm producing a 128-bit digest. Fast and widely supported but cryptographically broken — practical collision attacks exist. Safe for checksums, not for security.
Avalanche Effect
The property of a hash function where a single-bit change in input causes approximately 50% of the output bits to change, making output appear completely different.
Hex Digest
The hash output encoded as a lowercase hexadecimal string, where each byte is represented as two hex characters (00–ff).
Collision
Two different inputs that produce the same hash output. Cryptographically strong hash functions are designed to make finding collisions computationally infeasible.
A LITTLE HELP. A LOT DONE.
Good tools.
Great flow.

Your shortcut to the everyday. Create, convert, calculate,
and get back to what you love.

✓ Free to use✓ No sign-up✓ 500+ possibilities