Guide

How Hashing Works (MD5, SHA-256 and When to Use Each)

Understand what a hash is, how MD5 and SHA-256 differ, and the safe vs unsafe uses of each.

A hash generator computes a fixed-length fingerprint of input text using a hash function. The same input always produces the same hash; a tiny change in input produces a wildly different hash. Hashes are used for integrity checks, fingerprinting, and — when the right algorithm is chosen — password storage.

What a hash is

A cryptographic hash function takes input of any size and returns a fixed-size string. Good hash functions are one-way (you cannot reverse them to the input), deterministic (same input, same output), and avalanche (a one-bit change flips roughly half the output bits).

MD5 vs. SHA-256

MD5 produces a 128-bit hash and is fast, but it is no longer collision-resistant — two different inputs can be found that share a hash. Use MD5 only for non-security tasks like file checksums. SHA-256 produces a 256-bit hash and is still considered secure; use it for integrity checks, digital signatures, and password hashing (with a slow, salted scheme like bcrypt or Argon2 for passwords).

How to use a hash generator

  1. Paste the text to hash.
  2. Choose the algorithm (MD5 or SHA-256).
  3. Copy the resulting hash.

Examples

The text "hello" has MD5 hash 5d41402abc4b2a76b9719d911017c592 and SHA-256 hash 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824. Change one letter to "Hello" and both hashes change completely — the avalanche effect in action.

When a hash generator is useful

  • Verifying file or message integrity.
  • Generating fingerprints for deduplication.
  • Creating checksums for downloads.
  • Demonstrating or learning how hash functions behave.

Safety note

Never store passwords as plain MD5 or SHA-256 hashes — they are too fast and vulnerable to brute force. Use a dedicated password-hashing algorithm (bcrypt, scrypt, Argon2) with a unique salt per password.

Put it into practice

Use the Hash Generator right now — free, in your browser, no sign-up required.

Try the Hash Generator