Hash Generator

Type any text and instantly get its SHA-1, SHA-256, SHA-384, and SHA-512 hash values.

SHA-1 (160-bit)

-

SHA-256 (256-bit)

-

SHA-384 (384-bit)

-

SHA-512 (512-bit)

-

What a hash is, and what it is not

A hash function takes input of any size, from a single word to a multi-gigabyte file, and returns a value of fixed length called a hash or digest. A well-designed cryptographic hash function is built to have three properties. The same input always gives the same output. It is infeasible to work backwards from the output to an input (preimage resistance). And it is infeasible to find two different inputs with the same output (collision resistance). A change of even one character should scramble the output completely, which is called the avalanche effect. You can see it above: the SHA-256 of hello and of Hello differ in about 125 of their 256 bits, close to the half you would expect from a good function.

A hash is not encryption. Encryption can be undone with the right key; a hash has no way back at all. So phrases like "decrypt a hash" are misleading. The websites that claim to do it simply look your hash up in huge tables of values computed in advance for common words and passwords, which works only for inputs someone has already tried.

Which algorithm should you pick?

Output length is measured in bits, and written in hexadecimal it takes bits Γ· 4 characters, which is how the "hex characters" column below was computed. Paste the same text into the tool and you will see the lengths differ in exactly that way.

AlgorithmOutput bitsHex charactersPublishedIn this toolStatus
MD5128321992Not in this toolPractical collision attacks exist. Not for security use; acceptable only as a plain checksum.
SHA-1160401995YesA real collision (SHAttered) was published in 2017. Not for security use.
SHA-256256642001YesWidely used standard; no practical attack known.
SHA-384384962001YesA truncated variant of SHA-512; no practical attack known.
SHA-5125121282001YesOften faster than SHA-256 on 64-bit CPUs; no practical attack known.

MD5 and SHA-1: fine for checksums, not for security

Researchers published a way to build MD5 collisions in 2004, and the attacks have improved since, to the point where two different files with the same MD5 can be produced on an ordinary computer in a short time. The weakness was reported to have been used in the real-world Flame malware to forge a certificate in 2012. SHA-1 followed: in 2017 Google and CWI researchers published the first practical collision (the SHAttered attack), and NIST has announced a phased retirement of SHA-1 in favour of the SHA-2 and SHA-3 families by 2030. Neither should be used where an attacker could interfere: digital signatures, certificates, integrity guarantees for software you distribute. Both are still commonly used where no attacker is involved, such as spotting a corrupted transfer, building a cache key or finding duplicate files. The version-control system Git still uses SHA-1 for object names, but that is not a signature use, it includes protection against known collision attacks, and a move to SHA-256 is under way. For a new design, do not choose either one.

The SHA-2 family

SHA-256, SHA-384 and SHA-512 belong to the SHA-2 family, designed by the US National Security Agency and standardised by NIST in 2001. They sit under certificates, code signing, package managers and blockchains, and no practical collision attack is known. SHA-384 is SHA-512 with different starting values and a shortened output. For most purposes SHA-256 is the default; SHA-512 is a reasonable pick on 64-bit hardware or when you want a larger margin. SHA-3, standardised in 2015, has a completely different internal design, but the Web Crypto API that this page relies on does not offer it, and it does not offer MD5 either. That is why this tool lists only SHA-1 and the SHA-2 algorithms.

Keyed integrity needs HMAC

If you want to prove that a message came from someone who holds a secret key, do not simply hash the key followed by the message. SHA-1, SHA-256 and SHA-512 are built in a way that allows length-extension attacks on that construction, in which someone who sees the hash can compute the hash of the message with extra data appended without knowing the key. Use HMAC, which is designed for this purpose. This tool computes plain, unkeyed hashes only.

Never use a plain hash to store passwords

"Store passwords as hashes" is only half of the right advice. It beats storing them in plain text, but a general-purpose hash such as SHA-256 on its own is not suitable for password storage, and this tool must not be used to build that logic. There are three reasons.

The right tools are functions designed to be slow and tunable for passwords: Argon2id, scrypt, bcrypt or PBKDF2, which handle salting and let you raise the cost over time. Check a current reference such as the OWASP Password Storage Cheat Sheet for the function and parameters to use. If you only need a strong password for yourself, use a generator rather than anything built from hashes.

Practical uses

Checking that a download was not altered

When a publisher lists a SHA-256 value next to a file, hash the file yourself and compare the strings. This tool hashes text only, not files. For files, use your operating system: on Windows runcertutil -hashfile yourfile SHA256; on macOS and many Linux systems runshasum -a 256 yourfile, or sha256sum yourfile on Linux. If the checksum was published on the same page you downloaded from, an attacker who changes the file could have changed the value too, so prefer a checksum served from a different channel, such as the official site over HTTPS or a signed release note.

Spotting changes and duplicates

Comparing two short hashes is much faster than comparing two large blobs, so hashes are used to detect that a configuration changed, to deduplicate content and to build cache keys. For these jobs SHA-256 is plenty.

Verified examples and common pitfalls

Example 1. The text abc has SHA-1 a9993e364706816aba3e25717850c26c9cd0d89dand SHA-256 ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad. These match the published test vectors for the algorithms, so you can use the text abc to confirm that any hash tool is behaving correctly.

Example 2. hello gives SHA-2562cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824. Change it to Helloand it becomes 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969. Add a single newline after hello and the value starts with 5891b5b5 instead. One character changes everything.

Example 3. The classic sentence The quick brown fox jumps over the lazy dog has a SHA-256 that begins d7a8fbb3; adding a full stop at the end makes it begin ef537f25.

Limits of this tool

It hashes text only; it does not read files, and it does not compute MD5, SHA-3, HMAC, salted hashes or password-hashing functions such as bcrypt and Argon2. Hashing runs in your browser through the Web Crypto API; what you type is never sent to a server. Do not paste real passwords or secrets into any web page you do not control as a habit, even one that runs locally.

Frequently Asked Questions

Can the original text be recovered from a hash value?

There is no mathematical way to reverse it. Short or common inputs can still be found by guessing candidates and comparing their hashes (dictionary attacks and lookup tables), so hashing a secret does not by itself protect it.

Do spaces or line breaks affect the result?

Yes. Hashes are computed over bytes, so one extra space, a different line ending or a changed capital letter produces a completely different value. If your result does not match another tool's, check line breaks and encoding first.

Should I stop using MD5 and SHA-1 completely?

Stop using them for anything security-related, such as signatures, certificates, password storage or tamper protection. They are still common for non-security checks like detecting a corrupted transfer or finding duplicates. For anything new, default to SHA-256 or stronger.

Is hashing a password with SHA-256 safe enough?

No. SHA-256 is very fast, which helps attackers who obtain your database, and you would have to handle salting yourself. Use Argon2id, bcrypt, scrypt or PBKDF2 through a well-reviewed library.

Do two different inputs ever give the same hash?

In principle yes, because there are infinitely many inputs and a finite number of outputs. What matters is whether anyone can find such a pair. That has been shown for MD5 and SHA-1, and no method is known for the SHA-2 family.

Related tools