Hash generator

The hash generator calculates MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes of text or a file, creates an HMAC with a secret key, and checks a value against an existing hash.
Input
Input source
Up to 5 MB. Short text is hashed as you type, and long text when you press "Calculate".
When filled, an HMAC with the key is calculated instead of a plain hash.
Result format
Done. Text size in bytes: 30.
Hash values
Paste an expected hash, in hex or Base64, to see which algorithm it matches. Hex is not case-sensitive.

Everything runs in your browser; nothing is sent or stored.

  • Choose "Text" or "File". Text of up to 5 MB is hashed as UTF-8, and you can choose a file of up to 50 MB.
  • All five algorithms are calculated together. Input of up to 100 KB is hashed instantly, and larger input when you click "Calculate". MD5 and SHA-1 are suitable only for checking the integrity of files and data, not for storing passwords or for security.
  • Enter a secret key to calculate an HMAC instead of a plain hash. With HMAC, only the SHA algorithms are calculated.
  • Choose the result format: lowercase hex, uppercase hex, or Base64.
  • Paste an expected hash, in hex or Base64, in the "Compare with an existing hash" field to see which algorithm the value matches.
  • Copy any result with the "Copy" button next to it.

What is a hash function

A hash function turns input of any size into a fixed-length value that serves as a fingerprint of the input. The same input always produces the same value, and changing a single character changes the whole value. The length of the value depends on the algorithm: an MD5 hash has 32 hex digits, SHA-1 has 40, SHA-256 has 64, SHA-384 has 96, and SHA-512 has 128.

Checking file integrity

Download sites often publish a SHA-256 checksum next to a file. After the download, choose the file in the generator, paste the published value in the compare field, and confirm that the file arrived complete and unchanged. In a terminal, you can calculate the same value with sha256sum file on Linux, shasum -a 256 file on macOS, or Get-FileHash -Algorithm SHA256 file in PowerShell.

What is HMAC

An HMAC (Hash-based Message Authentication Code) adds a secret key to the hash calculation, so only someone who holds the key can produce the same value. With HMAC, you can confirm that a message was sent by someone who holds the key and that it was not changed on the way, for example when signing webhook messages and API requests. JWTs with the HS256 algorithm are signed with HMAC-SHA-256. The key is used as UTF-8 text, exactly as entered, so any difference in uppercase, lowercase, or spaces produces a different HMAC value.

Examples

  • 900150983cd24fb0d6963f7d28e17f72the MD5 hash of the text abc.
  • ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015adthe SHA-256 hash of the text abc.
  • ungWv48Bz+pBQUDeXa4iI7ADYaOWF3qctBD/YfIAFa0=the same SHA-256 hash in Base64.
  • 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824the SHA-256 hash of the text hello.
  • 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969the SHA-256 hash of the text Hello, completely different from the hash of hello.
  • 5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03the SHA-256 hash of the text hello with a trailing newline, as returned by the command echo hello | sha256sum.
  • 88aab3ede8d3adf94d26ab90d3bafd4a2083070c3bcce9c014ee04a443847c0bthe HMAC-SHA-256 of the text hello with the key secret.

Hash generator FAQ

Why is the hash in the generator different from the hash in my terminal?

The most common reason is a newline at the end of the input. The echo command adds a newline to the text, so in the terminal use echo -n or printf instead. An extra space, a Windows line break, or text saved in an encoding other than UTF-8 also changes the result.

Are MD5 and SHA-1 still safe to use?

MD5 and SHA-1 are fine for detecting accidental changes to a file, such as an interrupted download, but they do not protect against deliberate changes. There are known practical methods for creating two different files with the same MD5 or SHA-1 hash. For signing and verifying files, use SHA-256 or stronger.

Can I store passwords as SHA-256 hashes?

Storing passwords as SHA-256 hashes is not recommended, because the SHA algorithms are very fast, and a single graphics card can test billions of guesses per second against a leaked hash. To store passwords, use a slow algorithm designed for the purpose, such as bcrypt or Argon2, which adds a random value (a salt) to every password. To create a bcrypt hash, you can use the bcrypt and htpasswd generator.

Can a hash be decrypted back to text?

A hash cannot be decrypted, because a hash function is not encryption, and there is no key that can restore the input from it. However, hashes of short or common inputs, such as simple passwords, are stored in large databases of precomputed values, so they can be found with a simple lookup.

Why does the comparison say no match was found?

The comparison looks for an exact match with one of the five values shown. The message appears when the input differs from the original input, for example a different file or text with a newline, when only part of the value was pasted, or when the secret key field is filled and the expected value is a plain hash. Spaces in the expected value and differences between uppercase and lowercase hex do not affect the comparison.

Do the file name or modification date affect the hash?

The file name and the modification date do not affect the hash, because the hash is calculated from the file contents only, and copying the file to another folder does not change the value either. However, saving the file again in an editor that changes the type of line breaks changes the contents, and therefore the value.

Shopping cart

Your cart is emptyYou can start with one of our popular plans.

Site search

Accessibility

Text size
100%
Accessibility statement