Skip to content
ToolkitHub

Hash Generator

Generate MD5, SHA-1, SHA-256, SHA-512 hashes

Guide

About the MD5, SHA-1, SHA-256 and SHA-512 hash generator

By Logappradeep · ServiceNow developer

A cryptographic hash function turns input of any length into a fixed-length fingerprint called a digest. The same input always produces the same digest, a tiny change produces a completely different one, and it should be infeasible to work backward from the digest to the input or to find two inputs with the same digest. Those properties make hashes useful for checking integrity, deduplicating data and building signatures.

The four algorithms

  • MD5 produces a 128-bit digest, shown as 32 hex characters.
  • SHA-1 produces 160 bits, or 40 hex characters.
  • SHA-256 is part of the SHA-2 family and produces 256 bits, or 64 hex characters.
  • SHA-512, also SHA-2, produces 512 bits, or 128 hex characters.

For example, the SHA-256 digest of the five characters hello is:

2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

Add a single newline after the word and the digest becomes 5891b5b5...be03, with no visible similarity. That sensitivity, called the avalanche effect, is the point.

Where hashes are used

  • Verifying that a downloaded file matches the checksum published by its author.
  • Generating cache keys or ETags from content.
  • Detecting duplicate records or files without comparing them byte by byte.
  • Content addressing, as in Git object IDs, which historically use SHA-1.

Security pitfalls

MD5 and SHA-1 are broken for collision resistance. Researchers have produced different inputs with the same MD5 digest since 2004, and a public SHA-1 collision was demonstrated in 2017. They are still fine as non-security checksums, but never use them for digital signatures, certificates or anything an attacker could tamper with. Choose SHA-256 or SHA-512 for new work.

No fast hash is safe for passwords. SHA-256 is designed to be fast, and modern GPUs compute billions of hashes per second, so a leaked table of SHA-256 password hashes can be cracked quickly, especially without a per-user salt. Store passwords with a deliberately slow, salted algorithm built for the job: Argon2id, scrypt, bcrypt or PBKDF2.

Hashing is not encryption. A hash cannot be decrypted. Sites that claim to "decrypt MD5" simply look up digests of common strings in precomputed tables, which is exactly why unsalted hashes of short inputs are weak.

Bytes matter. A hash is computed over bytes, not visible characters. Trailing spaces, Windows line endings (\r\n) versus Unix ones (\n), and text encoding all change the result. This tool hashes your text as UTF-8, which is what most command-line tools and libraries use.

Hashes are computed locally in your browser using the crypto-js library, and the text you type is not stored or sent anywhere.

Frequently asked questions

Can I reverse a hash to get the original text?

No. Hash functions are one-way. Online "decrypters" only look up digests of common inputs in precomputed tables.

Is SHA-256 good for storing passwords?

No. It is too fast, which makes brute-force attacks cheap. Use a slow, salted password hashing algorithm such as Argon2id, scrypt or bcrypt.

Is MD5 still useful?

As a quick non-security checksum, yes. It should not be used anywhere an attacker could benefit from creating a collision, such as signatures or certificates.

Why does my hash differ from the one my terminal shows?

Commands like echo add a trailing newline unless you use echo -n, and line endings or encoding differences also change the bytes being hashed.