Hash Generator
A cryptographic hash function maps input of any length to a fixed-size digest that cannot be reversed, and changing a single bit of the input changes the whole output. SHA-256 is the safe default for integrity checks and signatures in 2026. MD5 and SHA-1 are collision-broken and should not be used for either. Passwords need a deliberately slow function instead, such as Argon2id or bcrypt.
0 characters • Press Enter to generate
About Hash Algorithms
MD5 & SHA-1
Legacy algorithms. Not recommended for security purposes due to known vulnerabilities. Still useful for checksums and non-security applications.
SHA-256 & SHA-512
Modern, secure hash algorithms from the SHA-2 family. Recommended for most applications including digital signatures and integrity verification.
bcrypt
Password hashing algorithm with built-in salting and configurable cost factor. Specifically designed for securely storing passwords. Each hash includes a unique salt.
Command Line
What is a cryptographic hash?
A hash function is expected to hold three properties. Pre-image resistance: given a digest, finding any input that produces it is infeasible. Second pre-image resistance: given one input, finding a different input with the same digest is infeasible. Collision resistance: finding any two inputs that share a digest is infeasible. Collision resistance is the weakest of the three and the first to fall. It is what MD5 and SHA-1 have lost, while their pre-image resistance is still intact.
A hash is not encryption. There is no key and no decryption step. The mapping is deliberately lossy, so the original input cannot be recovered from the digest by any means other than guessing.
Which hash algorithm should I use in 2026?
The answer depends entirely on whether an attacker controls the input, and on whether you are hashing data or a password. General-purpose hashes and password hashes are not interchangeable and choosing the wrong category is a more serious mistake than choosing the wrong algorithm within one.
| Use case | Use | Do not use |
|---|---|---|
| Storing passwords | Argon2id; bcrypt at cost 12+; PBKDF2-HMAC-SHA256 at 600,000 iterations where FIPS compliance is required | Any fast hash (MD5, SHA-1, SHA-256, SHA-512), with or without a salt |
| File integrity, download checksums | SHA-256 | MD5 or SHA-1 where an attacker could have supplied the file |
| Digital signatures, certificates | SHA-256 or SHA-384 | MD5 and SHA-1, both forbidden in this role |
| Message authentication | HMAC-SHA256 | A bare hash of key concatenated with message |
| Non-adversarial deduplication, cache keys, hash tables | Anything fast, including MD5 or a non-cryptographic hash such as xxHash | Nothing is ruled out here |
Is MD5 still safe to use?
No, not for anything security-relevant. MD5 collisions were demonstrated by Wang and Yu in 2004, and in 2008 a research team used a chosen-prefix collision to forge a certificate that chained to a real trusted CA. Chosen-prefix collisions against MD5 now cost seconds on ordinary hardware. The Flame malware weaponised an MD5 collision in 2012 to sign itself as Microsoft code.
MD5 must never be used for password storage, digital signatures, certificate verification, or any integrity check where an attacker could influence the input. It remains acceptable for exactly one category: detecting accidental corruption in a non-adversarial setting, such as verifying that a file copied across a network arrived intact. SHA-1 is in the same position and should be treated identically. Google's SHAttered attack broke its collision resistance in 2017, and chosen-prefix collisions followed in 2020.
Note what is not broken: no pre-image attack on either function is practical, so an MD5 or SHA-1 digest still does not reveal its input. The failure is collision resistance, which is what signatures and adversarial integrity checks depend on.
What is bcrypt, and what cost factor should I set?
bcrypt is a password-hashing function derived from the Blowfish cipher, published by Niels Provos and David Mazières in 1999. It builds in a 16-byte salt, so the same password produces a different hash every time and precomputed rainbow tables are useless, and it takes a cost factor that sets how many iterations of key setup it performs. Each increment of the cost factor doubles the work.
OWASP's 2026 guidance is a cost factor of 12 as a minimum, with 13 or 14 preferred where the login latency budget allows. Tune it so a single hash takes roughly 250 to 500 milliseconds on your production hardware, and raise it again as hardware improves. That is what the tunable cost is for.
Two bcrypt limitations matter in practice. It silently truncates input at 72 bytes, so anything a long passphrase contains past that point counts for nothing. The usual workaround is to pre-hash with SHA-256 before bcrypt, but base64-encode the digest first or the NUL bytes in it will truncate the input further. bcrypt is also not memory-hard, which leaves it weaker than Argon2id against GPU and ASIC attack, and that is why Argon2id is the first choice for new systems.
How do I verify a file checksum on Windows, macOS and Linux?
Compute the hash of the file you downloaded and compare it character by character with the value the publisher lists. If they differ, the file is not the one that was published.
A matching checksum only proves the file matches the value you compared against. If you fetched both the file and the checksum from the same compromised server, it proves nothing. Where the publisher signs its checksum file with GPG, verify that signature instead. That check establishes authenticity, where the checksum on its own only establishes integrity.
Why does the same text give a different hash elsewhere?
A hash function operates on bytes, not on characters, so the encoding of the input decides the output. The string café hashes differently as UTF-8 than as UTF-16 or Latin-1, and a Unicode string in NFC normalisation hashes differently from the same string in NFD. This generator hashes the UTF-8 bytes of what you type.
The other frequent causes of a mismatch are a trailing newline that a text editor or echo added (use printf or echo -n instead), and comparing a hex digest against a base64 digest of the same bytes.
How do the hash algorithms compare?
MD5 (128-bit)
Fast but broken for security. Vulnerable to collision attacks since 2004. Use only for non-security checksums and legacy compatibility.
SHA-1 (160-bit)
Deprecated for security since 2017 when Google demonstrated a practical collision (SHAttered). Avoid for new applications.
SHA-256 (256-bit)
The recommended general-purpose hash. Used in TLS, Bitcoin, Git, and digital signatures. No known vulnerabilities.
SHA-512 (512-bit)
Larger output for higher security margins. Actually faster than SHA-256 on 64-bit systems due to native 64-bit operations.
bcrypt (adaptive)
Purpose-built for password hashing. Includes salt and configurable cost factor. Deliberately slow to prevent brute-force attacks. The only algorithm here designed specifically for storing passwords.