CraftTools

Hash Generator

Guide: What Is a Hash Function? MD5, SHA-256 and Bcrypt Explained

MD5 (not secure, checksums only)
…
SHA-1
…
SHA-256
…
SHA-384
…
SHA-512
…

Nothing you enter or choose here leaves your device. This tool runs in your browser.

Test values you can check against

If you're writing code that hashes things, you need a known answer to compare with. These are standard, and the tool should match them exactly:

InputAlgorithmHash
(empty text)MD5d41d8cd98f00b204e9800998ecf8427e
abcMD5900150983cd24fb0d6963f7d28e17f72
abcSHA-1a9993e364706816aba3e25717850c26c9cd0d89d
(empty text)SHA-256e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
abcSHA-256ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad

The empty-input row is useful. It's the hash you get when a file turned out to be empty, and spotting it tells you a download or an upload went wrong.

Why your hash doesn't match

Nine times out of ten, the difference is invisible. A hash covers every byte, so one extra character changes everything:

  • A trailing newline. Typing abc in a command line with echo adds a line break, which makes it a different input. Use printf or echo -n to leave it off.
  • Spaces and line endings. A leading space, a tab where you expected a space, or Windows line breaks (two bytes) instead of Unix ones (one byte).
  • Capital letters. Abc and abc hash differently, but hex output can be shown in capitals or lowercase for the same hash. Compare ignoring case.
  • A different text encoding. UTF-8 and UTF-16 give different bytes for the same text. This tool uses UTF-8.

Hashing a file

Choose Hash a file instead and the file is read in your browser, never uploaded. Use it to confirm a download, as in the guide to checksums. Copy the checksum the publisher lists, compare it with SHA-256 here, and if every character matches, the file is intact. To compare two files directly without reading hashes, use the file hash compare tool.

What the secret key does

Adding a key switches the output to an HMAC, which mixes the key into the hash. Only someone with the key can produce or check the result. Services use this to sign webhooks and API requests. When a service sends you a webhook, it includes an HMAC of the body. You compute the HMAC yourself with the shared key and compare. If they match, the message is genuine and unchanged. Use SHA-256 for this.

Which one to pick

  • SHA-256: the default choice for checksums, signatures and fingerprints.
  • SHA-512: a longer result, same safety. Sometimes faster on 64-bit machines.
  • MD5 and SHA-1: broken for security because collisions can be created, but fine for spotting accidental damage or building cache keys.
  • None of these for passwords. They're too fast. Use bcrypt, as explained in the guide to hash functions, and try the bcrypt generator.

How long each hash is

AlgorithmBitsLength in hex characters
MD512832
SHA-116040
SHA-25625664
SHA-512512128

The length is a quick way to tell which algorithm produced a hash you find in a log or a database. A 64-character hex string is almost certainly SHA-256.

Everyday uses outside security

  • File names that change with content. Many sites add a short hash to a file name, like app.3f9a1c.js, so browsers fetch a new copy only when the file changes.
  • Finding duplicates. Hash two files and compare. Equal hashes mean equal files, without opening either.
  • Version control. Git names every commit by its hash, so history can't be altered without anyone noticing.

Written by Akinrinmade Michael · Updated October 24, 2026

How to use

  1. 1Type or paste text, or choose a file to hash.
  2. 2Optionally add a secret key to create an HMAC instead of a plain hash.
  3. 3Read the five hashes, shown instantly.
  4. 4Click Copy next to the one you need.

Frequently asked questions

Which hash should I use?

Use SHA-256 or SHA-512 for anything security related. MD5 and SHA-1 are broken for security, but are still fine for checking that a file wasn't corrupted.

Can I hash a file?

Yes. Choose "Hash a file instead" and the file is read in your browser and never uploaded. Files up to 500 MB work, depending on your device's memory.

What is an HMAC?

An HMAC mixes a secret key into the hash so only someone with the key can create or check it. It is used to sign API requests and webhooks.

Can a hash be reversed?

No. Hashing is one way. Short or common inputs can be guessed with lookup tables, which is why passwords should be hashed with a slow, salted algorithm such as bcrypt or Argon2.

Read the guides

Learn how this works and how to get the most from it.

Security

What Is a Hash Function? MD5, SHA-256 and Bcrypt Explained

Learn what hashing does, why the same input always gives the same hash, which algorithms are still safe, and why passwords need bcrypt.

3 min read

Security

How to Create a Strong Password (and Keep It Safe)

Why length beats complexity, how long a password should be, how passphrases work and how developers should store passwords.

4 min read

Security

How to Check a Download With a Checksum (and Why It Matters)

What a checksum is, how to compare a file against the one on a download page, which hash to trust, and what to do if the result doesn't match.

3 min read

Developer

UUID, ULID and NanoID: Which Unique ID Should You Use?

How UUID v4, UUID v7, ULID and NanoID differ, why sortable IDs help databases, and how to pick the right one for your project.

3 min read

File Hash Compare

Check a download against its checksum, or compare two files.

AES Encrypt & Decrypt

Lock text or files with a password, right in your browser.

Bcrypt Hash Generator & Checker

Generate bcrypt password hashes and check a password against a hash.

RSA & SSH Key Pair Generator

Make SSH and PEM key pairs: Ed25519, RSA or ECDSA.