Developer Tools

Hash Generator

Generate MD5, SHA-1, SHA-256, SHA-384, and SHA-512 cryptographic hashes from text or files. All hashing happens in your browser using the Web Crypto API. 100% private: nothing sent to servers.

Last updated · SHA-1 status checked against NIST

MD5, SHA-1, SHA-256, SHA-512
File Hashing
Hash Comparison
100% Private
Our networkdiscount5Fresh deals. Five at a time.Price drops and coupon codes, ending soonest first.See today’s deals
#
Hash Generator
MD5 · SHA-1 · SHA-256 · SHA-384 · SHA-512 · Web Crypto API
Drop a file to hash it
Any file type · Hash computed locally
Output
Ready: type text or drop a file

What a Hash Tells You

A hash turns any input into a fixed-length fingerprint: SHA-256 of "abc" is always ba7816bf...f20015ad, 64 hex characters, while MD5 gives 32 and SHA-512 gives 128. Type text or drop a file above to get MD5, SHA-1, SHA-256, SHA-384 and SHA-512 at once, switch on HMAC to add a secret key, or paste a published hash to compare.

The same input always gives the same hash, and changing a single character changes the whole output. That makes a hash a quick way to check that a file or message has not changed. Hashing here runs in your browser with the Web Crypto API (MD5 with a small JavaScript routine), so the text and files you hash are not uploaded.

Test Vectors to Check Any Hash Tool

These are the standard published values. Type abc above and the tool should show exactly the middle column. The empty-string column is worth recognizing: if your own code prints one of these, it hashed nothing.

Algorithm"abc""" (empty)
MD5900150983cd24fb0d6963f7d28e17f72d41d8cd98f00b204e9800998ecf8427e
SHA-1a9993e364706816aba3e25717850c26c9cd0d89dda39a3ee5e6b4b0d3255bfef95601890afd80709
SHA-256ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ade3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
SHA-512ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49fcf83e1357eefb8bdf1542850d66d8007d620e4050b5715dc83f4a921d36ce9ce47d0d13c5d85f2b0ff8318d2877eec2f63b931bd47417a81a538327af927da3e

Which Algorithm to Use

AlgorithmOutputHex lengthStatusFine for
MD5128 bits32Broken: collisions can be made on a laptopSpotting accidental corruption, cache keys
SHA-1160 bits40Broken: public collision in 2017; NIST plans to retire it by the end of 2030Legacy systems, Git object IDs
SHA-256256 bits64SecureDownload checksums, signatures, HMAC
SHA-384384 bits96SecureTLS suites and policies that require it
SHA-512512 bits128SecureSame uses as SHA-256, with a longer output

None of these is a password hash. Stored passwords need a slow, salted function such as Argon2id, bcrypt or scrypt.

Why Your Hash Does Not Match

Hashes are exact to the byte, so a mismatch almost always means the input differs, not the algorithm.

  • A trailing newline. echo abc | sha256sum hashes "abc" plus a line break and prints edeaaff3...0efd18cb, not ba7816bf...f20015ad. Use printf 'abc' or echo -n abc.
  • Windows line endings. "abc" followed by CRLF hashes to 552bab68...85fdb025. A text file edited on Windows and on Linux can differ only in this.
  • Case and spaces. "ABC" and "abc " (with a space) give completely different hashes. The hex output itself is not case-sensitive, and the Compare box ignores case.
  • Text vs file. Pasting a file's contents into the text box is not the same as dropping the file: the file may have a byte order mark or a final newline you cannot see.
  • HMAC vs plain hash. A webhook signature is an HMAC; it only matches when the same secret key is used.

An HMAC you can check

With HMAC mode on, key key and the message The quick brown fox jumps over the lazy dog, HMAC-SHA256 is f7bc83f430538424b13298e6aa6fb143ef4d59a14946175997479dbc2d1a3cd8 and HMAC-SHA1 is de7c9b85b8b78aa6bc8a7a36f70a90701c9db4d9.

To encode the raw bytes of a hash or a file as text rather than hex, use the Base64 encoder.

Method and sources. SHA-1 and SHA-2 are defined in NIST FIPS 180-4, MD5 in RFC 1321 and HMAC in RFC 2104 and FIPS 198-1. The "abc" and empty-string values are the published test vectors; NIST announced in December 2022 that SHA-1 should be phased out by 31 December 2030. Every hash on this page was computed with Node.js crypto and matched against the tool.

Hash Generator Guide

A cryptographic hash function takes any input (text, file, data) and produces a fixed-length string (the hash or digest) with three key properties: deterministic (same input always gives same hash), one-way (you cannot reverse a hash to get the original input), and avalanche effect (changing even one character completely changes the hash). SHA-256 of "Hello" is 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969, completely different from SHA-256 of "hello" (lowercase). Hash functions are used for data integrity verification, password storage, digital signatures, and blockchain.

These algorithms differ in output length and security. MD5: 128-bit (32 hex chars). Fast but cryptographically broken: collision attacks are feasible. Still used for checksums and non-security purposes. SHA-1: 160-bit (40 hex chars). Also broken for collision resistance since 2017 (SHAttered attack). Avoid for security purposes. SHA-256: 256-bit (64 hex chars). Part of SHA-2 family. Currently secure, widely used in TLS certificates, code signing, and Bitcoin. SHA-512: 512-bit (128 hex chars). Larger output, slightly more security margin. Better performance on 64-bit systems. SHA-384: SHA-512 with different starting values, cut to 384 bits (96 hex chars). For security, use SHA-256 or higher.

HMAC (Hash-based Message Authentication Code) combines a hash function with a secret key to produce a hash that proves both data integrity AND authenticity. Unlike a plain hash (which anyone can compute), an HMAC can only be verified by someone who knows the secret key. Use HMAC when you need to prove that a message came from a specific party: API request signing (AWS, Stripe webhooks use HMAC-SHA256), JWT signatures (HS256 is HMAC-SHA256), cookie integrity checks, and secure message authentication protocols. Enable the HMAC mode checkbox above and enter a secret key. HMAC works here with SHA-1, SHA-256, SHA-384 and SHA-512; MD5 is not part of the Web Crypto API, so HMAC-MD5 is not offered.

No. Never use raw SHA-256, SHA-512, or MD5 for password hashing in production. These algorithms are designed to be fast, which makes them vulnerable to brute-force and rainbow table attacks. An attacker with a GPU can compute billions of SHA-256 hashes per second. For password hashing, use purpose-built slow algorithms: bcrypt (most widely used), Argon2 (winner of the Password Hashing Competition, recommended by OWASP), or scrypt. These are intentionally slow and memory-hard, making brute-force infeasible. In Node.js: bcrypt.hash(password, 12). In Python: bcrypt.hashpw(password, bcrypt.gensalt(12)).

Software publishers provide a hash (usually SHA-256) alongside their downloads. To verify: (1) Drop the downloaded file onto this tool. (2) Copy the SHA-256 hash from the results. (3) Paste the publisher's expected hash into the Compare field below. If they match, the file is intact and unmodified. On the command line: sha256sum file.iso (Linux/macOS) or Get-FileHash file.iso -Algorithm SHA256 (PowerShell). This process is called hash verification or checksum verification. It detects corrupted downloads and tampering, but not sophisticated attacks where the hash itself was also replaced: always verify hashes from the official publisher's site, not just the download mirror.

A hash collision occurs when two different inputs produce the same hash output. Since hash outputs are fixed-length but inputs are unbounded, collisions must mathematically exist: the question is whether they can be found efficiently. For MD5, researchers can generate deliberate collisions in seconds. For SHA-1, the SHAttered attack in 2017 produced a practical collision. For SHA-256, no collisions have ever been found and finding one would require more computational work than all computers combined could do in the age of the universe. Collisions matter for digital signatures: if two documents have the same hash, a signature on one is technically valid for the other. This is why browsers no longer accept MD5 or SHA-1 certificates.

A rainbow table is a precomputed lookup table mapping hash values back to their inputs. An attacker computes hashes for millions of common passwords in advance, stores them in the table, and then looks up any new hash instantly. Protection: salting, adding a unique random value to each password before hashing, so two users with the same password get different hashes. A salt defeats rainbow tables because the attacker would need to regenerate the table for every possible salt. Modern password hashing libraries (bcrypt, Argon2) handle salting automatically. This tool generates plain hashes without salts: suitable for file integrity and data verification, not password storage.

The Web Crypto API is a browser-native cryptography interface standardized by the W3C. It provides secure implementations of hash functions, encryption, and key generation without requiring external libraries. This tool uses crypto.subtle.digest('SHA-256', buffer) for SHA-2 family hashes and crypto.subtle.importKey() + crypto.subtle.sign() for HMAC. MD5 is not included in the Web Crypto API (it is cryptographically broken) so MD5 is computed using a pure JavaScript implementation. Benefits of Web Crypto: it runs natively in the browser sandbox, your data never leaves your device, and the implementations are battle-tested by browser vendors (Chrome, Firefox, Safari, Edge).

SHA-3 (Keccak) was selected by NIST in 2012 as an alternative to SHA-2 after an open competition. It uses a completely different internal design (sponge construction vs Merkle-Damgard in SHA-2), which means vulnerabilities in one would not apply to the other. SHA-3 is not "better" than SHA-2 in practice: SHA-256 and SHA-512 remain secure and are significantly faster in software. SHA-3 is a backup option in case weaknesses are discovered in SHA-2. SHA-3 is not yet supported by the Web Crypto API in all browsers, so this tool does not include it. For most purposes, SHA-256 is the recommended choice: it is fast, widely supported, and has an excellent security track record.

Bitcoin uses SHA-256 extensively. Mining involves finding a number (nonce) such that SHA-256(SHA-256(block_header)) starts with a certain number of zero bits: called Proof of Work. The difficulty adjusts to target one new block roughly every 10 minutes. Bitcoin addresses are derived using: public_key → SHA-256 → RIPEMD-160 → Base58Check encoding. Ethereum uses Keccak-256 (a SHA-3 variant). The blockchain's immutability comes from hash chaining: each block includes the hash of the previous block, so changing any historical transaction changes all subsequent hashes, which the network would immediately reject. Merkle trees use SHA-256 to efficiently prove that a transaction is included in a block without downloading the entire block.

It is e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855. The MD5 of an empty string is d41d8cd98f00b204e9800998ecf8427e and the SHA-1 is da39a3ee5e6b4b0d3255bfef95601890afd80709. If a program prints one of these for a file, it read zero bytes, which usually means a wrong path or an empty upload.

Because echo adds a newline. echo abc | sha256sum hashes four bytes, "abc" plus a line feed, and prints edeaaff3f1774ad2888673770c6d64097e391bc362d7d6fb34982ddf0efd18cb. Use printf 'abc' or echo -n abc and you get ba7816bf...f20015ad, the same as typing abc here. In PowerShell, pipe strings through a file with no final newline, or hash the file with Get-FileHash.