#️⃣

Hash Generator

Generate cryptographic hashes from text or files. Supports SHA-256, SHA-512, SHA-1, SHA-384, and MD5. Compare hashes to verify integrity.

About Hash Generator

A cryptographic hash function takes an input (text or file) and produces a fixed-size output (the hash or digest). Even a tiny change in the input produces a completely different hash - this makes hashes useful for detecting tampering, verifying downloads, and storing passwords.

Algorithms

  • SHA-256 - Part of SHA-2. Produces a 256-bit (64 hex char) hash. The most widely used algorithm today - used in SSL certificates, Bitcoin, and code signing.
  • SHA-512 - Produces a 512-bit (128 hex char) hash. More collision-resistant, faster on 64-bit systems.
  • SHA-384 - A truncated variant of SHA-512. Used in TLS and some certificate standards.
  • SHA-1 - Legacy 160-bit hash. Considered cryptographically broken for security purposes but still used for checksums and Git commit IDs.

How to Use

  1. Type or paste text in the Input area, or click Upload File to hash a file.
  2. Select the Algorithm: SHA-256, SHA-512, SHA-384, or SHA-1.
  3. The hash updates automatically as you type.
  4. Click Copy to copy the hash string.

How It Works

Text input is encoded as UTF-8 bytes using TextEncoder, then passed to the browser's crypto.subtle.digest() API. For files, the file bytes are read with FileReader and processed the same way. The resulting ArrayBuffer is converted to a hex string for display.

Example

Hash the string "hello" with SHA-256: 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824. Even a single character change produces a completely different hash.

FAQ

No - general-purpose hash functions like SHA-256 are not suitable for password storage. Passwords should be hashed with a slow, salted algorithm like bcrypt, scrypt, or Argon2. This tool is for checksums, data integrity, and general hashing.
No. Hash functions are one-way. Given a hash you cannot recover the original input mathematically. The only way to "reverse" a hash is through brute-force or rainbow table attacks, which is why strong passwords matter.
No. All hashing is done using the browser's built-in Web Crypto API (crypto.subtle.digest). Your text or files are never transmitted anywhere.