Hash generator
Compute MD5, SHA-1, SHA-256 and SHA-512 hashes in the browser.
Have feedback or an idea for this tool?
What is a hash function?
A hash function turns any input into a fixed-length string of hexadecimal characters, the digest, in a way that is quick to compute but practically impossible to reverse. The same input always yields the same digest, so hashes are used to verify that a file or message has not changed and to compare values without storing the original. This tool computes MD5, SHA-1, SHA-256 and SHA-512 digests of the text you enter, in your browser. Choose an algorithm and read the result. MD5 and SHA-1 are fine for checksums but are broken for security, so use SHA-256 or stronger when integrity matters, and never store passwords as a plain fast hash. Use the tool to verify a download against a published checksum, to compare two files, or to generate a digest for a cache key or fingerprint.
Key facts
- A cryptographic hash function turns any input into a fixed-length digest, is deterministic and one-way, and cannot be reversed to recover the original input.
- SHA-256 always produces a 256-bit (64 hex character) digest, while SHA-512 produces a 512-bit (128 hex character) digest; both belong to the secure SHA-2 family.
- MD5 (128-bit) and SHA-1 (160-bit) are cryptographically broken with practical collisions, so they must not be used for signatures, certificates or any security decision.
- Hashing differs from encryption because it is one-way and keyless with no decrypt operation, whereas encryption is reversible with the correct key.
- Raw general-purpose hashes are unsuitable for storing passwords because GPUs guess billions per second; use a slow, salted, memory-hard function such as Argon2id, scrypt or bcrypt instead.
What a cryptographic hash actually is
A cryptographic hash function takes any input - a word, a paragraph, or a multi-gigabyte file - and produces a fixed-length string of bytes called a digest. SHA-256 always returns 256 bits (64 hex characters), whether you feed it one letter or an entire ISO image.
Three properties define a good hash function. It is deterministic: the same input always yields the same digest, which is what makes hashes useful for verification. It is one-way (pre-image resistant): given a digest, there is no practical way to recover the original input. And it should be collision resistant: it must be infeasible to find two different inputs that produce the same digest.
It also exhibits the avalanche effect. Change a single bit of the input - flip one character, add a trailing space - and roughly half the output bits flip, producing a completely different-looking digest. This is why a hash is a reliable fingerprint: any tampering, however small, is immediately visible as a different value. This tool computes the digest for text you type, entirely in your browser.
Hashing is not encryption
These two are constantly confused, and the difference matters. Encryption is reversible by design: you encrypt plaintext with a key, and anyone with the correct key can decrypt it back to the original. It protects confidentiality of data you need to read again later.
Hashing is one-way and keyless: there is no decrypt operation, and no key that turns a digest back into its input. You cannot decrypt a hash - if a tool claims to decrypt MD5 or SHA-256, it is really doing a reverse lookup against a precomputed table of common inputs, not reversing the maths.
Use encryption (AES-256-GCM, for example) when you must recover the plaintext, such as storing an API secret you will call later. Use hashing when you only ever need to check whether something matches or has changed - verifying a download, deduplicating data, or checking a password against a stored value without keeping the password itself.
MD5, SHA-1, SHA-256 and SHA-512 - which to use
MD5 produces a 128-bit digest and is cryptographically broken. Practical collision attacks have existed since 2004, so MD5 must never be used for signatures, certificates, or any security decision. It survives only as a fast, non-security checksum for detecting accidental corruption or deduplicating files, where an attacker is not in the picture.
SHA-1 (160-bit) is also deprecated. The 2017 SHATTERED attack produced a real-world collision, and browsers and certificate authorities dropped it years ago. Do not use it for anything new. The current safe default is the SHA-2 family: SHA-256 for general integrity and signing, and SHA-384 or SHA-512 when you want a larger margin (SHA-512 is often faster on 64-bit CPUs). SHA-3 exists as a structurally different backup, but SHA-256 remains the workhorse for most integrity and signing needs today.
Never store passwords with a raw hash
This is the single most important rule. A plain SHA-256 (or MD5, or SHA-512) of a password is not safe storage, even though it is one-way. General-purpose hashes are designed to be fast, so a modern GPU can compute billions of SHA-256 guesses per second, tearing through leaked hashes with dictionaries and rainbow tables. Hashing without a per-user salt also means identical passwords produce identical digests, exposing reuse.
For passwords, use a purpose-built password hashing function: Argon2id (the current recommendation), scrypt, or bcrypt. These are deliberately slow and memory-hard, they generate and store a unique random salt per password, and their cost factor is tunable so you can keep them expensive as hardware improves. This browser tool intentionally implements only general-purpose hashes for checksums and integrity - do not paste user passwords into any hasher and store the output. Reach for Argon2id, scrypt, or bcrypt in your application code instead.
Glossary
- Digest
- The fixed-length output a hash function produces from any input, serving as a fingerprint of that data. SHA-256 always returns 256 bits (64 hex characters) and SHA-512 returns 512 bits (128 hex characters), whatever the input size.
- One-way (pre-image resistance)
- The property that a digest cannot be reversed to recover the original input, since hashing is keyless with no decrypt operation. Tools claiming to decrypt a hash are doing a reverse lookup against precomputed tables of common inputs, not reversing the maths.
- Salt
- A unique random value added to each input before hashing so that two identical passwords produce different stored digests. It defeats precomputed rainbow tables because an attacker cannot prepare tables in advance for unseen salts; proper password hashers generate and store it automatically.
- Collision resistance
- The property that it is infeasible to find two different inputs producing the same digest. Collisions have been produced in practice for MD5 and SHA-1, which is why those functions are no longer trusted for signatures, certificates or any security decision.
- bcrypt
- A purpose-built password-hashing function that is deliberately slow, generates a per-password salt, and has a tunable cost factor to stay expensive as hardware improves. It and its alternatives Argon2id and scrypt should be used for passwords instead of a fast general-purpose hash like SHA-256.
- Avalanche effect
- The behaviour where changing a single bit of the input flips roughly half the output bits, producing a completely different digest. This is what makes a hash a reliable integrity fingerprint, since any tampering shows up as a different value.
Questions, answered.
Can I decrypt or reverse an MD5 or SHA-256 hash?+
No. Hashing is one-way, so there is no decrypt operation and no key that turns a digest back into its input. Sites that claim to decrypt a hash are doing a reverse lookup against a stored table of common inputs and their known hashes - they only work for weak or previously seen values, never by reversing the maths.
Is MD5 safe to use?+
Only for non-security checksums, such as detecting accidental file corruption or deduplicating data. MD5 is cryptographically broken - practical collisions have existed since 2004 - so never use it for passwords, digital signatures, certificates, or any decision an attacker could influence. Use SHA-256 there instead.
How do I generate a SHA-256 checksum of a file?+
This tool hashes text, so for a file use your operating system. On Linux run sha256sum filename, on macOS run shasum -a 256 filename, and on Windows run Get-FileHash filename in PowerShell (SHA-256 is its default). Then compare the output against the vendor's published SHA-256 value.
Should I store user passwords as SHA-256 hashes?+
No. Fast general-purpose hashes like SHA-256 can be brute-forced at billions of guesses per second on a GPU, and without a per-user salt identical passwords give identical hashes. Use a slow, salted, memory-hard password hash instead: Argon2id is the current recommendation, with scrypt or bcrypt as accepted alternatives.
What is a salt and why does it matter?+
A salt is a unique random value added to each input before hashing. It ensures two users with the same password get different stored hashes, and it defeats precomputed rainbow tables because an attacker cannot prepare tables in advance for salts they have not seen. Proper password hashers like Argon2id and bcrypt generate and store the salt for you automatically.
What is the difference between SHA-256 and SHA-512?+
Both are members of the SHA-2 family and both are secure. SHA-256 produces a 256-bit (64 hex character) digest and is the common default; SHA-512 produces a 512-bit (128 hex character) digest for a larger security margin, and it is often faster on 64-bit processors. For most integrity and signing work SHA-256 is plenty.
Do two different inputs ever produce the same hash?+
A collision - two inputs sharing one digest - is mathematically possible for any hash because inputs are unlimited and outputs are fixed length. For a strong function like SHA-256 finding one is computationally infeasible. For MD5 and SHA-1 collisions have been produced in practice, which is exactly why those two are no longer trusted for security.
Is my input sent to a ServerCake server?+
No. All hashing runs in your browser using the Web Crypto API, so the text you enter never leaves your device and nothing is uploaded or logged. You can confirm this by disconnecting from the network - the tool keeps working offline.
Cloud that speaks India.
These tools run on ServerCake infrastructure in India. When our cloud opens, you get VMs and managed databases priced in ₹, billed with GST, on India-resident infrastructure. Reserve your spot for early access.
Reserve your spot