Hash Generator

Generate SHA-1, SHA-256, and SHA-512 hashes.

This converts text into a fixed length string, a hash, using a one way function like SHA-1, SHA-256, or SHA-512. The same input always produces the same hash, but even a tiny change to the input produces a completely different result, and there's no practical way to reverse it back into the original text.

How to use it

  1. Type or paste the text you want to hash.
  2. Choose the algorithm, SHA-1, SHA-256, or SHA-512.
  3. Read the generated hash right below.
  4. Switch algorithms to compare how the same text hashes differently under each.
  5. Copy the hash for verification or comparison.

When it helps

  • Verifying a downloaded file hasn't been altered by comparing its published hash to one you calculate yourself.
  • Generating a checksum for a piece of text to detect any future change.
  • Creating a fixed length identifier from a longer piece of text for use as a cache key.
  • Learning how hashing works by seeing how small text changes affect the output.
  • Comparing two pieces of text for exact equality by comparing their hashes.

Good to know

  • SHA-256 is a solid general purpose choice. SHA-1 is now considered weak for security critical use.
  • Never use a plain hash alone to store passwords. Proper password storage needs extra steps like salting and slow hashing built for that purpose.
  • Even one character difference in the input, like a capital letter, produces a completely different hash.
  • When verifying a download's integrity, always compare hashes using the same algorithm the publisher provided. Comparing a SHA-256 hash against a SHA-1 hash will never match, even for identical files.
  • If you're documenting a hash for someone else to verify later, include which algorithm you used alongside the hash itself, since the hash alone doesn't say which one produced it.

Questions

Can a hash be reversed back to the original text?

No, cryptographic hash functions are built to be one way. There's no shortcut to recover the original input from the hash alone.

Why do SHA-1, SHA-256, and SHA-512 give different length results?

Each algorithm always produces a fixed length hash by design. SHA-1 gives 160 bits, SHA-256 gives 256, and SHA-512 gives 512, no matter the input length.

Is SHA-1 still safe to use?

It has known weaknesses that make it unsuitable for anything security critical, like a digital signature, though it's sometimes still used for simple checksums where security isn't the concern. SHA-256 or SHA-512 are safer choices.

Could two different texts ever produce the same hash?

This is called a collision, and while theoretically possible for any hash function, a strong algorithm like SHA-256 makes it so unlikely by chance that it isn't a practical concern for everyday use.

Can I hash a file instead of typed text?

This particular tool hashes text you type directly. Hashing a whole file would need reading its binary contents first, which this text focused version doesn't include.

Does the same text always produce the same hash on any device?

Yes, a given hashing algorithm applied to the same exact input text always produces the same output, regardless of what device or browser calculated it.