Hash Generator (MD5, SHA-1, SHA-256)

Compute MD5, SHA-1, and SHA-256 hashes of any text. Everything runs in your browser, nothing you type is sent anywhere.

What a hash function does

A hash function takes input of any length and produces a fixed-length fingerprint. Hashing a single word and hashing an entire book both yield 64 hexadecimal characters with SHA-256.

Three properties make hashes useful:

Because a fixed-size output cannot uniquely represent unlimited inputs, collisions (two inputs sharing a hash) must mathematically exist. A secure hash function makes finding one computationally infeasible.

Which algorithm to use

AlgorithmOutputStatusAppropriate for
MD5128 bit, 32 hex charsBrokenNon-security checksums, legacy compatibility
SHA-1160 bit, 40 hex charsBrokenLegacy systems, Git object IDs
SHA-256256 bit, 64 hex charsSecureIntegrity checks, signatures, general use

MD5 was broken in 2004. Collisions can now be generated in seconds on ordinary hardware, and researchers have demonstrated colliding files with different content. It remains widely used for file checksums where the concern is accidental corruption rather than deliberate attack.

SHA-1 fell in 2017, when Google and CWI demonstrated the SHAttered attack producing two different PDFs with the same SHA-1 hash. It has been deprecated for certificates since then, though Git still uses it for object identifiers, where an attacker-supplied collision is not the primary threat model.

SHA-256 has no known practical attacks and is the current default for integrity verification, digital signatures, and blockchain work. Use it unless a specific system requires otherwise.

Never use these for passwords

This is the most important warning on the page. MD5, SHA-1, and plain SHA-256 are all unsuitable for storing passwords, and using them is a serious security defect.

The reason is counterintuitive: these algorithms are too fast. Modern GPUs compute billions of SHA-256 hashes per second. An attacker who obtains a database of SHA-256 password hashes can test entire dictionaries and common password lists in minutes.

Password hashing needs algorithms that are deliberately slow and memory-hard:

These take a configurable amount of work per hash, turning an attacker's billions of attempts per second into a few thousand. They also incorporate a per-password salt automatically, which defeats precomputed rainbow tables.

Examples

InputAlgorithmHash
helloMD55d41402abc4b2a76b9719d911017c592
helloSHA-1aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
helloSHA-2562cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
(empty string)MD5d41d8cd98f00b204e9800998ecf8427e

The empty-string MD5 is worth recognizing. Seeing d41d8cd98f00b204e9800998ecf8427e in logs or a file listing usually means an empty file or a variable that was never populated.

Common use cases

Verifying downloads

Projects publish a SHA-256 hash alongside their release files. Hashing the downloaded file and comparing confirms it arrived intact and was not tampered with. If the published hash is only MD5, it still catches transmission errors but offers no protection against a deliberately modified file.

Deduplication

Storage systems hash file contents to identify duplicates without comparing files byte by byte. Since identical content produces identical hashes, matching hashes flag candidates for deduplication.

Cache keys and ETags

Web servers hash response bodies to generate ETags, letting a browser skip re-downloading unchanged content. Build systems hash inputs to decide whether a step needs re-running.

Git commits

Git identifies every object by the SHA-1 hash of its contents. This is why commit IDs look like a3f5c9e, they are the first characters of a hash. It also means Git history is tamper-evident: changing any past commit changes its hash and every hash after it.

Frequently asked questions

Can a hash be decoded back to the original text?

No. Hashing is one-way by design. Sites claiming to "decrypt" MD5 are really looking up precomputed tables of common inputs, which works for short or common strings only.

Should I use MD5 for passwords?

No. Never use MD5, SHA-1, or plain SHA-256 for password storage. Use Argon2id, bcrypt, or scrypt, which are deliberately slow and salted.

Why does MD5 still exist if it is broken?

Because it remains adequate for detecting accidental corruption, is very fast, and is embedded in a great deal of legacy software. Broken means an attacker can construct collisions, not that it fails at catching random transmission errors.

What is a hash collision?

Two different inputs producing the same hash. Collisions must exist mathematically, but a secure algorithm makes finding them infeasible. For MD5 and SHA-1 they can now be constructed deliberately, which is what "broken" means.

What is salting?

Adding a unique random value to each password before hashing, so identical passwords produce different hashes and precomputed tables become useless. Proper password hashing algorithms handle salting automatically.

Is my input sent to a server?

No. Hashing happens in your browser. SHA-1 and SHA-256 use the built-in Web Crypto API, MD5 is implemented in JavaScript on this page because Web Crypto deliberately omits it. Nothing is transmitted or stored.

Related tools