Skip to main content
HG

Hash Generator

Generate MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of any text, entirely in your browser.

Did you like the tool? Thanks!
Share:

How to Use Hash Generator

Paste or type any text into the box, tick which algorithms you want, and press Generate hashes. Each result appears as a labelled hex string with its own copy button. SHA-1 through SHA-512 are computed with the browser's built-in WebCrypto API; MD5, which WebCrypto does not provide, is computed with a small hand-written implementation. Nothing you type ever leaves your device.

About Hash Generator

A hash function takes any input — a word, a password, an entire file — and produces a fixed-length string of characters (the "hash" or "digest") that acts like a fingerprint of that input. Change even a single character in the input and the output hash changes completely and unpredictably; feed the same input in twice and you always get the same hash back. That combination of properties makes hashes useful for two quite different jobs: checking that data has not been altered (integrity checking) and, for certain specially-designed algorithms, storing secrets like passwords without keeping the original value anywhere. This tool supports five widely used algorithms. MD5 produces a 128-bit (32 hex character) digest and was, for many years, the default choice for quick checksums because it is fast and simple. SHA-1 produces a 160-bit (40 character) digest and was the mainstream successor to MD5 through the 2000s. SHA-256, SHA-384 and SHA-512 belong to the SHA-2 family, producing 256-bit, 384-bit and 512-bit digests respectively, and are the current standard for anything where hash strength actually matters. A critical point up front: MD5 and SHA-1 are cryptographically broken. Researchers have demonstrated practical collision attacks against both — meaning it is possible to deliberately construct two different inputs that produce the identical hash, undermining any use case that relies on a hash being unique to its input. Google and CWI Amsterdam published a working SHA-1 collision ("SHAttered") in 2017, and MD5 collisions have been achievable on ordinary hardware since the mid-2000s. Neither algorithm should ever be used for password storage, digital signatures, certificate generation, or any other context where an attacker being able to forge a matching hash would cause real harm. This tool includes them anyway because they remain extremely common for legacy, non-adversarial purposes — verifying that a downloaded file was not corrupted in transit, generating a quick cache key, or comparing two local files for equality — where nobody is deliberately trying to produce a collision. For anything security-sensitive, use SHA-256 or stronger. Even then, hashing alone is the wrong tool for storing passwords: a plain SHA-256 hash of a password can still be brute-forced quickly with modern hardware because the algorithm is designed to be fast, which is exactly the wrong property for password storage. Proper password storage uses a deliberately slow, salted algorithm designed for that job specifically — bcrypt, scrypt, or Argon2 — not a general-purpose hash function like the ones in this tool. Use this generator for checksums, file-integrity verification against a known-good published hash, generating short unique identifiers from content, and similar non-adversarial tasks; do not use it to hash passwords, API secrets, or anything an attacker might try to reverse or collide.

Details & Tips

How each algorithm is computed: SHA-1, SHA-256, SHA-384 and SHA-512 are calculated using `crypto.subtle.digest()`, the WebCrypto API built into every modern browser — this is the same implementation browsers use internally, so results match any other correct SHA implementation exactly. WebCrypto calls are asynchronous, so the widget shows a brief "Hashing…" state while the digest is computed; for ordinary text input this typically takes well under a second. MD5 is not part of the WebCrypto standard (it was excluded deliberately because of its known weaknesses), so it is computed instead with a compact, dependency-free JavaScript implementation of the standard RFC 1321 algorithm, producing byte-identical output to any other correct MD5 implementation (openssl md5, PHP's md5(), etc.). Text encoding matters for reproducibility: this tool encodes your input as UTF-8 before hashing, which is the near-universal convention — if you are trying to match a hash generated elsewhere (a command-line tool, another library), make sure that tool is also hashing the UTF-8 bytes of the same exact text, including any trailing whitespace or newline, since a single invisible character will produce a completely different hash. Worked example: hashing the text `hello` produces MD5 `5d41402abc4b2a76b9719d911017c592`, SHA-1 `aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d`, and SHA-256 `2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824`. Use a known input like this to sanity-check that the tool is producing correct output before relying on it for a real comparison. Practical uses that remain appropriate for MD5/SHA-1 despite their cryptographic weakness: quickly checking two local files are byte-identical, generating a short non-secret cache key or ETag, verifying an old published checksum where the publisher only ever offered MD5. Practical uses that require SHA-256 or better: verifying software downloads against a security-conscious project's published checksum, generating content-addressed identifiers where collision resistance matters, comparing hashes in any context where a malicious party might intentionally try to produce a matching pair. Never use any of these five algorithms — including SHA-512 — to store user passwords directly; that is what bcrypt, scrypt and Argon2 exist for.

Frequently Asked Questions

Is MD5 safe to use?
Not for anything security-sensitive. MD5 is cryptographically broken — researchers can deliberately construct two different inputs that produce the same MD5 hash (a "collision"). It is fine for non-adversarial checksums like verifying a file was not corrupted, but must never be used for passwords, signatures, or security verification.
Is SHA-1 safe to use?
Also broken for security purposes. A practical SHA-1 collision was publicly demonstrated in 2017. Like MD5, it remains acceptable for legacy checksums where nobody is trying to forge a match, but SHA-256 or stronger should be used for anything security-related.
Which algorithm should I use if I'm not sure?
SHA-256. It is fast, well-supported everywhere, has no known practical collision attacks, and is the de facto standard for checksums, content addressing, and general-purpose hashing today.
Can I use this tool to hash passwords for storage?
No. None of the algorithms here — including SHA-512 — are appropriate for password storage, because they are designed to be fast, which makes brute-forcing easier. Use a purpose-built slow, salted algorithm like bcrypt, scrypt, or Argon2 instead.
Why do MD5 and SHA-256 produce different-length outputs for the same input?
Each algorithm is designed to always produce a fixed output size regardless of algorithm choice within its family — MD5 always outputs 128 bits (32 hex characters), SHA-256 always outputs 256 bits (64 hex characters) — the output length is a property of the algorithm, not the input.
Is my text uploaded anywhere when I generate a hash?
No. SHA-1 through SHA-512 are computed with your browser's built-in WebCrypto API and MD5 with local JavaScript — both run entirely on your device, with nothing transmitted to a server.
Why is MD5 computed differently from the others?
WebCrypto, the browser API used for SHA-1/256/384/512, deliberately does not include MD5 because of its known weaknesses. This tool implements the standard RFC 1321 MD5 algorithm directly in JavaScript so the option is still available for legacy checksum use.
Will the same input always produce the same hash?
Yes, for a given algorithm, identical input always produces an identical hash — that is a defining property of a hash function. If you get different results, double-check for hidden differences like trailing spaces, different line endings, or different character encoding.
What is a hash collision?
A collision is when two different inputs produce the same hash output. All hash functions have collisions somewhere in theory (there are more possible inputs than possible outputs), but a cryptographically strong hash makes them practically impossible to find deliberately — which is exactly what MD5 and SHA-1 no longer guarantee.
Can I verify a downloaded file's integrity with this tool?
Yes — hash the file's contents (you would need to paste the content as text, or use a dedicated file-hashing tool for binary files) and compare the result against the checksum published by the file's source. Use SHA-256 if the publisher offers it, since it is far more trustworthy than MD5 or SHA-1 for this purpose.
Why does hashing show a brief loading state?
SHA-1 through SHA-512 use the WebCrypto API, which computes digests asynchronously by design (partly so very large inputs do not freeze the page). The widget shows "Hashing…" for that brief moment before results appear.

Part of These Collections

Also Available As

hash generator, md5 generator, sha256 generator, sha1 hash online, checksum generator, sha512 generator, text hash tool

Found a Problem?

Let us know if something with Hash Generator isn't working as expected.

Thanks — we'll take a look.