~/TechPurAILearn · Build · Grow
Start Learning
~/tools/hash-generator
Testing & Validation

Hash Generator

MD5
—
SHA-1
—
SHA-256
—
SHA-384
—
SHA-512
—
Bcrypt (for passwords, not general files)

MD5 and SHA are fast on purpose — wrong for passwords. Bcrypt is deliberately slow, with a per-hash random salt, which is what actual password storage should use.

Verify a bcrypt hash

A hash function takes any input — a short word, a password, an entire file's worth of bytes — and deterministically produces a fixed-length string of characters that uniquely represents that input. This tool computes five of the most common hash algorithms for text or an uploaded file, live, entirely inside your browser — plus a separate bcrypt generator and verifier for the one case general-purpose hashing gets wrong: passwords.

What a hash actually is, and what it's for

The defining properties of a cryptographic hash function are what make it useful: the same input always produces exactly the same output (determinism), a tiny change to the input — even a single character — produces a completely different, unrelated-looking output (the avalanche effect), the output is always a fixed length regardless of how large or small the input is, and critically, there's no practical way to work backward from the hash to recover the original input. These properties combine to make hashing useful for an entire category of problems that have nothing to do with encryption despite often being mentioned in the same breath: verifying that a file hasn't been corrupted or tampered with, storing passwords without ever storing the actual password, and generating a compact, fixed-size fingerprint for data that would otherwise be too large to compare directly.

It's worth being precise about a common point of confusion: hashing is not encryption, and the two solve fundamentally different problems. Encryption is explicitly designed to be reversible — given the right key, ciphertext converts back into the original plaintext, because the whole point of encryption is that an authorized party can eventually recover the original message. Hashing has no equivalent reverse operation at all, by design; a hash is meant to be a one-way fingerprint, not a way to disguise-and-later-recover data. If a tool claims to "decrypt" a hash, it's either doing something else entirely (like looking up the hash in a precomputed table of common inputs — a "rainbow table" — which only works for short, guessable inputs) or misusing the term.

Why this tool computes five different algorithms at once

MD5, SHA-1, SHA-256, SHA-384, and SHA-512 all do the same fundamental job — deterministically fingerprint an input — but they differ in output length, computational cost, and, most importantly, their current cryptographic security status. Which one you actually need in a given situation is almost always dictated by an external constraint, not personal preference: a piece of legacy software that only reports MD5 checksums, a security tool that expects SHA-256, a download page that publishes a SHA-512 hash for verification. Generating all five at once, rather than making you pick one algorithm up front and switch tools if it turns out to be the wrong one, means you can immediately compare against whichever hash format the other system happens to have provided.

MD5 and SHA-1: still common, no longer secure

Both of these algorithms remain in widespread practical use despite being formally broken from a security standpoint, and understanding why requires separating "broken for security purposes" from "useless for every purpose." MD5's core vulnerability is that researchers demonstrated practical hash collisions — two different pieces of input that produce an identical MD5 output — meaning it's possible to construct a malicious file that hashes identically to a legitimate one, which completely defeats any use of MD5 as proof that a file hasn't been tampered with. SHA-1 suffered the same fate more recently and more dramatically: in 2017, researchers at Google and CWI Amsterdam publicly demonstrated the "SHAttered" attack, producing two distinct PDF files that share an identical SHA-1 hash, and published proof-of-concept tools showing the attack was practically achievable, not just theoretically possible. Neither algorithm should be used anywhere hash collisions represent a genuine security risk — password storage, digital signatures, certificate validation, or verifying a file hasn't been maliciously tampered with. But both remain genuinely useful for detecting accidental corruption — a file that got truncated during a download, a copy operation that silently dropped a byte — where nobody is deliberately trying to construct a colliding input, and the practical odds of accidental data corruption happening to produce a matching hash by pure chance remain astronomically low even for a "broken" algorithm. This is exactly why MD5 checksums are still common in older tooling, caching systems, and file-integrity spot-checks, even though no security professional would recommend it for anything adversarial.

SHA-256 and beyond: the current practical standard

SHA-256, part of the SHA-2 family designed by the NSA and published by NIST in 2001, is the algorithm most modern systems default to today, and for good reason — it has no known practical collision or preimage attacks as of today, its 256-bit output provides a very large security margin against brute-force attacks, and it's fast enough in practice (especially with hardware acceleration, which most modern CPUs include specifically for SHA-256) to use at scale without a meaningful performance cost. It's the algorithm behind Bitcoin's proof-of-work, the algorithm most TLS certificates are signed with today, and the default choice for most modern software's file-integrity checksums. SHA-384 and SHA-512, both part of the same SHA-2 family, offer a longer output (384 and 512 bits respectively) and, correspondingly, an even wider theoretical security margin — useful in specific contexts that call for extra headroom against future cryptanalytic advances, though for the overwhelming majority of everyday hashing needs, SHA-256 already provides more than sufficient security margin for the foreseeable future.

What hashing is genuinely useful for, day to day

Verifying a downloaded file matches what the publisher intended — comparing a computed hash of the downloaded file against a hash the publisher listed on their site catches both accidental corruption during download and, to the extent the publishing channel itself is trusted, deliberate tampering somewhere in between. Generating a stable, fixed-size identifier or cache key from a longer piece of content, so two pieces of content can be quickly compared or looked up by their hash rather than comparing the full content directly every time. Checking whether two pieces of text or two files are identical without visually comparing them character by character — if their hashes match, the contents are (for all practical purposes) identical; if the hashes differ even slightly, something about the content differs too, even if it's not obvious at a glance.

Verifying a file against a published checksum

This is the single most common reason anyone reaches for a hash tool, so it's worth walking through directly: switch to File mode, select the file you downloaded, and paste the checksum the publisher listed — next to the download link, in a release's changelog, wherever it was published — into the compare field. The matching algorithm's row turns into a clear match-or-not indicator instead of two long hex strings you'd otherwise have to read character by character, which is both tedious and exactly the kind of task a human is likely to get wrong on a string 64 characters long. A mismatch means the file differs from what the publisher intended, whether from a corrupted download or something that happened to it in between — either way, worth re-downloading before trusting it.

What hashing alone does not do for passwords — and what to use instead

A raw, unsalted hash of a password is not, by itself, a secure way to store that password — real authentication systems add a random salt unique to each password before hashing, specifically to defeat precomputed rainbow-table attacks, and use a purpose-built, deliberately slow password-hashing algorithm rather than a general-purpose fast hash like SHA-256, precisely because a fast hash makes brute-forcing large numbers of password guesses too cheap for an attacker. MD5 and the SHA family above are general-purpose hashes for verification, identification, and integrity-checking — not for passwords.

That's what the bcrypt generator below is for instead. Bcrypt automatically generates a random salt per hash and lets you tune the "rounds" (cost factor) that controls how slow it deliberately runs — the slowness is the point, since it's what makes guessing millions of password candidates expensive for an attacker in a way a fast hash never is. It also includes a verify mode: paste an existing bcrypt hash and a plaintext candidate, and it tells you whether they match, the same check a login form performs server-side.

A hash proves integrity, not authenticity, on its own

Matching hashes tell you two pieces of content are identical — they don't, by themselves, tell you the content came from who it claims to. If an attacker can modify both a file and the hash published alongside it (for instance, by compromising the same download page), a hash comparison alone won't catch that. Genuine authenticity verification needs a cryptographic signature checked against a trusted public key, which is a related but distinct mechanism from hashing alone.

Frequently asked questions

Why does this tool generate five different hashes instead of just one?

Because each algorithm is the right tool for a different job, and which one you need depends entirely on context — usually dictated by whatever system or file you're checking a hash against, not by personal preference. Showing all five at once means you can compare your input against whichever hash format the other system happens to provide, without needing to know in advance which algorithm it used.

Is MD5 still safe to use?

Not for anything security-sensitive. MD5 has known collision vulnerabilities — meaning it's practically possible to construct two different pieces of input that produce the identical MD5 hash, which completely defeats its use as a security or tamper-detection mechanism. It was formally deprecated for cryptographic use by security researchers years ago. It's included here purely because it's still extremely common as a fast, simple checksum for verifying accidental data corruption (not malicious tampering) in legacy systems, caching keys, and older tooling that predates its known weaknesses — not because it's recommended for anything new.

Is SHA-1 still considered secure?

No, not for security purposes — SHA-1 was formally broken in a practical, public demonstration in 2017 (the 'SHAttered' attack, published by Google and CWI Amsterdam researchers), which produced two different PDF files sharing an identical SHA-1 hash. Like MD5, it remains in use in some legacy systems and version control tools (older parts of Git's internals, for instance, historically relied on SHA-1, though Git has been transitioning away from it), but it should not be used for anything where hash collisions would be a real security concern — password storage, digital signatures, or tamper detection.

Which algorithm should I actually use today?

SHA-256 is the current practical standard for the overwhelming majority of use cases — it's what TLS certificates, most blockchain systems, and most modern software checksums rely on, and it has no known practical collision or preimage attacks as of today. SHA-384 and SHA-512 offer a larger output size and a wider security margin, useful in specific higher-security contexts, but for general-purpose file integrity checks, checksums, or basic verification, SHA-256 is the sensible default unless a specific system you're working with dictates otherwise.

Can a hash be reversed back into the original text?

No — that's the entire defining property of a cryptographic hash function. It's mathematically designed to be a one-way operation: computing the hash from the input is fast and deterministic, but there's no way to derive the original input purely from its hash output short of brute-force guessing every possible input and checking whether it produces a matching hash, which for anything beyond a short, predictable input (like a common password) is computationally infeasible with current technology. This one-way property is exactly why hashing, rather than plain storage, is the correct way to handle passwords server-side — the server can verify a login attempt by hashing the submitted password and comparing hashes, without ever needing to store the actual password anywhere.

Is hashing here on my own browser actually as secure as running it locally on my machine?

For SHA-family algorithms, functionally yes — this tool uses the Web Crypto API's SubtleCrypto.digest() function, which is a native, browser-implemented cryptographic primitive, not a JavaScript reimplementation of the algorithm. It runs entirely within your browser's own process, using the same underlying cryptographic implementation the browser relies on for HTTPS and other security features, and nothing you type is ever transmitted anywhere.

Can I hash a file instead of typing text?

Yes — switch to File mode, pick a file up to 25 MB, and the same five algorithms are computed from its bytes instead of typed text. This is the actual use case most people reach for a hash tool for: confirming a downloaded file matches the checksum its publisher listed, which only works by hashing the file itself, not a description of it. The 25 MB limit exists because the hashing runs in plain JavaScript in your browser tab rather than on a server — well beyond that size, the computation gets noticeably slow instead of instant.

What does the 'compare against an expected hash' field do?

Paste a hash you're checking against — the one a publisher listed next to a download, for instance — and each of the five computed hashes shows a Match or No match badge the moment it lines up, case-insensitively. It saves the step of manually eyeballing two long hex strings character by character, which is exactly the kind of comparison humans are bad at and a program isn't.

Why does this tool generate bcrypt hashes too, when the rest of the page says hashing isn't for passwords?

Because bcrypt is a different kind of algorithm, built specifically for the password case the other five are wrong for. MD5 and SHA-family hashes are fast by design — great for checksums, bad for passwords, because fast means cheap to brute-force. Bcrypt is deliberately slow, tunable via its rounds (cost factor) parameter, and bakes in a random salt automatically so two identical passwords never produce the same hash. It's included as a separate, clearly labeled section rather than mixed into the general-purpose list above, specifically so the distinction stays visible.

What rounds value should I use for bcrypt?

10 is a reasonable default and what most libraries ship with — each increment roughly doubles the computation time, so going higher is a direct, deliberate tradeoff between resistance to brute-force attempts and how long hashing takes. This tool defaults to 10 and allows 4 through 14; production systems commonly use 10–12. Going much higher mainly matters if you have a specific threat model that calls for it, since it also slows down every legitimate login check by the same amount.