FLXCode Hash Generator

FLXCode apps

Appearance

Hash Generator

Get the MD5, SHA-1 and SHA-2 hashes of text or a file, and check them against a hash you were given.

Hash
Output
  • MD5not for security
  • SHA-1not for security
  • SHA-256
  • SHA-384
  • SHA-512

MD5 and SHA-1 are broken for security: do not use them for signatures, passwords or certificates. They are fine for checking that a download was not damaged.

No ads. No account. Nothing you type or record is uploaded. We count page events with a daily code. Check it. What this tool keeps and sends.

Problem or idea? Email us

Quick start

  1. Type or paste text, or switch to File and choose or drop a file. All five hashes appear.
  2. To check a download, paste the hash from its web page into Compare. A green Match names the algorithm.
  3. Tick HMAC with a key to sign instead of only hash. Hex and base64 are one click apart.

Which one to use

HashLengthHex digitsUse for
MD5128 bits32Checksums only. Broken for security.
SHA-1160 bits40Checksums only. Broken for security.
SHA-256256 bits64Checksums, signatures, integrity.
SHA-384384 bits96Checksums, signatures, integrity.
SHA-512512 bits128Checksums, signatures, integrity.

MD5 and SHA-1 are broken for security. Different inputs with the same MD5 can be made on purpose, which is why RFC 6151 says not to use MD5 where collision resistance matters. NIST disallows SHA-1 for digital signature generation (SP 800-131A Rev. 2). They are fine for catching a damaged download. Do not use any of these five on their own to store passwords: they are too fast. Use a slow password hash such as Argon2 or bcrypt.

Check a download

  • Linux: sha256sum file.iso
  • macOS: shasum -a 256 file.iso
  • Windows PowerShell: Get-FileHash file.iso -Algorithm SHA256, or certutil -hashfile file.iso SHA256

This page gives the same result without a terminal. A hash on the same web page as the download only protects against a damaged file, not against a changed site. Take it from a second place when it matters, such as a signed announcement.

Known answers

These come from the same engine as the tool. The first five are the examples of the standards (RFC 1321, FIPS 180-4) for the text abc.

Hash of "abc"Hex
MD5900150983cd24fb0d6963f7d28e17f72
SHA-1a9993e364706816aba3e25717850c26c9cd0d89d
SHA-256ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
SHA-384cb00753f45a35e8bb5a03d699ac65007272c32ab0eded1631a8b605a43ff5bed8086072ba1e7cc2358baeca134c825a7
SHA-512ddaf35a193617abacc417349ae20413112e6fa4e89a97ea20a9eeee64b55d39a2192992a274fc1a836ba3c23a3feebbd454d4423643ce80e2a9ac94fa54ca49f

The same SHA-256 in base64 is ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0=. One change of the input changes the whole hash:

TextMD5
(empty text)d41d8cd98f00b204e9800998ecf8427e
abc900150983cd24fb0d6963f7d28e17f72
The quick brown fox jumps over the lazy dog9e107d9d372bb6826bd81d3542a419d6
The quick brown fox jumps over the lazy dog.e4d909c290d0fb1ca068ffaddf22cbd0

HMAC-SHA-256 with the key Jefe and the text what do ya want for nothing? is 5bdcc146bf60754e6a042426089575c75a003f089d2739839dec58b964ec3843. That is test case 2 of RFC 4231.

How it works

The five algorithms are written in this page's code from the standards (RFC 1321 for MD5, FIPS 180-4 for SHA-1 and SHA-2, RFC 2104 for HMAC). The browser's own crypto cannot do MD5, and it cannot hash a file in pieces, so one small implementation does all five. We compare it with Python hashlib and hmac on 520 cases, including keys longer than the block size. A file is read in 4 MiB slices in a background worker. Text is turned into bytes as UTF-8.

Limits

  • No SHA-3, SHA-224, BLAKE or CRC32. No bcrypt or Argon2: those need a salt and a cost setting.
  • The HMAC key is text. A key given as hex bytes would need to be turned into text first, which is not the same key.
  • Hashing in JavaScript is slower than the command line. Expect tens to a few hundred MB per second for the five together, depending on your device.
  • Text is limited to 5 million characters. For more, use a file.

Nothing you type or open is uploaded or stored. We count events without cookies, like "a file was hashed" (details). See also Password Generator, UUID Generator and Cron Expression Generator.

FAQ

Is MD5 safe to use?

Not for anything where someone could cheat. RFC 6151 says it is not prudent to use MD5 when collision resistance is required, because two different inputs can be made with the same MD5. For checking that a file was not damaged in transit, or as a cache key, it still works.

Is SHA-1 safe to use?

Not for signatures. The first SHA-1 collision was made public in 2017 (SHAttered), and NIST disallows SHA-1 for generating digital signatures. As a plain checksum for non-hostile data it is still fine. Git uses it for object names, with extra collision detection.

Why is my hash different from the one on the website?

Usually the input is not the same bytes. A trailing line break counts, a different line ending (CRLF or LF) counts, and so does the text encoding. This page hashes text as UTF-8 exactly as typed, with no trailing newline added. echo adds a newline, so use echo -n in a shell. For a download, hash the file itself, not text copied from it.

What is HMAC, and when do I need it?

HMAC mixes a secret key into the hash (RFC 2104), so only someone with the key can make or check the tag. Use it for signing webhooks and API requests. A plain hash proves nothing about who made the message. The key here is read as UTF-8 text.

How big can a file be?

There is no limit set by the page. The file is read in 4 MiB pieces in a background worker, so memory stays small and the page keeps responding. Time is the limit: the status line shows the speed, and all five hashes are computed in one pass. Cancel stops it.

Hex or base64?

Both are the same bytes. Hex is what sha256sum and most download pages print. Base64 is shorter and appears in HTTP headers, JSON web tokens (as base64url) and package lock files. The compare box accepts either.

More from FLXCode

  • Cron Expression GeneratorBuild or explain a cron expression. Next 10 runs in any time zone, plus crontab, GitHub Actions and Kubernetes snippets.
  • Password GeneratorMake a random password or passphrase in your browser. See the entropy and its formula. Nothing is sent.
  • UUID GeneratorMake version 4 or version 7 UUIDs in your browser, 1 to 1,000 at a time. Copy or download as .txt.
  • JSON FormatterFormat, minify, sort and check JSON in your browser. Big numbers stay exact and errors show line and column.

Share Hash Generator