About the Hash Generator
Hashes act as fingerprints for data: the same input always gives the same hash, while a single changed character produces a completely different one. This hash generator computes MD5, SHA-1, SHA-256, SHA-384 and SHA-512 hashes of any text at once, which is useful for verifying downloads, comparing files, generating cache keys and learning how hashing works. The SHA-256 hash of hello, for example, begins 2cf24dba. MD5 and SHA-1 should not be used for security. For a single algorithm with file support, see the SHA-256 Generator, and for keyed hashes, the HMAC Generator.
All five algorithms run on the same input at the same moment: MD5, SHA-1, SHA-256, SHA-384 and SHA-512, each with its own copy button. The SHA results come from Web Crypto, the cryptography interface that browsers provide to secure websites, so they match any other correct implementation. Web Crypto does not offer MD5, so that one is calculated by code inside this page, and it still gives the standard result.
A hash only works in one direction. No calculation turns a digest back into the text that produced it, which is why hashes are used to check data rather than to store it. Bear in mind that SHA-1 can now be broken by a determined attacker who chooses the input, so it should never be used for signatures or certificates. It is still listed because older systems produce it, and checking one of their values is a legitimate everyday task.
How to use the Hash Generator
- Type or paste the textAnything you want a fingerprint of, from one word to a long document.
- Watch the resultsAll five hashes are recalculated together while you type.
- Copy the one you needEach algorithm has its own copy button.
- Verify a valuePaste a hash you were given into the comparison box to see whether it matches.
Hash Generator features
- Five algorithms at once: MD5, SHA-1, SHA-256, SHA-384 and SHA-512
- MD5 and SHA-1 labelled as legacy, fit for checksums only
- SHA digests produced by the cryptography engine inside your browser
- Text encoded as UTF-8, so accents and emoji hash correctly
- Results update as you type
- A checking field that says yes or no when you paste an expected digest
- One-click copy for each value
- Nothing is uploaded or stored
Common uses
- Checking a value against a checksum published with a download
- Creating a stable ID from a piece of text
- Confirming that two blocks of text are exactly identical
- Building a cache key from a set of request parameters
- Seeing how one changed letter alters the whole hash
Hashes in practice: verifying downloads, Git, cache fingerprints, the avalanche effect and broken algorithms
Hash functions turn any input into a short, fixed-length fingerprint, and they quietly underpin downloads, version control, caching and security. Choosing the right algorithm, and understanding what hashes can and cannot do, avoids both wasted effort and real security weaknesses. This guide demonstrates the avalanche effect with two city names, shows how to verify a download, explains hashes in Git and web caching and summarises which algorithms are broken.
A worked example: the avalanche effect
The SHA-256 hash of the word Lahore begins 3048eb5b, while the hash of lahore, differing only in the capital letter, begins feb81ca4. The two 64-character results share no visible pattern. This avalanche effect, where a tiny change in input transforms the whole output, is what makes hashes useful for detecting changes: if two files have the same SHA-256 hash, they are, for all practical purposes, identical.
Verifying downloads
Software publishers often list a SHA-256 checksum next to each download. After downloading, computing the file's hash and comparing it with the published value confirms the file is complete and has not been altered. This matters for operating system images and tools downloaded from mirrors, where corrupted or tampered files are possible.
Hashes in Git
Git identifies every commit, file and directory by a hash of its contents, which is why commit IDs look like long hexadecimal strings. Because the hash covers the content and history, any change produces a new ID. Git has historically used SHA-1 and has been adding support for SHA-256 for stronger protection.
Cache fingerprints
Websites often add a short hash of a file's contents to its name, such as app.3f2a1c.js. When the file changes, its name changes, so browsers fetch the new version, while unchanged files can be cached for a long time. Servers also use hashes in ETag headers to tell browsers whether their cached copy is still current.
Which algorithms are broken
MD5 has been broken since researchers demonstrated practical collisions in 2004, meaning two different inputs can be crafted to produce the same hash. SHA-1 fell in 2017, when a team from Google and CWI Amsterdam produced two different PDF files with the same SHA-1 hash. Both remain usable for detecting accidental corruption, but not for security, where SHA-256 or stronger should be used.
Hashes are not encryption
A hash cannot be reversed to recover the input, and it is not a way to hide data that you need to read again. For secrets you need to recover, use encryption; for passwords, use slow, salted password-hashing algorithms designed for the purpose, not general hashes.
Keyed hashes
A plain hash proves that data has not changed only if the hash itself is trusted. When a message and its hash travel together, an attacker could change both. A keyed hash, called an HMAC, mixes in a secret key, so only someone with the key can produce a valid value, which is how many APIs sign requests and webhooks.
Output formats
Hashes are usually shown in hexadecimal, two characters per byte, so a SHA-256 hash is 64 characters. Some systems show the same bytes in Base64, which is shorter. When comparing hashes from different tools, make sure both use the same format and the same input bytes, including line endings.
Common mistakes
- Using MD5 or SHA-1 for security purposes.
- Treating hashing as encryption.
- Comparing hashes of text with different line endings or encodings.
- Storing passwords with fast general-purpose hashes.
Related tools
For keyed signatures, use HMAC Generator. For a single algorithm, try SHA-256 Generator, and for quick error-checking codes, CRC32 Checksum Calculator.
Hashing files in the terminal
Operating systems include commands for hashing files: sha256sum file.iso on Linux, shasum -a 256 file.iso on macOS and certutil -hashfile file.iso SHA256 on Windows. Comparing the output with a published checksum takes seconds and confirms a download is intact.
Finding duplicates
Backup and storage systems use hashes to find duplicate files: if two files share a hash, only one copy needs storing. Photo libraries use similar ideas for identical images, though spotting near-duplicates, such as resized copies, needs different techniques.
Hash tables
Programming languages use hash functions internally to build fast lookup structures such as dictionaries and maps. These functions are designed for speed rather than security, which is why they differ from cryptographic hashes like SHA-256.
Blockchains
Cryptocurrencies use hashes to link blocks of transactions together, so changing an old record would change every hash after it. Mining in some systems involves searching for inputs whose hashes meet a target, which consumes large amounts of computation and energy.
Comparing hashes safely
When comparing a hash against an expected value in security-sensitive code, such as checking a signature, use a constant-time comparison function. Ordinary string comparison can stop at the first difference, which in rare cases leaks timing information an attacker could exploit.
Privacy
Hashes are computed in your browser. The text you enter is never uploaded.
Further reading: How to Create Strong Passwords and Keep Your Accounts Safe and Base64, URL Encoding and Hashing: What Is the Difference?.
Frequently asked questions
Is there a way to recover the input from its digest?
No. Hashing is designed to work in one direction only. Recovering an input means guessing candidates and hashing each of them until one fits, which is why short or common passwords fall quickly while long random ones do not.
Is MD5 still safe to use?
Only for matching an existing MD5 checksum. It is badly broken, since anyone can create two inputs with the same MD5 in seconds, so it proves nothing against an attacker. It still catches accidental corruption and matches what older databases store.
Is SHA-1 still safe to use?
Not for anything new. Researchers have produced real SHA-1 collisions, so it must never protect digital signatures, TLS certificates or anything an attacker could tamper with. It appears here only so you can check values produced by older software.
Which algorithm should I pick?
SHA-256 is the sensible general choice. SHA-512 is not meaningfully safer for most purposes but runs faster on 64-bit processors, which is why some systems choose it, while SHA-384 is a shortened version of the same design.
Is a hash a good way to store passwords?
Not a plain one. Passwords need a deliberately slow algorithm built for the job, such as bcrypt, scrypt or Argon2, with a different salt for every user. An ordinary SHA-256 of a password is so quick to compute that a leaked database is easy to crack.
Why is MD5 not taken from Web Crypto like the others?
The Web Crypto standard leaves MD5 out on purpose and offers only SHA-1 and the SHA-2 family, so browsers will not calculate it. This page carries its own implementation of RFC 1321, which also runs entirely in your browser.
Does my text leave my computer?
No. Both Web Crypto and the MD5 code run inside your browser, so neither the text you type nor the hashes it produces are sent anywhere or stored.