#️⃣ Hash Generator — MD5 SHA256 SHA512

Generate MD5, SHA-1, SHA-256 and SHA-512 hashes for text or files instantly. Free online hash calculator — runs in browser, nothing sent to any server.

Hash Types

How to Use

1

Enter text or file

Type or paste text in the input, or switch to File mode and drag a file onto the drop zone.

2

Hashes generate instantly

MD5, SHA-1, SHA-256 and SHA-512 hashes are calculated automatically as you type.

3

Copy any hash

Click the copy icon next to any hash row. Optionally compare against a known hash value.

Frequently Asked Questions

What is a hash function? +
A hash function takes any input and produces a fixed-length output (hash). The same input always produces the same hash, but the hash cannot be reversed to get the original input. Used for data integrity, password storage, and checksums.
What is the difference between MD5, SHA-1, SHA-256, and SHA-512? +
They differ in output length and security. MD5 (128-bit) and SHA-1 (160-bit) are considered cryptographically broken and unsuitable for security purposes. SHA-256 and SHA-512 are part of the SHA-2 family and remain secure for most uses.
Can I use MD5 for password hashing? +
No — MD5 is not suitable for password hashing. Use bcrypt, Argon2, or scrypt instead. MD5 is only appropriate for non-security checksums like file integrity verification.
Can I generate a hash for a file? +
Yes — switch to File mode to hash any file. The SHA-256 hash of a file is its fingerprint: if even one byte changes, the hash completely changes.
Are the inputs sent to a server? +
No. All hashing runs in your browser. Text hashes use the Web Crypto API (SHA family) and a JavaScript MD5 implementation. Files are read locally with FileReader.


Complete Guide: Hash Generator

What Is Cryptographic Hashing and Why It Matters

A cryptographic hash function takes an input of any size and produces a fixed-length output (the "digest") with three key properties: determinism (same input always gives the same output), one-wayness (you cannot reverse the digest to recover the input), and collision resistance (it's computationally infeasible to find two different inputs with the same digest).

These properties make hashing fundamental to modern computing. Git uses SHA-1 (and newer commits use SHA-256) to identify every commit, tree, and blob — the hash is the ID. File download sites publish SHA-256 checksums alongside downloads so you can verify the file wasn't tampered with in transit. HTTPS certificate chains use SHA-256 for signature verification. Every time you log in with a password, the server computes a hash and compares it against the stored hash — never storing your actual password.

The algorithms on offer: MD5 (128-bit, fast, widely supported — broken for security but fine for checksums where collision attacks aren't a concern), SHA-1 (160-bit, deprecated for security — don't use in new systems), SHA-256 (256-bit, the current industry standard), SHA-512 (512-bit, more resistant to length-extension attacks).

How to Use the Hash Generator

  1. Select Text or File mode at the top of the tool.
  2. Text mode: type or paste your input — MD5, SHA-1, SHA-256, and SHA-512 hashes appear instantly as you type.
  3. File mode: drag a file onto the drop zone. All four hashes are computed in the browser using the Web Crypto API and the FileReader API — the file never leaves your device.
  4. Copy any hash using the icon next to each row.
  5. Compare a hash: paste a known hash value into the comparison field to verify whether your input matches.

Code Examples

// Browser: SHA-256 using the Web Crypto API
async function sha256(message) {
  const encoded = new TextEncoder().encode(message);
  const hashBuffer = await crypto.subtle.digest('SHA-256', encoded);
  const hashArray = Array.from(new Uint8Array(hashBuffer));
  return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
}
const hash = await sha256('Hello, World!');
// 'dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986d'

// Node.js: SHA-256 and HMAC
import { createHash, createHmac } from 'crypto';
const hash256 = createHash('sha256').update('data').digest('hex');
const hmac = createHmac('sha256', 'secret-key').update('data').digest('hex');
// HMAC: authenticated hash — proves both the data AND the key match

// File checksum (Node.js)
import { createReadStream } from 'fs';
const hash = createHash('sha256');
createReadStream('file.iso').pipe(hash);
hash.on('finish', () => console.log(hash.digest('hex')));

Common Mistakes to Avoid

Comparison with Alternatives

CRC32 is a fast non-cryptographic checksum used for error detection (not security). BLAKE2/BLAKE3 are faster than SHA-256 while maintaining similar security — used in Zcash, libsodium, and modern password managers. SHA-3 (Keccak) uses a different internal structure (sponge construction) that's immune to length-extension attacks. bcrypt/Argon2 for passwords (see above). HMAC (Hash-based Message Authentication Code) adds a secret key to the hash — proves both data integrity and authenticity.

For encoding binary hashes in a text-safe format, use the Base64 Encoder. For generating cryptographically strong random identifiers (not hash-based), use the UUID Generator.

Pro Tips

🧰 50+ Tools