Hash Generator
Generate cryptographic hashes from text or files
Algorithm
Ready to Hash
Enter text above to generate cryptographic hashes
What is a Cryptographic Hash Function?
A cryptographic hash function is a mathematical algorithm that converts an input of any size into a fixed-length output (called a digest or hash) in a one-way process. The output is always the same length regardless of input sizeโSHA-256 always produces 256 bits (64 hex characters), and SHA-512 always produces 512 bits (128 hex characters). Unlike encryption, hashing is irreversible: you cannot recover the original input from the hash, making it ideal for password storage, data integrity verification, and digital signatures where you need to prove something hasn't changed without revealing the original value.
Different hash algorithms offer varying security levels and performance characteristics. MD5 (128-bit) and SHA-1 (160-bit) are cryptographically broken and should not be used for security-critical applications. SHA-256 (256-bit) is widely used and considered secure for most modern applications, while SHA-512 (512-bit) provides additional security margin. For specialized use cases requiring maximum performance, Blake2b and other modern algorithms offer even better speed while maintaining strong security guarantees.
Common Use Cases
- File Integrity Verification: Compute hash of downloaded files and compare against the official hash to ensure the file hasn't been corrupted or tampered with during transit. A single bit change produces a completely different hash.
- Password Storage: Hash passwords with salt and store only the hash. When users log in, hash their input and compare to the stored hash. This prevents attackers from discovering passwords even if they access the database.
- Digital Signatures: Hash a document, then encrypt the hash with a private key to create a signature. Recipients can verify the signature using the public key, proving the document's authenticity and integrity.
- Data Deduplication: Hash files and identify duplicates by comparing hashes. A common optimization in backup systems and version control to avoid storing identical content multiple times.
- API Authentication (HMAC): Combine a shared secret key with data and hash them together (HMAC) to create a signature. Both parties compute the same HMAC if the secret and data match, proving the request is authentic.
How to Use This Tool
- Choose Algorithm: Select an algorithm based on your security needs. SHA-256 is recommended for most use cases; avoid MD5 and SHA-1 for security-critical applications.
- Input Text or File: Either paste text directly in the text input tab or drag-and-drop a file into the upload area. Files up to 100MB are supported for batch hashing.
- Select Output Format: Choose hexadecimal (standard) or Base64 encoding. Most applications expect hexadecimal, but some APIs require Base64.
- Toggle Uppercase: By default, hashes display in lowercase. Enable uppercase if your system requires capital letters in hex output.
- Compare Hashes (Optional): Enable Compare Mode and paste a reference hash to check if it matches your computed hash. Useful for verifying file downloads or testing.
Features
Multiple Algorithms
Support for MD5 (legacy), SHA-1 (deprecated), SHA-256 (recommended), SHA-512 (highest security), and other modern hash functions. Each algorithm designed for different trust and performance requirements.
Text & File Input
Hash text by typing or pasting, or compute hashes of files up to 100MB using drag-and-drop file upload. Progress indicator shows processing status for large files.
Format Control
Output as hexadecimal (standard) or Base64. Convert to uppercase if your system requires capital letters. Download hash results for record-keeping.
Hash Comparison
Compare two hashes side-by-side to verify file integrity. Perfect for checking downloaded files, validating database migrations, or testing data consistency.
Frequently Asked Questions
What is a hash function and how does it work?
A hash function takes any input data and applies a mathematical algorithm to produce a fixed-length output (the hash). The algorithm is designed so that changing even a single character in the input produces a completely different hash. This property makes hashes useful for detecting changes in data: if the hash matches, the data hasn't been modified.
Is MD5 still secure? Should I use it?
MD5 is cryptographically broken and should not be used for security-critical applications like password hashing or digital signatures. It's vulnerable to collision attacks where two different inputs produce the same hash. Legacy systems still use MD5, but new projects should use SHA-256 or stronger alternatives.
What is the difference between SHA-256 and SHA-512?
SHA-256 produces a 256-bit (32-byte) hash, while SHA-512 produces a 512-bit (64-byte) hash. SHA-512 provides a larger security margin and is more resistant to future attacks, but requires more computation. For most applications, SHA-256 is sufficient; SHA-512 is preferred for long-term security and high-value applications.
Can a hash be reversed? How do I recover the original data?
No, cryptographic hashes are one-way functions by design. You cannot reverse a hash to recover the original input. This is the fundamental property that makes hashing secure for passwords and digital signatures. If you need to recover the original, encryption is the correct approach, not hashing.
What is HMAC and how is it different from regular hashing?
HMAC (Hash-based Message Authentication Code) combines a hash function with a secret key to create a signature that proves both authenticity and integrity. Unlike a regular hash which anyone can compute, an HMAC requires knowledge of the secret key. HMAC is used in APIs, webhooks, and message signing to verify that a request came from a trusted source.