Hash Generator

Generate cryptographic hashes from any text string. Supports MD5, SHA-1, SHA-256, and SHA-512 via the Web Crypto API. All computation happens in your browser — your input is never transmitted.

Developer Tools

Input Text
📄 Drop a .txt file here, or

What This Tool Does

Generates MD5, SHA-1, SHA-256, and SHA-512 cryptographic hashes from text input or uploaded files, entirely in your browser using the Web Crypto API. Nothing is ever sent to a server.

Who This Is For

  • Developers verifying file integrity by comparing expected and actual hashes after download
  • Security engineers generating and comparing checksums for sensitive files
  • Anyone who needs to hash a string for comparison, caching keys, or lightweight fingerprinting
  • DevOps engineers checking that build artifacts haven't been tampered with

Example: Input: The text string Hello, World! or an uploaded binary file → Output: SHA-256: dffd6021bb2bd5...b28688a362182986d — a fixed-length hex digest unique to that exact input

How to Generate a Hash

  1. Type or paste your text into the input field.
  2. All four hash values — MD5, SHA-1, SHA-256, and SHA-512 — update instantly as you type.
  3. Click any hash value to copy it to your clipboard.

All hashing runs in your browser using the Web Crypto API. Hash outputs are hex strings — use regex patterns like /^[a-f0-9]64$/ to validate SHA-256 format in your code. Nothing you type is sent to any server.

MD5, SHA-1, SHA-256, SHA-512 — Compared

AlgorithmOutput LengthStatusUse For
MD5128 bits (32 hex chars)Broken for securityFile checksums, non-security deduplication
SHA-1160 bits (40 hex chars)Deprecated for securityLegacy systems, Git commit IDs (still collision-resistant enough for non-adversarial use)
SHA-256256 bits (64 hex chars)SecureDigital signatures, certificates, file integrity, password hashing (with salt)
SHA-512512 bits (128 hex chars)SecureHigh-security integrity checks, longer output where needed

Important: MD5 and SHA-1 should not be used for security-sensitive purposes. Both have known collision attacks — it is possible to craft two different inputs that produce the same hash. SHA-256 or SHA-512 should be used for any new system.

What Are Hash Functions Used For?

Hash Functions Are One-Way

A cryptographic hash function is deterministic (same input always produces same output) and one-way (you cannot reverse the hash to recover the input). There is no "unhash" operation.

However, common values can be looked up in rainbow tables — precomputed databases of hash values. This is why passwords must be salted (a unique random value added to each password before hashing) to prevent rainbow table attacks.

For password storage, use a purpose-built algorithm: bcrypt, scrypt, or Argon2. These are slow by design — they intentionally take milliseconds to compute, making brute-force attacks impractical even if the hash database is stolen.

Cryptography and Security Tools

Hash generation fits into a broader security and data integrity workflow:

Related Tools

Related Guides

Frequently Asked Questions

Is MD5 still useful?
MD5 is useful for non-security purposes like verifying file integrity against accidental corruption, deduplication, and generating quick checksums. It should not be used for anything security-related because collision attacks are practical — meaning an attacker could craft a malicious file with the same MD5 as a legitimate one.
What is the difference between SHA-256 and SHA-512?
Both are part of the SHA-2 family and are cryptographically secure. SHA-512 produces a longer hash (512 vs 256 bits) and is theoretically more resistant to future brute-force improvements. In practice, SHA-256 is sufficient for almost all uses. SHA-512 can actually be faster on 64-bit processors due to its internal word size.
Can I use SHA-256 to hash passwords? See the Base64 Encoder for reversible encoding (unlike hashing). For token verification, the JWT Decoder shows algorithm and signature details.
You can, but you should not. SHA-256 is extremely fast — billions of hashes per second on modern hardware. This makes brute-force attacks feasible. Use bcrypt, scrypt, or Argon2 instead — they are designed to be slow and tunable, making brute-force impractical.
Why do two completely different inputs sometimes produce the same hash length?
All MD5 hashes are always 128 bits (32 hex characters), regardless of whether you hash one character or one gigabyte. Hash functions produce fixed-length output from arbitrary-length input — this is by design.
What is a salt?
A salt is a random value added to an input before hashing. Two users with the same password get different hashes because each has a unique salt. This defeats rainbow tables and ensures that a compromised hash database does not immediately reveal passwords.
How do I verify a file's integrity using a hash?
Download the file and its published checksum (usually SHA-256). Hash the downloaded file using this tool or a command like sha256sum filename on Linux/Mac. Compare the result to the published checksum — they should match exactly.