Cryptographic Hash Generator
Generate secure cryptographic checksums and hashes (SHA-256, SHA-512, SHA-384, SHA-1) directly in your browser using the Web Crypto API.
Generated Cryptographic Hashes (Client-Side WebCrypto)
What Cryptographic Hash Generator Does
A cryptographic hash turns input of any length into a fixed-length digest. The same input always produces the same digest, a one-character change produces a completely different one, and the function cannot be run backwards to recover the input.
That last property is what people mean by "one-way", and it is frequently overstated. A hash cannot be reversed by computation, but it can be reversed by lookup: if the input is a common password, an attacker simply hashes a dictionary and compares. This is why hashing a password with SHA-256 is not password storage.
This tool computes SHA-1, SHA-256, SHA-384 and SHA-512 in your browser with the Web Crypto API. SHA-1 is included for compatibility with legacy systems, not because it is safe. MD5 is not offered: Web Crypto does not implement it, and it appears in the table below for reference only.
How to Use Cryptographic Hash Generator
- Type or paste your text or secret into the input box
- View the generated SHA-256, SHA-512, SHA-384, and SHA-1 hashes
- Click Copy Hash next to any algorithm to copy it to your clipboard
How Cryptographic Hash Generator Works
How the digest is produced
text → UTF-8 bytes → crypto.subtle.digest(algorithm, bytes) → each byte as two lowercase hex digits
- UTF-8 bytes
- The text is encoded with TextEncoder first, so "é" is hashed as the two bytes C3 A9. The same text in another encoding (UTF-16, Latin-1) gives a different digest.
- algorithm
- SHA-1, SHA-256, SHA-384 or SHA-512, as specified in NIST FIPS 180-4. All four are computed on every keystroke.
- hex digest
- The raw digest is 20, 32, 48 or 64 bytes. Written as hex, that is 40, 64, 96 or 128 characters.
Worked example
Input: hello (five lowercase letters, no trailing newline)
- UTF-8 bytes: 68 65 6c 6c 6f
- SHA-256 of those 5 bytes gives a 32-byte digest
- Written as hex: 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
- Change one letter to Hello and the SHA-256 digest becomes 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969, with no visible relation to the first
Result: SHA-256("hello") = 2cf24dba…938b9824 (64 hex characters). SHA-1 of the same input is aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d (40 characters).
Algorithm Status
"Broken" means practical collisions have been demonstrated: two different inputs producing the same digest. It does not mean the digest can be reversed, but it does mean the hash can no longer prove that two files are the same.
| Algorithm | Digest size | Hex length | Status |
|---|---|---|---|
| MD5 | 128 bits | 32 | Broken. Collisions found in 2004; generated in seconds today |
| SHA-1 | 160 bits | 40 | Broken. First public collision (SHAttered) in 2017 |
| SHA-256 | 256 bits | 64 | Secure. The general-purpose default |
| SHA-384 | 384 bits | 96 | Secure. SHA-512 truncated, resists length-extension |
| SHA-512 | 512 bits | 128 | Secure. Often faster than SHA-256 on 64-bit hardware |
| SHA-3 (Keccak) | 224–512 bits | varies | Secure. Different internal construction, kept as a hedge |
Choosing by Purpose
The right function depends entirely on what you are defending against.
| Purpose | Use | Do not use |
|---|---|---|
| Verifying a download | SHA-256 | MD5 — a tampered file can be made to match |
| Storing passwords | Argon2id, scrypt or bcrypt | Any SHA — they are designed to be fast, which helps the attacker |
| Signing / certificates | SHA-256 or better | SHA-1 — rejected by browsers since 2017 |
| Deduplication, cache keys | SHA-256, or MD5 if no adversary exists | |
| Message authentication | HMAC-SHA-256 | A bare hash of key + message |
How to Read Your Result
Why SHA-256 is wrong for passwords
Password hashing needs to be slow. SHA-256 is engineered to be fast, and modern GPUs compute billions per second, so an attacker with a leaked database tests a huge dictionary in hours. Argon2id, scrypt and bcrypt deliberately consume time and memory per guess, and their cost can be raised as hardware improves. They also salt each password, so identical passwords do not produce identical hashes.
What a collision actually breaks
A collision means an attacker can produce two files with the same digest. The practical damage is to any use where a hash stands in for identity: a signed contract swapped for a different one, a verified installer replaced with a modified build. It does not let anyone recover the original input, which is why MD5 is still tolerable for non-adversarial deduplication.
Length extension
MD5, SHA-1 and SHA-256 share a construction that lets someone who knows hash(secret + message) compute hash(secret + message + extra) without knowing the secret. That is why naive "hash the key and the message together" authentication is unsafe, and why HMAC exists. SHA-384, SHA-512/256 and SHA-3 are not affected.
Limitations & Accuracy Notes
- Hashing here happens in your browser and nothing is transmitted. Even so, treat pasting live secrets into any web page as a habit worth avoiding.
- A hash proves integrity only if you obtained the expected digest through a trusted channel. A checksum published on the same page as the download it verifies protects against corruption, not against a compromised server.
- SHA-1 is offered for compatibility with systems that still require it. Do not choose it for anything new. MD5 is not available here because the browser's Web Crypto API does not implement it.
- A trailing newline or space changes the digest completely. Command-line tools such as echo add a newline unless told not to (echo -n), which is the usual reason a digest here does not match one from a terminal.
- These are unkeyed hashes. They tell you a file has not changed; they do not tell you who produced it. That requires a signature or an HMAC.
Frequently Asked Questions
What is a cryptographic hash function?
A hash function transforms arbitrary input text into a fixed-length string of hexadecimal characters. It is a one-way mathematical function designed to be impossible to reverse.
Is it safe to generate hashes online?
Yes, our Hash Generator uses the browser-native Web Crypto API, processing all data 100% locally on your device without sending text over the internet.
Why does the same input always produce the same hash?
Hash functions are deterministic by design: identical input always produces identical output, which is exactly what makes them useful for verifying a file or message has not changed.
Is MD5 still safe to use?
No. MD5 is cryptographically broken; researchers can deliberately craft different inputs that produce the same hash. It should not be used for security purposes like password storage, though it can be fine for simple non-security checksums.
Can a hash be reversed?
Not by computation, because hashing is one-way by design. What is possible is guessing: hashing candidate inputs until one matches. For short or common inputs that is fast, which is why precomputed rainbow tables exist and why salting matters.
Should I use MD5 or SHA-1?
Not for anything security-related. Practical collision attacks exist against both, meaning two different inputs can be constructed to produce the same digest. They remain fine as checksums for detecting accidental corruption in a download, and that is the only use worth keeping them for.
Which algorithm should I use instead?
SHA-256 is the sensible default for general integrity and signing use. For password storage, no general-purpose hash is appropriate however modern: passwords need a deliberately slow function such as bcrypt, scrypt or Argon2, which are designed to make guessing expensive.
Why do I get a different hash than another tool?
Usually a difference in exactly what was hashed. A trailing newline, a different character encoding, or hashing a file versus hashing the text inside it all produce completely different digests, because a hash changes entirely when one bit of input changes.
Is my input sent to a server?
No. Hashing runs in your browser using the Web Crypto API.
What is a salt and why does it matter?
A salt is a unique random value combined with each input before hashing. It means identical passwords produce different digests, which defeats precomputed tables and stops an attacker learning that two users share a password. A salt is not a secret; it is stored alongside the hash.
References & Further Reading
- NIST FIPS 180-4 — Secure Hash Standard (SHA-1, SHA-2 family) — Normative specification of SHA-1 through SHA-512
- NIST FIPS 202 — SHA-3 Standard — The Keccak-based permutation family