Hash Calculator
Calculate SHA-256, SHA-384, SHA-512, SHA-1, or MD5 hashes of any text. SHA uses the Web Crypto API; MD5 runs in pure JavaScript.
How It Works
The Hash Calculator computes cryptographic digests — MD5, SHA-1, SHA-256, SHA-384, and SHA-512 — of any text, entirely in your browser. SHA-2 family hashes (256, 384, 512) and SHA-1 are produced via the browser’s Web Crypto API (crypto.subtle.digest), which executes in compiled native code and supports arbitrarily large inputs. MD5 has no Web Crypto support (browsers refuse to ship it), so it runs through a small pure-JavaScript implementation included in the page. The tool encodes the input as UTF-8 bytes, hashes them, and returns the digest as a lowercase hexadecimal string — the canonical format used by command-line tools, Git, and most checksum file conventions. Output updates as you type. SHA-256 and longer SHA-2 hashes are appropriate for content addressing, integrity verification, and password hashing inputs (alongside a proper KDF such as PBKDF2 or Argon2). MD5 and SHA-1 are kept available because they are still required by many legacy systems for non-security uses such as cache keys or file fingerprints, but they are cryptographically broken: do not use them where collision resistance matters.
Use Cases
- Verifying file integrity checksums after a download
- Generating a stable unique key for a cache entry
- Comparing two strings to detect silent differences
- Learning and teaching how different hash lengths compare
Frequently Asked Questions
- Should I use MD5 for passwords or signatures?
- Absolutely not. MD5 is broken — practical collision attacks have existed for over a decade. SHA-1 is also broken for collision-resistance use. Use SHA-256 or SHA-512 with a proper key-derivation function for passwords.
- Why is my SHA-256 output different from openssl?
- Most often the input has a trailing newline (echo adds one) or a different encoding. This tool hashes the exact bytes you paste, encoded as UTF-8, with no trailing newline added.
- Are my inputs sent to a server?
- No. Hashing runs entirely in your browser via Web Crypto for SHA family, and a local JS implementation for MD5.
- Why is the output hex and not Base64?
- Hex is the canonical format used by Git, sha256sum, and most checksum files. You can paste hex into the Base64 encoder to convert if needed.
- Can I hash a file?
- This tool accepts text only. For files, use sha256sum or shasum -a 256 from a terminal — both produce identical output to this tool when given the same bytes.