Hash Generator

Hash Generator

Generate MD5, SHA-1, SHA-256, and SHA-512 hashes from text.

What the Hash Generator Does

A hash function turns any input — a word, a password, a whole file of text — into a fixed-length string that works as a fingerprint of that data. The same input always produces the same hash, and any change at all to the input produces a completely different one, which is what makes hashes useful for checking that data has not been corrupted or altered. That is why a hash creator is closer to a fingerprint machine than an encoder: run the same text through this hash calculator twice and you get the identical result both times.

This online hash generator computes MD5, SHA-1, SHA-256 and SHA-512 for any text at once, in your browser. As a SHA hash generator it covers all three SHA variants alongside MD5, so you do not need a separate tool for each.

How to Use the Hash Generator

What Is a Hash?

When You Would Use This

Worked Example

Input: Hello, World!

AlgorithmHash of Hello, World!
MD565a8e27d8879283831b664bd8b7f0ad4
SHA-10a0a9f2a6772942557ab5355d76af442f8f65e01
SHA-256dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f
SHA-512374d794a95cdcfd8b35993185fef9ba368f160d8daf432d08ba9f1ed1e5abe6cc69291e0fa2fe0006a52570ef18c19def4e617c33ce52ef0a6e5fbe318cb0387

Each algorithm returns a completely different length and value from the same input, and changing a single character — dropping the exclamation mark, say — would change all four hashes entirely, with no visible relationship between the old and new values. That is the avalanche effect, and it is what makes a hash a reliable way to spot even the smallest change in data.

Hashing in Code

JavaScript — SHA-256 via the Web Crypto API

async function sha256(text) {
  const data = new TextEncoder().encode(text);
  const hashBuffer = await crypto.subtle.digest("SHA-256", data);
  return Array.from(new Uint8Array(hashBuffer))
.map(b => b.toString(16).padStart(2, "0"))
.join("");
}

Command Line

echo -n "Hello, World!" | md5sum
echo -n "Hello, World!" | shasum -a 256

Do’s and Don’ts

Do

Use SHA-256 or SHA-512 for any checksum or integrity check that matters.

Compare two hashes exactly, character for character — a single differing character means the data is different.

Verify the integrity of downloaded or transferred files with a hash.

Treat a hash as a fingerprint of data, not as a way of storing or retrieving it.

Don’t

Use MD5 or SHA-1 for anything security-critical — passwords, digital signatures or similar.

Expect a hash to be “decoded” back to the original text. It is one-way by design.

Store passwords with a plain hash function such as MD5 or SHA-256 — use bcrypt, scrypt or Argon2, which are built for the job.

Confuse hashing with encryption. Encryption can be undone with a key; hashing cannot be undone at all.

Common Mistakes

Good to Know

Frequently Asked Questions

What’s the difference between MD5, SHA-1, SHA-256 and SHA-512?

They are different hashing algorithms producing different output lengths and offering different security. MD5 (128-bit) and SHA-1 (160-bit) are old and broken for security work; SHA-256 (256-bit) and SHA-512 (512-bit) are the current secure choices.

Can I reverse a hash back into the original text?

No. Hashing is a one-way function by design — the original input cannot be recovered from the hash.

Is hashing the same as encryption?

No. Encryption can be undone with the right key; hashing cannot be undone at all. They solve different problems: encryption is for confidentiality, hashing is for integrity.

Why shouldn’t I use MD5 for passwords?

MD5 is fast, was never designed to resist brute force, and has known collision weaknesses. For stored passwords use a deliberately slow, salted algorithm such as bcrypt, scrypt or Argon2.

Why do different algorithms produce different length outputs?

Each algorithm is designed around a fixed output size — 128 bits for MD5, 160 for SHA-1, 256 for SHA-256 and 512 for SHA-512 — no matter how long the input is.

How do I verify a downloaded file is authentic?

Hash the file with the same algorithm the publisher used, usually SHA-256, and compare your output with theirs character for character. If they match, the file has not been corrupted or altered.