Hash Generator - MD5, SHA-256 & SHA-512 Online
Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes from text or files. Create HMAC hashes and verify checksums — 100% in your browser.
Hash Results
Frequently Asked Questions
What is a hash function?
A hash function is a mathematical algorithm that converts any input data into a fixed-size string of characters called a digest or hash value. The same input always produces the same hash, but even a tiny change in the input creates a completely different hash. Hashes are one-way functions, meaning you cannot reverse the hash to get the original input.
What is the difference between MD5, SHA-1, SHA-256, and SHA-512?
These algorithms differ in output size and security level. MD5 produces a 128-bit (32 hex character) hash but is cryptographically broken. SHA-1 produces a 160-bit (40 hex character) hash but is deprecated due to collision attacks. SHA-256 produces a 256-bit (64 hex character) hash and is secure for most applications. SHA-512 produces a 512-bit (128 hex character) hash and offers the highest security level.
Why are MD5 and SHA-1 considered insecure?
MD5 and SHA-1 are vulnerable to collision attacks, where two different inputs can produce the same hash. MD5 was broken in 2004, and practical collision attacks have been demonstrated. SHA-1 was deprecated in 2017 after researchers demonstrated real-world collision attacks. For security-sensitive applications like password hashing, digital signatures, or data integrity verification, use SHA-256 or SHA-512 instead.
What are common use cases for hash functions?
Hash functions are used for data integrity verification (checking if files were modified), password storage (storing hashed passwords instead of plaintext), digital signatures and certificates, checksum verification for downloads, content deduplication (identifying identical files), blockchain and cryptocurrency, and Git version control (commit identifiers use SHA-1).
How can I verify a file's integrity using hashes?
To verify a file's integrity, calculate its hash and compare it to a known good hash. This tool supports file hashing via drag-and-drop or file selection. Upload your file, and the tool generates hashes for all supported algorithms. Compare the result with the expected hash provided by the file source. A match confirms the file hasn't been modified or corrupted.
Is this tool secure to use for sensitive data?
Yes. This tool runs 100% in your browser using the Web Crypto API. No data is ever sent to any server. All hash calculations happen locally on your device, making it safe for sensitive information. The tool works offline after the initial page load, ensuring complete privacy for your data.
Code Examples
// SHA-256 hash using Web Crypto API
async function sha256(text) {
const encoder = new TextEncoder();
const data = encoder.encode(text);
const hashBuffer = await crypto.subtle.digest('SHA-256', data);
const hashArray = Array.from(new Uint8Array(hashBuffer));
return hashArray.map(b => b.toString(16).padStart(2, '0')).join('');
}
// Usage
const hash = await sha256('Hello, World!');
console.log(hash); // "dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f"