Hash Calculator — MD5, SHA-1, SHA-256, SHA-384, SHA-512 Online
Calculate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes for any text or file. Supports HMAC with secret keys, batch file hashing, and multiple output formats (hex, uppercase, base64). Verify hashes against expected values instantly. 100% client-side — nothing is sent to any server.
What is a hash? A cryptographic hash is a fixed-length fingerprint of data: the same input always produces the same digest, and changing a single bit changes roughly half the output bits. MD5 produces 128 bits, SHA-1 160, and SHA-256, SHA-384 and SHA-512 produce 256, 384 and 512 bits respectively. Hashing is one-way — a digest identifies data but cannot be reversed back into it.
How to Use the Hash Calculator
- Type or paste text — All five digests are computed together, about 150 ms after you stop typing, so you never choose an algorithm up front. The text tab is the right one for API payloads, tokens and short strings.
-
Or switch to the File tab — Drop one or more files on the zone, or browse for them. Each file is read into memory with
FileReaderand hashed byte-for-byte, then listed with its name, size and MIME type. Files are processed one after another, so a large batch takes proportionally longer. - Turn on HMAC if you need a keyed digest — Ticking the box reveals a key field and relabels every result as HMAC-SHA-256 and so on. A plain hash proves the data is unchanged; an HMAC proves it came from someone holding the same secret.
-
Pick an output format — Hex (lowercase) is what
sha256sum, Git and most APIs print. Hex (UPPER) matches WindowsCertUtiland many vendor checksum pages. Base64 is what appears in Subresource Integrity attributes and signature headers. - Paste an expected hash to verify — The Compare field checks your value against every row at once and is case-insensitive. A matching row gets a green bar and a tick appears in the field; if nothing matches, every row turns red. Because all five algorithms are checked, this also tells you which algorithm an unlabelled hash came from.
- Copy the digest you need — The copy icon beside each result puts that one digest on the clipboard and briefly turns into a tick. Clear empties the text, the key, the comparison value and the results in one go.
How the Hashes Are Computed
SHA-1, SHA-256, SHA-384 and SHA-512 are produced by the browser's own crypto.subtle.digest
implementation — the Web Crypto API, which is part of the browser engine rather than this page. That matters
for trust and for speed: the digests come from the same audited native code that verifies TLS certificates,
and hashing a large file runs at native speed rather than in interpreted JavaScript. Web Crypto is only
exposed in a secure context, so the tool needs HTTPS or localhost; on a plain http://
page the SHA rows report an error while MD5 keeps working.
MD5 is the exception. No browser exposes it through Web Crypto, precisely because it is no longer considered safe for security work, so this page carries its own implementation of the algorithm described in RFC 1321. It runs in JavaScript, which is why MD5 is the slowest row on a large file even though it is the weakest algorithm.
digest = H(message) • every input length in, one fixed length outEvery algorithm here shares the same shape. The message is padded to a whole number of blocks, its bit length is appended, and the blocks are folded one by one into a small internal state through a fixed set of rounds. The final state is the digest. Nothing about the process is random or time-dependent, which is why the same file always produces the same value on any machine, and why comparing digests is a valid way to compare data you cannot see side by side.
Digest Sizes and Current Status
| Algorithm | Digest | Hex chars | Base64 chars | Use it for |
|---|---|---|---|---|
| MD5 | 128-bit | 32 | 24 | Checksums, cache keys, deduplication. Never for security. |
| SHA-1 | 160-bit | 40 | 28 | Reading existing Git object ids and legacy checksums. |
| SHA-256 | 256-bit | 64 | 44 | The default choice: signatures, integrity, HMAC. |
| SHA-384 | 384-bit | 96 | 64 | Subresource Integrity, higher-assurance signatures. |
| SHA-512 | 512-bit | 128 | 88 | Long-lived archives; faster than SHA-256 on 64-bit CPUs. |
The hex column is a useful identification trick on its own. A bare 32-character hex string is almost certainly MD5; 40 characters is SHA-1; 64 is SHA-256. If you are not sure, paste the value into the Compare field — whichever row lights up green names the algorithm for you.
MD5 and SHA-1 are both broken in the same specific way: an attacker can construct two different inputs with the same digest. Practical MD5 collisions have been public since 2004, and the SHAttered work published in 2017 produced two distinct PDF files sharing one SHA-1 digest. That does not make either algorithm useless for detecting accidental corruption, where nobody is trying to fool you — it makes them unusable anywhere an adversary chooses the input, such as signatures, certificates or content-addressed security decisions. SHA-2 has no comparable published break, and SHA-256 is the sensible default for anything new.
HMAC: Adding a Secret to the Hash
A plain digest answers "has this data changed?" It cannot answer "did this come from someone I trust?", because anyone who alters the data can recompute the hash to match. HMAC, defined in RFC 2104, closes that gap by mixing a shared secret into the hashing process twice — once with an inner pad and once with an outer pad:
HMAC(K, m) = H((K ⊕ opad) ‖ H((K ⊕ ipad) ‖ m))
Only someone who knows K can produce a tag that verifies, so an HMAC proves both integrity and
origin. This is the mechanism behind webhook signature headers, AWS request signing and the
HS256 family of JWT signatures. For the SHA algorithms this page hands the work to Web Crypto's
importKey and sign operations; HMAC-MD5 is built on top of the JavaScript MD5
routine using the same 64-byte block padding.
Two limits worth knowing before you trust an HMAC from this page. First, the text you type and the HMAC key are both written into the page URL so the view can be reloaded — do not paste a live production secret here, and clear the field before copying or sharing the address. Second, the HMAC-MD5 path hashes over-long keys with SHA-256 instead of MD5, which departs from RFC 2104; with a key longer than 64 bytes its output will not match a standard HMAC-MD5 implementation. Keys of 64 bytes or fewer, and every HMAC-SHA variant, are unaffected.
Text Encoding, and When a Digest Will Not Match
A hash is computed over bytes, not over characters, so the digest of a piece of text depends entirely on how
that text was encoded first. The SHA algorithms here run your input through TextEncoder, which
emits UTF-8 — the same bytes a file saved as UTF-8 would contain, so the results match
sha256sum on that file exactly.
The MD5 text path does not do that conversion: it hashes each character code directly, so any non-ASCII character — an accent, a curly quote, an emoji — yields an MD5 that will not match a command-line tool. Pure ASCII text is identical either way. When you need a byte-exact MD5 of non-ASCII content, save it to a file and use the File tab, which hashes real bytes.
Encoding is only one of the usual reasons two digests disagree. A trailing newline is a byte like any other, and most editors add one when saving, which is why hashing a pasted string often differs from hashing the file it came from. Line endings matter too: a file checked out on Windows with CRLF endings hashes differently from the LF original, so a Git-managed text file can fail a checksum on one platform and pass on another. And a hash covers file content only — renaming a file, changing its timestamps or editing its metadata leaves the digest untouched.
What Hashing Cannot Do
Hashing is not encryption; there is no key that turns a digest back into the original data. It is also not password storage. Fast general-purpose hashes are the wrong tool for passwords precisely because they are fast — modern hardware tests enormous numbers of SHA-256 candidates per second, so a stolen table of unsalted SHA-256 password hashes falls quickly. Password storage needs a deliberately slow, salted, memory-hard function such as Argon2, scrypt, bcrypt or PBKDF2 with a high iteration count. Use the digests here for integrity and identification, and a purpose-built password hashing library for credentials.
Frequently Asked Questions
Three things, mainly. Integrity: publish a digest alongside a download so anyone can confirm the bytes arrived intact. Identification: content-addressed systems such as Git and container registries name objects by their digest. Authentication: an HMAC or a signature over a digest proves who produced a message. What a hash is not for is hiding data — it is one-way, not reversible, and it is not encryption.
SHA-256 unless you have a specific reason not to. It is fast, universally supported and has no published practical break. SHA-384 and SHA-512 give a larger margin and are actually faster than SHA-256 on 64-bit CPUs. Reach for MD5 or SHA-1 only when you have to interoperate with something that already uses them — verifying an old checksum file, or reading a Git object id.
Because plenty of legitimate work still involves MD5 digests that already exist: vendor checksum files, package manifests, cache keys, duplicate detection. Its weakness is collision resistance — an attacker can craft two inputs with the same digest — which breaks signatures but does not stop MD5 from catching a truncated download. Verify existing MD5 values here; do not choose it for anything new.
No. SHA digests come from the browser's built-in Web Crypto API and MD5 from JavaScript on the page; file contents are read locally through FileReader and never sent. One caveat: typed text, the comparison value and the HMAC key are written into the page URL so the result can be bookmarked, so treat the address bar as visible and clear the fields before sharing a link.
They encode the same bytes. Hex writes each byte as two characters from 0-9 and a-f, giving 64 characters for a SHA-256 digest — this is what sha256sum, Git and most APIs use. Base64 packs three bytes into four characters from A-Z, a-z, 0-9, + and /, giving 44 characters for the same digest. Base64 is what you see in Subresource Integrity attributes and signature headers. Convert freely with the Encoder / Decoder.
No. General-purpose hashes are built to be fast, and that speed is what makes offline guessing against a leaked database practical. Password storage needs a slow, salted, memory-hard function — Argon2, scrypt, bcrypt or PBKDF2 with a high iteration count — supplied by a maintained library rather than assembled by hand. Use the digests here for integrity and identification instead.
Almost always the bytes differ, not the algorithm. Check that you hashed the file rather than a copied-and-pasted string, that no trailing newline crept in, and that line endings were not converted from LF to CRLF on checkout or download. Confirm you are comparing the same algorithm too: a 32-character value is MD5, 40 is SHA-1, 64 is SHA-256. Paste the published value into the Compare field and let the tool highlight which row it belongs to.
Yes — select multiple files or drop a group on the zone, and each gets its own block of results with name, size and MIME type. They are hashed one after another rather than in parallel, so a large batch takes proportionally longer, and each file is read fully into memory before hashing, which puts a practical ceiling on very large files. For a single quick digest of one file, the Hash Generator is the lighter option.
Use Cases
Verifying File Integrity After Download
Compare the hash of a downloaded file with the expected value to ensure it wasn't corrupted or tampered with during transfer.
Identifying an Unlabelled Hash
A config file or a bug report contains a bare hex string with no algorithm named. Paste it into the Compare field alongside the candidate input — the row that turns green tells you whether you are looking at MD5, SHA-1 or SHA-256.
Finding Duplicate Files
Drop a folder's worth of images or exports onto the tool and compare digests instead of names and sizes. Two files with the same SHA-256 are byte-identical no matter what they are called or when they were saved.
Debugging a Webhook Signature
A provider's X-Signature header fails verification in your handler. Paste the exact raw request body with HMAC enabled and the signing secret in the key field, then compare — that isolates whether the mismatch is your body serialisation or your signing code.
Building a Subresource Integrity Attribute
Hash a vendored JavaScript or CSS file, switch the output to Base64, and paste the value into an integrity="sha384-…" attribute so the browser refuses the script if the CDN ever serves different bytes.
Writing Test Fixtures
Generate the expected digest for a known input once, paste it into an assertion, and you have a regression test that catches any accidental change to a serialiser, an export format or a canonicalisation step.