Hash generator

Generate MD5 and SHA hashes of any text, and check a value against an expected checksum.

Input
MD5Broken
SHA-1Broken
SHA-256
SHA-384
SHA-512

What a hash function actually does

A cryptographic hash function takes an input of any size and produces a fixed-length string of bytes — a digest, or "hash". Feed it one letter or an entire novel and MD5 always returns 16 bytes, SHA-256 always returns 32. The same input always produces the same digest, and changing a single bit anywhere in the input changes roughly half the bits of the output, which is why two nearly identical files have completely unrelated hashes.

The crucial property is that the function only runs one way. Computing the hash of a file is fast; recovering the file from its hash is not merely slow but impossible in principle, because a fixed-length output cannot encode an unbounded input. A hash is a fingerprint, not an encrypted copy — there is nothing to decrypt.

What people actually use hashes for

  • Verifying downloads: a project publishes the SHA-256 of a release, you hash the file you received, and matching digests mean the bytes arrived intact.
  • Detecting change: version control, backup and deduplication systems compare hashes instead of whole files, because comparing 32 bytes is far cheaper than comparing gigabytes.
  • Subresource Integrity: a web page pins the Base64 hash of a script it loads from a CDN, and the browser refuses to run the file if it does not match.
  • Storing passwords — but with a purpose-built slow function, never a plain hash. See below.

Notice what these have in common: the hash is a compact stand-in for something larger, used to answer "is this the same thing I expected?" without transmitting or storing the thing itself.

MD5 and SHA-1 are broken — what that means in practice

A hash function is considered broken once someone can construct a collision: two different inputs producing the same digest. MD5 collisions have been computable on ordinary hardware since 2004, and in 2017 the SHAttered attack produced two different PDF files with an identical SHA-1 hash. Both algorithms are marked in this tool for that reason.

The practical consequence is narrower than "never use them". A collision means an attacker who controls both files can make a malicious one match a benign one's digest, so MD5 and SHA-1 can no longer prove that a file has not been tampered with by someone hostile. They are still perfectly serviceable for detecting accidental corruption — a truncated download, a flipped bit on a disk — and you will keep meeting them in legacy systems, ETag headers and older package manifests that are not going to be rewritten.

The rule of thumb: if the question is "did this get damaged in transit?", MD5 is fine. If the question is "did someone replace this on purpose?", use SHA-256 or better.

Never hash a password with these

MD5, SHA-1 and even SHA-256 are designed to be fast, and speed is exactly the wrong property for storing passwords. A modern GPU computes billions of SHA-256 hashes per second, so a stolen database of plain hashed passwords can be attacked at enormous scale — and because the same password always produces the same digest, precomputed tables make it cheaper still.

Password storage needs a deliberately slow, salted, memory-hard function: Argon2id, scrypt, or bcrypt. They add a unique random salt per password, so identical passwords do not share a digest, and they are tunably expensive, so each guess costs an attacker real time and memory. This tool is for checksums and fingerprints, not for password hashing.

Reading and comparing digests

The same digest can be written in more than one way. Lowercase hexadecimal is what the standard command-line tools print, and it is what you will usually be comparing against:

md5sum file.iso                  # Linux
sha256sum file.iso               # Linux
shasum -a 256 file.iso           # macOS
Get-FileHash file.iso -Algorithm SHA256   # PowerShell (prints uppercase)
certutil -hashfile file.iso SHA256        # Windows (prints uppercase)

Hex case carries no meaning — PowerShell and certutil print uppercase, the Unix tools print lowercase, and the two are the same value. The compare box in this tool ignores hex case for that reason. Base64 is a different matter: it is a denser encoding of the same bytes, used by Subresource Integrity and various APIs, and there case is significant, so it is compared exactly.

One last habit worth forming: never eyeball two long digests to decide whether they match. The human eye is very good at seeing what it expects, and the first and last few characters agreeing means nothing. Paste the expected value in and let the comparison be exact.

Frequently asked questions

Is my text sent to a server?
No. Every digest is computed in your browser — the SHA family through the Web Crypto API and MD5 through JavaScript running on your own machine. Nothing you type leaves your device.
Can a hash be reversed to get the original text back?
No. A hash is a fixed-length fingerprint, not an encrypted copy, and the original cannot be recovered from it. Sites advertising "MD5 decryption" are looking your hash up in a table of previously computed common inputs, which only works for short or predictable text.
Why do MD5 and SHA-1 carry a warning here?
Because collisions are practical for both: two different inputs can be constructed to share a digest. That makes them unsuitable for proving a file has not been deliberately tampered with, though they remain fine for catching accidental corruption.
Which algorithm should I use?
SHA-256 is the sensible default and what most projects publish today. SHA-512 is not meaningfully more secure for this purpose but is faster on 64-bit hardware. Use MD5 or SHA-1 only when something you do not control already requires them.
Can I hash a password with this?
You can, but you should not store the result. Password storage needs a slow, salted function such as Argon2id, scrypt or bcrypt — fast hashes like these are exactly what makes stolen password databases easy to crack.
Why do the hashes change when I add a space or a line break?
Because whitespace is part of the input. A trailing newline is the single most common reason a hash does not match what you expected — text copied from a terminal or an editor often carries one you cannot see.
Does it handle Hebrew, Arabic and emoji correctly?
Yes. Text is encoded as UTF-8 bytes before hashing, which is the standard every other tool uses, so hashing "שלום" or an emoji here gives the same digest as md5sum or sha256sum on a UTF-8 file containing the same characters.
Why does it hash text but not files?
Web Crypto has no streaming digest API, so a file has to be read into memory in full before it can be hashed, and the hand-written MD5 would be noticeably slow on a large one. Text hashing covers the common case honestly rather than offering file hashing that stalls the page.