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. Our hash generator computes MD5, SHA-1, SHA-256, SHA-512 and bcrypt for any text.
0 characters • Press Enter to generate
About Hash Algorithms
MD5 & SHA-1
Legacy algorithms with practical collision attacks. Do not use them for signatures or password storage. Still fine for detecting accidental file corruption.
SHA-256 & SHA-512
Current hash algorithms from the SHA-2 family. The right choice for digital signatures, integrity checks and most other uses.
bcrypt
Password hashing algorithm with a built-in 16-byte salt and a tunable cost factor. Our generator uses cost 10. Input is limited to 72 bytes, and longer input is rejected rather than truncated.
Command Line
What is a cryptographic hash?
A cryptographic hash function is expected to hold three properties. Pre-image resistance means that, given a digest, finding any input that produces it is infeasible. Second pre-image resistance means that, given one input, finding a different input with the same digest is infeasible. Collision resistance means finding any two inputs that share a digest is infeasible. Collision resistance is the weakest of the three and the first to fall. MD5 and SHA-1 have lost it, while their pre-image resistance is still intact.
Hashing is different from 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 choice depends on whether an attacker controls the input, and on whether you are hashing data or a password. General-purpose hashes and password hashes do different jobs, and picking the wrong category is a more serious mistake than picking the wrong algorithm within one.
| Use case | Use | Do not use |
|---|---|---|
| Storing passwords | Argon2id, or bcrypt at work factor 10 or more, or 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 the key concatenated with the 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-related. 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. A chosen-prefix collision against MD5 now takes seconds on ordinary hardware. The Flame malware used 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 one job: detecting accidental corruption in a non-adversarial setting, such as checking that a file copied across a network arrived intact. SHA-1 is in the same position and should be treated the same way. Google's SHAttered attack broke its collision resistance in 2017, and chosen-prefix collisions followed in 2020.
No practical pre-image attack exists on either function, so an MD5 or SHA-1 digest still does not reveal its input. What has failed 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 (also called the work factor) that sets how many rounds of key setup it performs. Each increment of the cost factor doubles the work.
OWASP's Password Storage Cheat Sheet recommends a work factor of 10 or more. Our hash generator uses cost 10, the default in Go's bcrypt library, which is what the $2a$10$ prefix at the start of the output means. In production, tune the cost so that one hash takes roughly 250 to 500 milliseconds on your own hardware, and raise it again as hardware gets faster. That is what the tunable cost is for.
Two bcrypt limitations matter in practice. bcrypt only uses the first 72 bytes of its input. Most implementations silently truncate, so anything past that point in a long passphrase counts for nothing. The Go library DNSX uses refuses input over 72 bytes instead, so our generator reports an error for a longer input rather than hashing a truncated copy. The usual workaround is to pre-hash with SHA-256 before bcrypt, base64-encoding the digest first, because a NUL byte in the raw digest would cut the input short. bcrypt is also not memory-hard, which leaves it weaker than Argon2id against GPU and ASIC attacks. 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.
# macOS / Linux
shasum -a 256 file.iso
# Linux
sha256sum file.iso
# PowerShell
Get-FileHash file.iso -Algorithm SHA256
# Windows (legacy)
certutil -hashfile file.iso SHA256A 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. The signature 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 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. Our 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 the echo command 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. Collision attacks have been practical 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 practical attack.
SHA-512 (512-bit)
Larger output for a higher security margin. Faster than SHA-256 on 64-bit systems because it works in native 64-bit words.
bcrypt (adaptive)
Built for password hashing, with a 16-byte salt and a tunable cost factor. Deliberately slow to make brute-force attacks expensive. The only algorithm here designed for storing passwords, and the only one whose output changes on every run.