A cryptographic hash function takes input data of any size and produces a fixed-length output called a digest or hash. Hash functions have three essential properties. First, they are deterministic: the same input always produces the same output. Second, they are one-way: given a hash, it is computationally infeasible to reconstruct the original input. Third, they exhibit the avalanche effect: a single bit change in the input produces a completely different hash, making it impossible to infer anything about the input by comparing two hashes.
MD5 produces a 128-bit (32 hex character) hash and was once widely used for security purposes. It is now cryptographically broken — researchers have demonstrated practical MD5 collision attacks where two different inputs produce the same hash. MD5 remains useful for non-security purposes like file deduplication and checksums, but must not be used for passwords, digital signatures, or any security-sensitive application. SHA-1 (160-bit, 40 hex characters) was deprecated for security use after the 2017 SHAttered collision attack.
SHA-256 (256-bit, 64 hex characters), part of the SHA-2 family, is the current standard for security-sensitive hashing. SHA-512 (512-bit, 128 hex characters) offers a larger safety margin for long-term security needs. Both use the native Web Crypto API in this tool, which provides hardware-accelerated computation where supported. Common use cases include file integrity verification, digital signatures, password storage (with proper salting), and data fingerprinting.
A developer publishes a software release and wants to let users verify the download has not been tampered with. She computes the SHA-256 hash of the installer file and publishes it alongside the download link. Users download the file, compute its SHA-256 hash locally, and compare. If the hashes match exactly — all 64 hex characters — the file is authentic and unmodified. If even a single byte was changed by a malicious actor or corrupted during download, the hash would be completely different. This is how Linux distributions, package managers, and security-conscious software projects publish checksums.
For password storage, the same one-way property is critical. When a user creates an account with a password, the server computes its hash and stores only the hash — never the plain text. When the user logs in, the server hashes the submitted password and compares to the stored hash. Even if an attacker steals the database, they have hashes, not passwords. To illustrate the avalanche effect: hash password123 and password124 — the SHA-256 outputs share no visible similarity despite differing by one character. This makes it impossible to guess partial passwords from partial hash matches.
Rainbow tables are precomputed dictionaries that map common passwords to their hashes. An attacker with a stolen database of plain SHA-256 password hashes can look up each hash in a rainbow table and recover the password in milliseconds — no brute-force required. Salting defeats this: a unique random value (the salt) is appended to each password before hashing, so the same password hashes differently for each user, invalidating any precomputed table.
Dedicated password hashing functions — bcrypt, scrypt, and Argon2 — are specifically designed for password storage and should be used instead of general-purpose hash functions like SHA-256. They are intentionally slow and memory-intensive, making brute-force attacks expensive. A single bcrypt hash may take 100 milliseconds to compute. SHA-256 on a GPU can compute billions of hashes per second; bcrypt reduces that to thousands. The computational cost is configurable via a work factor that can be increased as hardware improves.
HMAC (Hash-based Message Authentication Code) combines a hash function with a shared secret key to authenticate messages. HMAC-SHA256 is how JWT tokens signed with the HS256 algorithm are created — the signature proves both that the payload was not altered and that it was created by someone with the secret key. File download verification, API request signing, and webhook payload validation all commonly use HMAC.
This online hash generator computes MD5, SHA-1, SHA-256, and SHA-512 hashes instantly as you type. MD5 uses a pure-JavaScript implementation; SHA hashes use the native Web Crypto API. Drop any file to hash it — no upload, no server. All hashing runs entirely in your browser.
A hash function takes input data of any size and produces a fixed-size output called a hash or digest. Hash functions are deterministic (same input always produces same output), fast to compute, and designed so that small changes in input produce completely different outputs. They are used in checksums, password storage, digital signatures, and data integrity verification.
MD5 produces a 128-bit (32 hex character) hash and is very fast, but is cryptographically broken — it is vulnerable to collision attacks and should not be used for security purposes. SHA-256 produces a 256-bit (64 hex character) hash and is cryptographically secure. Use SHA-256 for any security-sensitive application. MD5 is still useful for checksums where collision resistance is not required.
No. Hash functions are one-way functions — given a hash output, it is computationally infeasible to reconstruct the original input. This property is called pre-image resistance. While dictionary attacks and rainbow tables can sometimes reverse weak passwords, a properly generated hash of sufficient-length random input cannot be reversed.
Click "Hash a file" or drag and drop any file onto the input area. The tool reads the file using the FileReader API in your browser and computes MD5, SHA-1, SHA-256, and SHA-512 hashes simultaneously. The file is never uploaded — all hashing happens locally. This is useful for verifying file integrity by comparing hashes.
Yes. SHA-256 is part of the SHA-2 family and remains cryptographically secure as of 2026. It is widely used in TLS/SSL certificates, Bitcoin, and many security protocols. For password hashing specifically, use a dedicated password hashing function like bcrypt, scrypt, or Argon2 instead, as they are designed to be slow and resist brute-force attacks.