Home ↓
CalculatorsVerified

Tech & Digital

Hash Generator (SHA-256, SHA-1, MD5)

Calculate the SHA-256, SHA-1 and MD5 digests of any text. Type or paste the text and the three hashes appear in lowercase hexadecimal, computed in your browser with the algorithms defined by NIST and the IETF. Paste an expected hash in the optional field to check whether it matches.

More options

How to use this calculator

  1. Type or paste the text you want to hash; spaces and line breaks count.
  2. Read the SHA-256 digest, which is the one to use for integrity and security.
  3. SHA-1 and MD5 are shown for compatibility with older systems.
  4. To verify, paste the expected hash in the comparison field.
  5. Remember that changing a single character produces a completely different hash.

What a hash function does

A cryptographic hash function turns input of any length into a fixed-length fingerprint. The same input always gives the same hash, but changing even one bit of the input changes about half of the output bits, and it is computationally infeasible to find the input from the hash or to find two inputs with the same hash. These properties make hashes useful for checking that a downloaded file has not been altered, for storing password verifiers (with a proper password-hashing scheme), for digital signatures and for blockchains.

Software publishers often list the SHA-256 checksum next to a download. After downloading, you hash the file and compare: if the values match, the file is identical to the one the publisher hashed.

SHA-256, SHA-1 and MD5

SHA-256 belongs to the SHA-2 family standardised by the US National Institute of Standards and Technology in FIPS 180-4 and is the current default for integrity checks, TLS certificates and code signing. SHA-1 and MD5 are older. Researchers have produced real collisions for both — two different inputs with the same hash — so NIST has deprecated SHA-1 for digital signatures and MD5 should not be used for any security purpose. They remain useful only for non-adversarial tasks such as detecting accidental corruption or matching legacy checksums. For storing passwords, none of these should be used directly; use a dedicated slow function such as Argon2, scrypt or PBKDF2.

Getting the same hash as other tools

Hashes are computed on bytes, so the exact bytes matter. This calculator encodes text as UTF-8, the standard on the web and in most programming languages. A different encoding, a trailing newline added by a text editor, or Windows line endings (CR LF instead of LF) will all give a different hash even if the text looks identical. The empty string, for example, has the SHA-256 e3b0c442…b855, a value you may recognise from many tools. Everything is computed locally in your browser: the text you type is never sent anywhere.

Formula & method

SHA-256 and SHA-1: NIST FIPS 180-4 Secure Hash StandardMD5: RFC 1321The text is encoded as UTF-8 bytes before hashing; the digest is shown in lowercase hexadecimal

SHA-256 and SHA-1 follow the NIST Secure Hash Standard FIPS 180-4; MD5 follows RFC 1321. The text is first encoded as UTF-8 bytes. SHA-256 outputs 256 bits (64 hexadecimal characters), SHA-1 160 bits (40 characters) and MD5 128 bits (32 characters).

Worked example

Hashing "abc"

  1. SHA-256: ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad
  2. SHA-1: a9993e364706816aba3e25717850c26c9cd0d89d
  3. MD5: 900150983cd24fb0d6963f7d28e17f72

Answer: These are the official test vectors published with the standards, so the calculator's output can be checked against them.

Frequently asked questions

Can I recover the text from its hash?

No. Hashes are one-way. Short or common inputs can be guessed by trying candidates, which is why passwords need special slow hashing.

Which hash should I use?

SHA-256 for integrity and security. Use SHA-1 or MD5 only to match an existing legacy checksum.

Why is MD5 considered broken?

Different inputs with the same MD5 can be created deliberately, so an attacker can substitute data without changing the hash.

Why does my hash differ from another tool?

Usually because of a hidden difference in bytes: a trailing newline, a different text encoding or different line endings.

Is a hash the same as encryption?

No. Encryption can be reversed with the key; a hash cannot be reversed at all.

Is my text uploaded?

No. The hashes are calculated in your browser.