בס״ד

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

$ curl -X POST https://dnsx.dev/hash -H "Content-Type: application/json" \
-d '{"text":"hello world"}'
$ curl -X POST https://dnsx.dev/hash -d '{"text":"test","algorithms":["sha256"]}'

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 caseUseDo not use
Storing passwordsArgon2id; bcrypt at cost 12+; PBKDF2-HMAC-SHA256 at 600,000 iterations where FIPS compliance is requiredAny fast hash (MD5, SHA-1, SHA-256, SHA-512), with or without a salt
File integrity, download checksumsSHA-256MD5 or SHA-1 where an attacker could have supplied the file
Digital signatures, certificatesSHA-256 or SHA-384MD5 and SHA-1, both forbidden in this role
Message authenticationHMAC-SHA256A bare hash of key concatenated with message
Non-adversarial deduplication, cache keys, hash tablesAnything fast, including MD5 or a non-cryptographic hash such as xxHashNothing 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.

# macOS / Linux  shasum -a 256 file.iso
# Linux  sha256sum file.iso
# PowerShell  Get-FileHash file.iso -Algorithm SHA256
# Windows (legacy)  certutil -hashfile file.iso SHA256

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.

Frequently Asked Questions

What is a cryptographic hash?
A cryptographic hash function takes any input data and produces a fixed-size output (the "hash" or "digest") that appears random. Key properties include: determinism (same input always produces the same output), one-way computation (you cannot reverse a hash to find the original input), avalanche effect (a tiny change in input completely changes the output), and collision resistance (it is extremely difficult to find two different inputs that produce the same hash).
Is MD5 still safe to use?
MD5 is no longer considered safe for security purposes. Researchers demonstrated practical collision attacks in 2004, meaning it is possible to create two different inputs that produce the same MD5 hash. MD5 should never be used for password hashing, digital signatures, or certificate verification. However, MD5 is still acceptable for non-security uses like checksums for file integrity verification (where an attacker is not actively trying to create collisions) or as a fast hash for hash tables.
What is bcrypt?
bcrypt is a password hashing algorithm designed specifically for securely storing passwords. Unlike general-purpose hash functions like SHA-256, bcrypt includes three critical features: a built-in salt (random data added to each password before hashing, preventing rainbow table attacks), a configurable cost factor (controls how computationally expensive the hash is to compute, allowing it to scale with hardware improvements), and deliberate slowness (designed to be slow to compute, making brute-force attacks impractical).
What is SHA-256 used for?
SHA-256 (Secure Hash Algorithm 256-bit) is one of the most widely used cryptographic hash functions. It is used in TLS/SSL certificates to verify website authenticity, Bitcoin mining and blockchain verification, digital signatures and code signing, file integrity verification (checksums), HMAC-based authentication tokens, and Git version control (for commit identification). SHA-256 is part of the SHA-2 family and has no known practical vulnerabilities.

Related Tools