MD5 & SHA-256 Hash Generator

Free MD5 and SHA-256 hash generator: type text or choose a file to compute MD5, SHA-1, SHA-256, SHA-384 and SHA-512 checksums at once, in hex and Base64, plus HMAC — all in your browser.

Runs entirely in your browser: text, files, HMAC keys and the checksum you paste to compare are never uploaded, logged or saved. MD5 and SHA-1 are broken for security — fine for checksums and de-duplication, never for passwords (use bcrypt/argon2) or signatures.

How to generate a hash or checksum

  1. Text: type or paste it into the box. MD5, SHA-1, SHA-256, SHA-384 and SHA-512 are all computed as you type, shown in hex and Base64.
  2. File: switch to the "File" tab, then choose a file or drop it anywhere on the tool. Files up to 500 MB are read with a progress bar and hashed in your browser — nothing is uploaded.
  3. Verify a download: paste the checksum the publisher gave you into "Compare with an expected checksum". It is matched against every algorithm above automatically, ignoring case, whitespace and a leading label like sha256:.
  4. HMAC: open the "HMAC (keyed hash)" section, enter a shared secret key, and HMAC-SHA-256/384/512 of the same text or file appear below it.
  5. Press Copy next to any hash, or Copy all as text for every algorithm at once.

MD5 and SHA-256 hash examples

Hashing "Hello, World!" with every algorithm this tool supports:

AlgorithmHex digestLength
MD565a8e27d8879283831b664bd8b7f0ad4128 bits
SHA-10a0a9f2a6772942557ab5355d76af442f8f65e01160 bits
SHA-256dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f256 bits
SHA-3845485cc9b3365b4305dfb4e8337e0a598a574f8242bf17289e0dd6c20a3cd44a089de16ab4ab308f63e44b1170eb5f515384 bits
SHA-512374d794a95cdcfd8b35993185fef9ba368f160d8daf432d08ba9f1ed1e5abe6cc69291e0fa2fe0006a52570ef18c19def4e617c33ce52ef0a6e5fbe318cb0387512 bits

The same SHA-256 digest in Base64 instead of hex: 3/1gIbsr1bCvZ2KQgJ7DpTGR3YHH9wpLKGiKNiGCmG8=. Both represent the exact same 32 bytes — pick whichever format the system you're working with expects.

Verify a file checksum

Software publishers post a checksum (usually SHA-256 today) next to a download so you can confirm the file arrived intact. Hash the file you downloaded here, then paste the publisher's value into Compare with an expected checksum: a green badge means the bytes match exactly; a red one means the download is corrupted, incomplete, or was tampered with, and you should download it again from a trusted source. The comparison auto-detects which of the five algorithms your pasted value belongs to by its length, so you don't need to know in advance whether it's MD5 (32 hex characters) or SHA-256 (64).

HMAC: hashes with a secret key

A plain hash proves data hasn't changed, but anyone can compute one — it proves nothing about who sent it. HMAC (RFC 2104) mixes a secret key into the hash, so only someone who knows the key can produce (or check) the correct value. HMAC-SHA-256 of "Hello, World!" with the key secret-key is:

16ee525f6c944ff49a368cd593eb7b72883b14456c7b583bba4ff973ff4b30f9

This is exactly how signed webhooks (Stripe, GitHub, Slack) and the HS256 algorithm in JSON Web Tokens authenticate a payload: the sender computes an HMAC with a shared secret, and the receiver recomputes it and compares.

Is MD5 secure?

No — MD5 has been cryptographically broken since the mid-2000s. Researchers can construct two different inputs that hash to the same MD5 digest (a collision) deliberately and quickly, which defeats its use for tamper detection, digital signatures or password storage. SHA-1 is also broken, though more expensively to attack than MD5. Both remain fine for non-adversarial checksums — catching an accidental download error, or telling two files apart during de-duplication — where nobody is trying to fool the hash on purpose.

MD5 vs SHA-256

PropertyMD5SHA-256
Output size128 bits (32 hex chars)256 bits (64 hex chars)
Collisions found?Yes, deliberately, in secondsNone known
Safe for signatures/passwords?NoYes (as a building block; passwords still need bcrypt/Argon2)
Typical use todayLegacy checksums, non-adversarial de-duplicationSoftware downloads, TLS, Git, blockchains

Generate a hash on the command line or in code

  • Linux/macOS: sha256sum file, md5sum file, or shasum -a 256 file on a Mac without GNU coreutils.
  • Windows: certutil -hashfile file SHA256, or PowerShell's Get-FileHash file -Algorithm SHA256.
  • OpenSSL: openssl dgst -sha256 file.
  • Python: hashlib.sha256(data).hexdigest().
  • JavaScript (this tool's own approach): await crypto.subtle.digest("SHA-256", data) — Web Crypto, built into every modern browser and Node.js.

Related developer tools

  • Base64 encoder: encode a hash's raw bytes, or any file, as Base64.
  • JWT decoder: decode and verify the HMAC (HS256/384/512) signature on a JSON Web Token.
  • UUID generator: v3 and v5 UUIDs are themselves MD5/SHA-1 hashes of a namespace and a name.

Frequently asked questions

What is a hash (checksum)?

A hash function turns any input — text, a file, anything — into a short, fixed-length string called a digest, hash or checksum. The same input always produces the same output, but a good hash function makes it practically impossible to work backwards from the digest to the original data, or to find two different inputs with the same digest. "Hello, World!" always hashes to dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f in SHA-256, on any device, forever.

Is MD5 secure?

No. MD5 is cryptographically broken: researchers can deliberately construct two different files that produce the same MD5 hash (a "collision") in seconds on ordinary hardware. Never rely on MD5 to detect tampering, verify a digital signature, or store a password. It is still fine for non-adversarial checksums — catching accidental corruption during a download or de-duplicating files — because nobody is trying to fool it.

MD5 vs SHA-256: what is the difference?

Both turn data into a fixed-length hash (MD5 is 128 bits/32 hex characters, SHA-256 is 256 bits/64 hex characters), but only SHA-256 is currently considered cryptographically secure — no collision has been found, and none is expected with existing computing power. MD5 is faster and shorter, which is why old software still uses it for quick, non-adversarial checksums, but SHA-256 (or SHA-512) is the right choice for anything security-relevant: software downloads, digital signatures, blockchains, TLS certificates. For "Hello, World!": MD5 is 65a8e27d8879283831b664bd8b7f0ad4, SHA-256 is dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f.

How do I verify a file checksum?

Hash the file you downloaded with the same algorithm the publisher used (check their download page — it is usually SHA-256 today, sometimes still MD5 or SHA-1), then paste their published hash into "Compare with an expected checksum" above. A green match confirms the file is byte-for-byte identical to what they published; a mismatch means the download is corrupted, incomplete, or (rarely) tampered with. The comparison ignores case, surrounding whitespace, and common prefixes like "sha256:" or the filename that tools like sha256sum print alongside the hash.

What is HMAC, and how is it different from a plain hash?

HMAC (Hash-based Message Authentication Code, RFC 2104) combines a hash function with a secret key, so the result depends on both the message and the key. Anyone can compute a plain hash of a message, but only someone who knows the key can compute (or verify) its HMAC — which proves the message came from someone who holds that key and was not altered in transit. It is how webhooks, signed API requests and JWT "HS256" tokens authenticate a payload. HMAC-SHA-256 of "Hello, World!" with the key "secret-key" is 16ee525f6c944ff49a368cd593eb7b72883b14456c7b583bba4ff973ff4b30f9; change one character of either input and the whole output changes.

Can I use this tool to hash a password?

You can compute a hash of a password here, but you should not store passwords this way. MD5, SHA-1, SHA-256 and SHA-512 are all fast, general-purpose hash functions designed to run billions of times a second — exactly the property that makes them useless against an attacker who steals a password database and tries billions of guesses per second (a "brute-force" or "rainbow table" attack). Passwords need a deliberately slow, salted algorithm such as bcrypt, scrypt or Argon2, which this tool does not implement.

Can two different files have the same hash (a collision)?

In theory yes, for any hash function with a finite output size, but for a secure algorithm it should be computationally infeasible to find one on purpose. MD5 and SHA-1 are both broken in this sense — real collisions have been demonstrated — which is why they are marked "broken" above. No collision has ever been found for SHA-256 or SHA-512, and finding one is expected to stay out of reach for the foreseeable future.

Is my file or text uploaded when I hash it?

No. Everything runs locally in this browser tab using the Web Crypto API (crypto.subtle) and a small MD5 implementation for the one algorithm Web Crypto doesn't provide. Files are read from disk by JavaScript and hashed in memory; nothing is sent to a server, logged, or saved. This tool reads files up to 500 MB, showing a progress bar while it reads.

Hex or Base64 — which output should I use?

Hexadecimal (base 16, using 0-9 and a-f) is the traditional, most widely recognised format — it's what sha256sum, md5sum, and most download pages print. Base64 encodes the same bytes more compactly (about 33% shorter) and is common in HTTP headers, JSON APIs and some HMAC signatures (e.g. AWS, many webhook providers). Both represent the identical underlying bytes; SHA-256 of "Hello, World!" is dffd6021bb2bd5b0af676290809ec3a53191dd81c7f70a4b28688a362182986f in hex and 3/1gIbsr1bCvZ2KQgJ7DpTGR3YHH9wpLKGiKNiGCmG8= in Base64 — use whichever format the system you're comparing against expects.

How do I generate a hash in the terminal or in code?

Linux/macOS: md5sum file, sha1sum file, sha256sum file, or shasum -a 256 file on macOS without GNU coreutils. Windows: certutil -hashfile file SHA256, or Get-FileHash file -Algorithm SHA256 in PowerShell. OpenSSL: openssl dgst -sha256 file. Python: hashlib.sha256(data).hexdigest(). Node.js/JavaScript: crypto.subtle.digest("SHA-256", data) (Web Crypto, the same API this tool uses) or the Node crypto module's createHash("sha256").

This tool is provided as is for development, debugging and checksum verification. MD5 and SHA-1 are cryptographically broken; never use a plain hash to store a password (use bcrypt or Argon2 instead). Spotted a wrong result? Tell us. Last reviewed .