Skip to content
codinganthem
All tools/Security/Hash Generator

Hash Generator

Generate MD5, SHA-1, SHA-256, and SHA-512 hashes instantly online, for free. Useful for checksums, file integrity checks, and password hashing.

20 chars
More
Buy me a coffee

What a hash is

A hash function turns any input into a fixed-length fingerprint. The same input always gives the same hash, and changing a single character changes the whole result. You can't reverse a hash back into its input, which is what makes hashes useful for checking integrity. Type or paste text and the tool shows MD5, SHA-1, SHA-256 and SHA-512 as you type.

Input: hello
MD5:     5d41402abc4b2a76b9719d911017c592
SHA-256: 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

Which algorithm to use

  • SHA-256: the default choice for checksums, signatures and content addressing. 64 hex characters.
  • SHA-512: a longer 128-character digest; similar security in practice, sometimes faster on 64-bit machines.
  • MD5 (32 characters) and SHA-1 (40 characters): broken for security, because collisions can be manufactured. Use them only to match legacy checksums, never for anything an attacker could exploit.

Why your hash doesn't match

  • A trailing newline: echo hello | sha256sum hashes hello plus a newline. Use echo -n or printf to match this tool.
  • Encoding: this tool hashes the UTF-8 bytes of your text. A system that uses UTF-16 or Latin-1 gives a different result for non-ASCII characters.
  • Case and whitespace: hashes are exact, so Hello and hello (with a space) differ completely.

Don't use plain hashes for passwords

SHA-256 is designed to be fast, which helps attackers try billions of guesses. Passwords need a slow, salted algorithm such as bcrypt, scrypt or Argon2; try the Bcrypt Generator. To prove a message came from someone holding a secret key, use an HMAC (HMAC Generator) rather than hashing the secret together with the message.

Frequently asked questions

Can a hash be decrypted?+

No. Hashing is one-way. Sites that claim to reverse MD5 just look the hash up in tables of common inputs, which is why short or common inputs aren't safe to hash on their own.

Is MD5 still safe to use?+

Not for security, since collisions can be created deliberately. It's fine for matching a legacy checksum where nobody is trying to cheat.

Why is my SHA-256 different from the command line?+

Usually a trailing newline: echo adds one. Use echo -n or printf, and make sure both sides use UTF-8.

Should I hash passwords with SHA-256?+

No. Use a slow password hashing algorithm such as bcrypt, scrypt or Argon2, which also adds a salt.