Compute Cryptographic Hashes from Any Text
A cryptographic hash function takes an input of any length and produces a fixed-size fingerprint that is practically impossible to reverse or forge. Hashes are fundamental to software integrity checks, password storage, digital signatures, version control, and data deduplication. This tool computes hashes using five widely supported algorithms — MD5, SHA-1, SHA-256, SHA-384, and SHA-512 — directly in your browser through the Web Crypto API and a client-side MD5 implementation.
Understanding the Algorithms
MD5 produces a 128-bit (32-hex-character) hash and is fast but cryptographically broken — practical collision attacks exist, so it should not be used where an adversary could craft inputs. SHA-1 outputs 160 bits (40 hex characters) and is similarly deprecated for security but still appears in legacy systems. SHA-256 and SHA-512 belong to the SHA-2 family: 256-bit and 512-bit outputs respectively, no known practical attacks, and the standard choice for modern security applications. SHA-384 is a truncated variant of SHA-512 used in specific protocols like TLS cipher suites.
Verifying File and Data Integrity
When you download software, the publisher often provides a SHA-256 hash of the file. Hashing the downloaded file and comparing the result confirms that nothing was corrupted or tampered with during transfer. The same principle applies to database exports, configuration snapshots, and API payloads — hash the content before and after transit, and a match proves integrity. Even MD5 is adequate here because the threat is accidental corruption, not a deliberate collision attack.
Hashing in Development Workflows
Developers hash strings routinely: generating cache keys, creating deterministic identifiers from compound fields, computing content-addressable storage paths, and building ETags for HTTP responses. Git itself identifies every commit, tree, and blob by its SHA-1 hash. When debugging these systems, a quick hash of a known input against an expected output confirms that your implementation matches the reference.
Output Formats: Hex and Base64
The raw hash is a sequence of bytes. Hex encoding represents each byte as two hexadecimal characters, producing the familiar long string of letters and digits — lowercase is the convention in most tools and protocols. Base64 encodes the same bytes in a shorter string using a 64-character alphabet, which is useful in JSON payloads, HTTP headers, and compact storage. The underlying hash is identical; only the representation differs.
The Avalanche Effect
A defining property of a good hash function is that a tiny change in the input — even a single character or a case change — produces a drastically different output. This avalanche effect means you cannot infer what changed in the input by comparing two hashes, which is essential for security. Try hashing the same text with and without a trailing space to see it in action.
Privacy and Browser-Side Computation
SHA-family hashes are computed using the Web Crypto API built into every modern browser, and MD5 uses a pure JavaScript implementation. No text or hash values are transmitted to any server. This makes the tool safe for hashing sensitive content like passwords (for comparison, not storage), API tokens, and private data where uploading to a third-party service would be a risk.