Hash Generator: MD5, SHA-256, SHA-512 and HMAC
Compute MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes and HMACs of text or files
Text to hash (UTF-8)
Enter text or choose a fileEnter text or choose a fileEnter text or choose a fileEnter text or choose a fileEnter text or choose a fileWhat is a hash?
A cryptographic hash function turns input of any length into a fixed-length fingerprint: 128 bits for MD5, 160 for SHA-1, 256 for SHA-256, 384 for SHA-384 and 512 for SHA-512, shown here as hexadecimal. The same input always produces the same hash, changing a single character produces a completely different one, and there is no way to run the function backwards to recover the input.
That makes hashes useful for verifying downloads, detecting changed files, deduplicating content, building cache keys and ETags, and signing data. This page computes all five digests at once, so you can match whichever one a project publishes without picking the algorithm first. Text is encoded as UTF-8 before hashing, which is what sha256sum and most programming languages do too; a different encoding (UTF-16, or a trailing newline from echo) gives a different hash.
Hashing vs encryption
Encryption is two-way: anyone with the key can decrypt the ciphertext back to the original. Hashing is one-way: there is no key and nothing to decrypt. You compare hashes by computing the hash of a candidate input and checking it matches.
HMAC sits between the two. It mixes a secret key into the hash (HMAC-SHA256 is the common choice), so only someone who knows the key can produce or verify the result. Webhook signatures from Stripe, GitHub and Slack, AWS request signing and JWTs signed with HS256 all use HMAC. Tick "HMAC with a secret key" above to compute HMAC-MD5 through HMAC-SHA512 for the same input.
MD5 and SHA-1 are broken for security, fine for checksums
Researchers can deliberately create two different inputs with the same MD5 hash in seconds, and a practical SHA-1 collision was published in 2017 (SHAttered). That rules both out for digital signatures, certificates and anything where an attacker could swap in a crafted file. Use SHA-256 or stronger there.
For non-adversarial jobs they are still fine: detecting accidental corruption, matching a legacy system's checksum column, cache keys or ETags. MD5 is also why this tool ships its own implementation: the browser's Web Crypto API refuses to offer it, so MD5 here is computed by a small built-in routine while the SHA family uses the browser's native SubtleCrypto.
Never use these hashes to store passwords
MD5 and the SHA family are designed to be fast. A single modern GPU computes billions of SHA-256 hashes per second, so a leaked table of unsalted SHA-256 password hashes can be cracked almost as quickly as plaintext. Passwords need a deliberately slow, salted algorithm such as bcrypt, scrypt or Argon2id. Use the bcrypt generator at /tools/bcrypt-generator to create and verify bcrypt password hashes with an adjustable cost factor.
Command-line equivalents
Linux: sha256sum file.zip, sha512sum file.zip, sha1sum file.zip and md5sum file.zip. To hash a string without the trailing newline that echo adds: printf '%s' 'hello world' | sha256sum.
macOS: shasum -a 256 file.zip (or -a 1, -a 384, -a 512) and md5 file.zip. HMAC: printf '%s' 'message' | openssl dgst -sha256 -hmac 'secret'.
Windows: certutil -hashfile file.zip SHA256 (also MD5, SHA1, SHA384, SHA512), or in PowerShell Get-FileHash file.zip -Algorithm SHA256. Note that certutil and Get-FileHash print uppercase hex; use the Uppercase toggle above to compare directly.
How to use the Hash Generator: MD5, SHA-256, SHA-512 and HMAC tool
- 1
Enter text or choose a file
Type or paste text into the box, or click "Hash a file instead" to hash a local file. The file is read in your browser, not uploaded.
- 2
Optionally add an HMAC key
Tick "HMAC with a secret key" and enter the key to compute keyed HMAC digests instead of plain hashes.
- 3
Read all five digests
MD5, SHA-1, SHA-256, SHA-384 and SHA-512 update as you type. Toggle uppercase hex to match tools such as certutil.
- 4
Copy the result
Copy any single hash, or copy all five labelled lines at once.
Frequently asked questions
Is my text or file uploaded anywhere?
No. SHA hashes are computed by your browser's built-in Web Crypto API and MD5 by a small script on this page. Files are read locally with the File API. Nothing you type, hash or choose is sent to a server, and shareable links include only the text, never an HMAC key or a file.
Why doesn't my hash match the one from the command line?
Usually a trailing newline. echo 'abc' | sha256sum hashes "abc\n", not "abc". Use printf '%s' 'abc' | sha256sum or echo -n. The other common cause is text encoding: this tool hashes UTF-8, while PowerShell strings are UTF-16 unless you convert them.
Can a hash be decrypted or reversed?
No. A hash is not encrypted data; information is discarded, so there is nothing to decrypt. Sites that claim to "decrypt MD5" are looking the hash up in tables of previously hashed common strings, which is exactly why short or common inputs, such as passwords, must not be protected by a fast hash.
Which hash should I use?
SHA-256 is the safe default for integrity checks and signatures. SHA-512 is equally strong and can be faster on 64-bit CPUs. Use MD5 or SHA-1 only to match an existing checksum. For passwords use bcrypt, scrypt or Argon2, not any of these.
How large a file can I hash?
Files up to 512 MB. The whole file is loaded into memory, so very large files depend on how much memory your browser allows; for multi-gigabyte files, use sha256sum, shasum or certutil instead.
Related on TechLogHub
Related Security Tools
UUID Generator for v4 and v7 with Bulk Output
Generate v4 and v7 UUIDs in bulk and inspect any UUID or GUID
Bcrypt Hash Generator and Verifier with Cost
Hash passwords with bcrypt at a chosen cost factor and verify passwords against bcrypt hashes
Password Generator with Passphrases and Entropy
Generate strong random passwords or word-based passphrases with an entropy meter
TOTP Generator with Countdown and otpauth URIs
Compute RFC 6238 TOTP codes from a base32 secret and build otpauth:// URIs for testing 2FA
Chmod Calculator for Octal and Symbolic Modes
Convert Linux permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) and build the chmod command
Get the next tool before you need it
One email a week: new and trending developer tools, fresh comparisons, and what shipped. Unsubscribe in one click.

