Input Text
Hash Results
File Hash Calculator
Drag and drop a file here, or click to select
Supports any file type. All computation is done locally in your browser.
File Hash Results
HMAC Keyed Message Authentication
HMAC Results
Hash Comparison
Hash Algorithm Knowledge
What is a Hash Function?
A hash function is a mathematical algorithm that maps data of arbitrary size to a fixed-size digest. It has the following core properties:
- Deterministic: The same input always produces the same output
- Fast computation: Computing a hash from input is very efficient
- Avalanche effect: A tiny change in input (even 1 bit) produces a completely different output
- One-way: Cannot derive the original data from the hash value
- Collision-resistant: Hard to find two different inputs that produce the same hash
Supported Hash Algorithms
This tool supports the following five hash algorithms:
MD5: Outputs 128 bits (32 hex chars). Designed by Ronald Rivest, one of the earliest widely-used hash algorithmsSHA-1: Outputs 160 bits (40 hex chars). Designed by NSA, formerly used in TLS certificates and GitSHA-256: Outputs 256 bits (64 hex chars). SHA-2 family member, the most commonly used secure hash algorithm todaySHA-384: Outputs 384 bits (96 hex chars). SHA-2 family member, provides higher security marginSHA-512: Outputs 512 bits (128 hex chars). SHA-2 family member, excellent performance on 64-bit systems
SHA-256/384/512 use the browser's native Web Crypto API (SubtleCrypto) for excellent performance; MD5 and SHA-1 are implemented in pure JavaScript.
MD5 vs SHA Algorithm Comparison
| Property | MD5 | SHA-1 | SHA-256 | SHA-384 | SHA-512 |
|---|---|---|---|---|---|
| Digest Length | 128-bit / 32 chars | 160-bit / 40 chars | 256-bit / 64 chars | 384-bit / 96 chars | 512-bit / 128 chars |
| Block Size | 512-bit | 512-bit | 512-bit | 1024-bit | 1024-bit |
| Rounds | 64 | 80 | 64 | 80 | 80 |
| Security | ⚠️ Broken | ⚠️ Broken | ✅ Secure | ✅ Secure | ✅ Secure |
| Collision Attack | Possible | Possible | None known | None known | None known |
| Recommended Use | Checksum/Dedup | Checksum/Dedup | Security use | Security use | Security use |
Common Use Cases for Hashing
- File integrity verification: Compare hash values after download to ensure files are not tampered with
- Password storage: Store password hashes (with salt) in databases instead of plaintext
- Digital signatures: Sign document hashes to ensure non-repudiation
- Message authentication (HMAC): Use keyed hashing to verify message integrity and origin
- Blockchain: Bitcoin uses SHA-256 for proof-of-work and address generation
- Data deduplication: Quickly determine if data is identical via hash values
- Git version control: Uses SHA-1 to identify commits and file contents
- Content addressing: IPFS and similar systems use hashes as content identifiers
Security Notes
MD5 and SHA-1 have known collision attack vulnerabilities, meaning two different inputs can produce the same hash. Therefore:
- ❌ Do not use MD5/SHA-1 for digital signatures, SSL/TLS certificates, password storage, or other security-sensitive scenarios
- ✅ MD5/SHA-1 can still be used for file integrity checks, data deduplication, and other non-security scenarios
- ✅ For security purposes, use SHA-256 or higher
- ⚠️ For password storage, use dedicated password hashing functions:
bcrypt,scrypt,Argon2 - ⚠️ Hashing is not encryption — hashing is one-way and cannot be decrypted back to original data
All computations in this tool are performed locally in your browser. Data is never uploaded to a server, making it suitable for sensitive data.
Tutorial
Enter or paste text into the input field, and the tool will compute and display MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes in real time. Click the copy button next to each hash to copy it to your clipboard. To hash a file, click the "Choose File" button to upload a local file of any format.
HMAC mode requires a key and is suitable for scenarios that need to verify message origin and integrity. Enter a key in the "HMAC Key" field, and the tool will automatically compute the HMAC result. The hash comparison feature lets you input two hashes, and the tool will automatically compare them and highlight the result.
For large files, computation may take a few seconds—please be patient. All processing happens locally in the browser, so files are never uploaded to a server, making it safe to handle sensitive data.
Use Cases
The most common use for a hash generator is verifying file integrity. After downloading software, firmware, or images from an official source, compute the SHA-256 hash of the local file and compare it with the official hash to ensure the file wasn't tampered with during transmission. This is especially important when downloading open-source software or operating system images.
Developers also use hashes to detect code duplication or cache invalidation. For example, build tools use file content hashes as cache keys so that when content changes, the hash changes and triggers a rebuild. Operations teams often use MD5 or SHA-256 to verify that configuration files are consistent across different servers.
Extended Knowledge
Hash functions are designed to be deterministic (same input always yields same output), fast to compute, produce an avalanche effect (tiny input changes produce completely different outputs), and be one-way (output cannot be reversed to input). Modern secure hash algorithms like SHA-256 use the Merkle-Damgård construction, processing input through multiple rounds of compression.
Note that MD5 and SHA-1 have been proven vulnerable to collision attacks—cryptographers have demonstrated how to construct two different files with the same hash. Therefore, for security-sensitive applications like digital signatures and SSL certificates, SHA-256 or higher is required. For password storage, plain hashing is insufficient; use dedicated password hashing functions like bcrypt, scrypt, or Argon2, which automatically apply salting and iteration to dramatically increase cracking difficulty.
Frequently Asked Questions (FAQ)
Are MD5 and SHA-1 still usable?
MD5 and SHA-1 have been shown to have collision vulnerabilities and should not be used for security-sensitive scenarios like digital signatures or certificates. However, they can still be used for non-security purposes like file integrity checks and data deduplication. For security use cases, choose SHA-256 or higher.
Can the original data be recovered from a hash value?
No. Hash functions are one-way; the original data cannot be recovered from the hash. However, attackers can use rainbow tables or brute force to guess common inputs. For password storage, use salted hashes or dedicated password hashing functions (like bcrypt).
Why does the same file always produce the same hash?
Hash functions are deterministic—identical input always produces identical output. This is a fundamental property that ensures the reliability of integrity checks: even a single bit change in the file produces a completely different hash (avalanche effect).
What is the difference between HMAC and plain hashing?
Plain hashing does not involve a key—anyone can compute it. HMAC (Hash-based Message Authentication Code) uses a secret key to hash the message, and only parties with the key can compute and verify it. HMAC guarantees both data integrity and authenticity.
How do I verify a downloaded file's integrity?
After downloading, compute the file's hash (SHA-256 recommended) and compare it with the official hash. If they match, the file was not tampered with during transmission. This tool's "Hash Comparison" feature can automatically compare two hashes.
Should I choose SHA-256 or SHA-512?
Both are secure. SHA-512 is often faster on 64-bit systems but produces longer hashes (128 characters vs 64). For most applications, SHA-256 is the recommended choice, offering a good balance of security and performance and enjoying broad support. Choose SHA-512 if you need a higher security margin.
What's the difference between SHA-256 and MD5?
NIST SP 800-107 defines SHA-256 as a secure hash algorithm outputting 256-bit digests, widely used in digital signatures and certificate verification. MD5 outputs 128 bits but has proven collision vulnerabilities and is not recommended for security applications.