Hash Generator (MD5/SHA)

Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes instantly. Free, client-side, no signup.

Your data never leaves your browser Available via MCP

How to Use

  1. Select a hash algorithm: MD5, SHA-1, SHA-256, SHA-384, or SHA-512.
  2. Enter or paste the text you want to hash.
  3. Click Generate Hash to compute the hash.
  4. Click Copy to copy the result to your clipboard.

What Is Hashing?

Hashing is the process of converting input data into a fixed-size string of characters using a mathematical algorithm. The output, called a hash or digest, acts as a unique fingerprint of the input. Hash functions have three key properties: they are deterministic (same input always gives same output), they are fast to compute, and they are practically irreversible (you cannot recover the input from the output).

Hash Algorithm Comparison

MD5 (Message Digest 5) produces a 128-bit hash displayed as 32 hexadecimal characters. Designed in 1991, it is now cryptographically broken — researchers demonstrated practical collision attacks in 2004. Despite this, MD5 remains widely used for non-security purposes like file checksums.

SHA-1 (Secure Hash Algorithm 1) produces a 160-bit hash (40 hex characters). Google demonstrated a practical collision attack in 2017 (SHAttered), and all major browsers and certificate authorities have deprecated SHA-1 for TLS certificates. Avoid SHA-1 for any security-sensitive application.

SHA-256 is part of the SHA-2 family and produces a 256-bit hash (64 hex characters). It is the most widely used secure hash algorithm today, used in TLS certificates, Bitcoin mining, digital signatures, and password hashing schemes. SHA-256 has no known practical attacks.

SHA-384 and SHA-512 produce 384-bit and 512-bit hashes respectively. They provide a larger security margin and can be faster than SHA-256 on 64-bit processors. SHA-512 is used in some TLS cipher suites and in Ed25519 digital signatures.

Common Use Cases

  • File integrity verification — Download sites publish SHA-256 checksums so you can verify files were not corrupted or tampered with during transfer
  • Password storage — Applications store hashed passwords (using specialized algorithms like bcrypt or Argon2) instead of plaintext
  • Digital signatures — Documents are hashed before signing, so the signature covers the hash rather than the entire document
  • Content addressing — Git uses SHA-1 to identify commits, trees, and blobs; IPFS uses SHA-256 for content-addressed storage
  • Data deduplication — Cloud storage systems hash file blocks to identify and eliminate duplicate data
  • Cache keys — Web applications hash request parameters to generate cache keys

Hashing in Code

In JavaScript, the Web Crypto API provides crypto.subtle.digest('SHA-256', data) for SHA family hashes. In Python, use the hashlib module: hashlib.sha256(b'text').hexdigest(). In the command line, use sha256sum (Linux) or shasum -a 256 (macOS) to hash files.

Hashing vs. Encryption

Hashing and encryption are fundamentally different. Hashing is one-way — there is no key and no way to reverse the process. Encryption is two-way — data encrypted with a key can be decrypted with the corresponding key. Use hashing when you need to verify data integrity or store passwords. Use encryption when you need to protect data that must be recovered later.

Related Tools

Generate secure passwords with the Password Generator. Encode binary data as text with the Base64 Encoder. Decode JWT tokens verified with HMAC-SHA256. Generate unique identifiers with the UUID Generator. Encode data for URLs with the URL Encoder. Create cache-busting timestamps with the Epoch Converter.

Frequently Asked Questions

What is a hash function?
A hash function takes input data of any size and produces a fixed-size output (the hash or digest). The same input always produces the same output, but even a tiny change in the input produces a completely different hash. Hash functions are one-way — you cannot reverse a hash to recover the original input.
What is the difference between MD5, SHA-1, and SHA-256?
MD5 produces a 128-bit (32-character) hash and is considered cryptographically broken — do not use it for security. SHA-1 produces a 160-bit (40-character) hash and is also deprecated for security use. SHA-256 produces a 256-bit (64-character) hash and is currently considered secure. SHA-384 and SHA-512 produce longer hashes for applications requiring extra security margin.
Is MD5 still safe to use?
MD5 is not safe for security purposes like password hashing or digital signatures, as collision attacks are practical. However, MD5 is still commonly used for non-security purposes like checksums for file integrity verification, cache keys, and deduplication.
Is my data safe?
Yes. All hashing is performed entirely in your browser using the Web Crypto API (for SHA algorithms) and a JavaScript implementation (for MD5). No data is sent to any server.
Can I decrypt a hash?
No. Hash functions are one-way by design — there is no mathematical way to reverse a hash back to the original input. Tools that claim to "decrypt" hashes actually use precomputed lookup tables (rainbow tables) of common inputs and their hashes.

Code Examples

Learn how to use this tool programmatically in your favorite language.

Use this tool from AI agents. The CodeTidy MCP Server lets Claude, Cursor, and other AI agents use this tool and 46 others directly. One command: npx @codetidy/mcp

Drop file to load