Online Hash Generator (SHA-1, SHA-256, SHA-384, SHA-512)

Type or paste text to get four digests at once: SHA-1, SHA-256, SHA-384 and SHA-512. Results update as you type and can be displayed as lowercase hex, uppercase hex or Base64. All hashing runs in your browser through the Web Crypto API; nothing is uploaded and nothing is stored.

Digests
Output format
Algorithms
SHA-1 —
SHA-256 —
SHA-384 —
SHA-512 —

About this tool

A hash function turns any text into a fixed-length digest: SHA-1 produces 160 bits (40 hex characters), SHA-256 produces 256 bits (64 characters), SHA-384 produces 384 bits (96 characters) and SHA-512 produces 512 bits (128 characters). The same input always yields the same digest, while a single changed character — even a trailing space — yields a completely different one. Together with the fact that the original text cannot be reconstructed from the digest, these properties make hashes useful for integrity checks, fingerprints and content identifiers.

A hash is a one-way digest, not encryption. Encryption is reversible with the right key; hashing uses no key and has no inverse, so a digest cannot be decrypted back into text. The only practical attack is guessing — hash a candidate and compare. This is why unsalted password hashes fall to dictionary and rainbow-table attacks, and why passwords should be stored with a dedicated password hash such as Argon2, bcrypt or scrypt rather than a plain SHA-2 digest.

SHA-1 and SHA-2 differ mainly in digest length and internal design. SHA-1 is deprecated for security purposes because practical collision attacks exist, while SHA-256, SHA-384 and SHA-512 remain sound for integrity checks and digital signatures. MD5 is deliberately not offered: it is broken and the Web Crypto API does not implement it, so supporting it would mean shipping a hand-written implementation. This page computes everything locally with crypto.subtle.

MD5 still appears in places where nobody is defending against an attacker: cache keys, duplicate detection, ETag-like fingerprints and old build scripts. It produces 128 bits, written as 32 hex characters, and for spotting accidental corruption it works about as well as anything. The problem is that MD5 collisions are cheap to construct, including chosen-prefix collisions that let two files with different content share a digest while both look harmless, so it cannot prove that a download is the file the publisher intended. A legacy service that demands MD5 leaves no choice, but a new design should treat the digest as an identifier rather than as evidence, and use SHA-256 or SHA-512 wherever the value is meant to detect tampering.

Verification is mostly a formatting problem. A published checksum usually comes as a line containing the digest, two spaces or an asterisk, and a filename; tools such as sha256sum, shasum -a 256 and Get-FileHash all read that layout, and the asterisk marks binary mode, which matters on systems that translate line endings. Before comparing, strip leading and trailing whitespace, decide whether the digest is hex or Base64, and match the letter case; a mismatch in presentation is far more common than a real mismatch in bytes. Compare the whole digest, not a prefix, and when the comparison happens in code that guards a secret, use a constant-time comparison so that timing does not leak how many characters matched.

A plain hash is the wrong tool for two jobs that look similar. For message authentication, where both integrity and proof of a shared secret are needed, use HMAC with a key rather than a bare digest; a hash alone can be recomputed by anyone. For passwords, use a slow, salted function such as Argon2, bcrypt or scrypt, since a fast digest is exactly what an attacker wants. A subtler point is that SHA-256 and SHA-512 follow the Merkle-Damgard construction and are vulnerable to length-extension attacks when used naively as a MAC, which is another reason HMAC exists. Content addressing systems make their own choices: Git hashes objects with SHA-1 over a header plus content, and is migrating to SHA-256, while UUID version 5 uses SHA-1 over a namespace and a name.

How to use

  1. Enter the text: type or paste it into the box. Multi-line input, Chinese characters and symbols are all supported, and the hash covers the content exactly as it appears.
  2. Hash automatically: results appear about 250 ms after you stop typing; click Compute if you want to run it immediately.
  3. Read the four digests: SHA-1, SHA-256, SHA-384 and SHA-512 are listed one per row, and the header shows the character count and the real UTF-8 byte count of the input.
  4. Choose the output format: lowercase hex is the default, uppercase hex and Base64 are also available. Switching re-encodes the stored digests instantly, with no recalculation.
  5. Copy a result: each row has its own Copy button; clearing the input resets and hides the result area.
  6. Before comparing two digests, normalise them: strip spaces, unify the letter case, confirm whether the value is hex or Base64, and check that both cover the same bytes rather than the same visible text.
  7. Switch tools when the input is not text: use a command-line or system utility for files and disk images, a password-hashing library for credentials, and HMAC or a signature library when a key is involved.

FAQ

Can a hash be reversed or decrypted?

No. Hashing is a one-way, lossy operation: many different inputs can map to the same digest, and no key or algorithm can recover the original text. The only feasible approach is guessing — hash a candidate and compare it with the digest. For short or predictable input such as a common word or a numeric ID, that guess can succeed, which is why hashes of secrets need salt and a slow password-hashing function.

Why is MD5 not available?

Two reasons. MD5 is cryptographically broken — collisions can be produced in seconds, so a digest no longer proves that content is unchanged — and the Web Crypto API does not implement it. Supporting it would mean bundling a pure-JavaScript implementation, which is slower and adds risk for a value that should not be used for security anyway. Use SHA-256 when you need a modern digest.

Is SHA-1 still safe to use?

For security-sensitive purposes, no: practical collision attacks exist, so SHA-1 must not be used for signatures, certificates or password storage. For non-security checksums, such as detecting accidental corruption or matching identifiers in a trusted system, it still works and remains widely supported in legacy formats. New designs should use SHA-256 or stronger.

Can I hash a file or a large amount of data?

Not with this tool: it hashes text entered into the box, not files. Binary files cannot be pasted reliably, and very large content would exhaust browser memory. To hash a file, use a command-line utility such as sha256sum or a dedicated file-hash tool; identical bytes always produce the identical digest, whichever tool computes it.

Is my text uploaded to a server?

No. The page calls crypto.subtle.digest inside your browser, so the text never leaves the device and nothing is written to storage. As with any browser tool, extensions and clipboard managers can still read what you paste, so avoid pasting production secrets into a page you do not trust.

Can I still use MD5 to check a download?

Only as a rough guard against accidental corruption, and only when the publisher provides nothing better. An attacker who can replace the file can also replace the MD5 value, and collisions can be manufactured deliberately. If the source publishes SHA-256, use that; if a legacy system only exposes MD5, treat the result as a weak identifier rather than proof of authenticity.

Why does the same text produce a different hash in another tool?

The bytes differ even when the visible characters look the same. Trailing newlines, Windows versus Unix line endings, a byte-order mark, full-width spaces, Unicode normalisation and the chosen output encoding all change the input or the presentation. Count the bytes in both tools and compare the hex form before concluding that either tool is wrong.

Can two different files share the same SHA-256 digest?

In theory yes, because any fixed-length digest maps infinitely many inputs onto finitely many outputs. In practice no known collision exists for SHA-256, and finding one by brute force is far beyond current computing power. MD5 and SHA-1 are different: collisions have been demonstrated, so their digests cannot establish uniqueness.