MentorMakers Login Sign up

Do More with MentorMakers

Free tools. Powerful features. Built for a smarter tomorrow.

  • 129 Free Tools
  • Most tools — no signup
  • Temporary files handled for processing
  • AI Assistant built in
  • Made in Pakistan 🇵🇰
Explore All Tools
Developer Tools & Technical Guides Sep 25, 2026 · 2 min read

What Is a Hash? MD5, SHA-1 and SHA-256 Explained

What hash functions are, the difference between MD5, SHA-1 and SHA-256, and why you should never use the first two for anything security-related.

M By the Mentor Makers team
What Is a Hash? MD5, SHA-1 and SHA-256 Explained

A hash function takes any input — a word, a file, a document — and produces a fixed-length string called a hash or digest. The same input always produces the same hash; any change to the input (even one character) produces a completely different hash. This one-way, deterministic property makes hashes useful for verifying integrity, not for securing data.

The Three Common Hash Algorithms

MD5

  • Output: 128-bit (32 hex characters)
  • Example: MD5("hello") = 5d41402abc4b2a76b9719d911017c592
  • Status: Do not use for security. MD5 has known collision vulnerabilities (different inputs producing the same hash). It's still used for basic file integrity checks where security isn't the concern.

SHA-1

  • Output: 160-bit (40 hex characters)
  • Example: SHA-1("hello") = aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
  • Status: Do not use for security. Google demonstrated practical SHA-1 collisions in 2017. Deprecated by major standards bodies.

SHA-256

  • Output: 256-bit (64 hex characters)
  • Example: SHA-256("hello") = 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
  • Status: The current standard. No practical collisions known. Use this for any security-relevant purpose.

Common Uses of Hashing

Use caseWhat it does
Verifying downloadsCompare SHA-256 hash of downloaded file to listed checksum
Password storageWebsites store password hashes, not plaintext passwords
File change detectionSystems detect file changes by comparing stored hash to current hash
Git version controlGit uses SHA hashes to identify every commit and file version
Data deduplicationIdentical hashes indicate duplicate files
Digital signaturesHash of a document is signed, not the document itself

What Hashing Is Not

Hashing is not encryption — you can't reverse a hash to get the original. It's not compression — the output is always the same length regardless of input size. It's not the same as a checksum — checksums are simpler error-detection codes, not cryptographic functions.

Use Hash Generator to generate MD5, SHA-1 and SHA-256 hashes. For a related security topic involving hashed tokens, see how JWT tokens work.

Password Hashing vs Data Hashing

One distinction worth making explicit: for storing user passwords, a simple hash like SHA-256 is not appropriate — password-specific algorithms like bcrypt, Argon2 or PBKDF2 are designed to be deliberately slow and include salting, making brute-force attacks much harder. SHA-256 is appropriate for verifying file integrity, digital signatures and general data fingerprinting. Laravel, for example, uses bcrypt by default for password hashing. Hash Generator generates MD5, SHA-1 and SHA-256 for the data integrity use cases.

#hash md5 sha256 #hash function #checksum

Frequently Asked Questions

Is a hash the same as encryption?

No. Encryption is reversible with a key; hashing is one-way and can't be reversed. Hashing is not a way to secure data — it's a way to create a fingerprint of data.

If two files have the same MD5 hash, are they identical?

Not necessarily. MD5 has known collisions — two different files can produce the same hash. For integrity verification, SHA-256 is far more reliable.

Can a hash tell me what was in a file?

No. A hash is a fixed-length output (e.g. 64 hex characters for SHA-256) that gives no indication of the input's content or size.

Why do download pages list checksums?

So you can verify that the file you downloaded is exactly the file the author intended, without corruption or tampering. Generate the hash of your downloaded file and compare to the listed checksum.

Try it yourself

Do it in seconds Free

Every tool on MentorMakers is free — or just tell the AI Assistant what you need.

Browse all tools

0 Comments

Log in to comment

← Back to blog

Advertisement
Processing your file…
This can take a few seconds for larger files.
Bookmark this page
Press Ctrl+D for quick access next time