How to Use the Hash Generator
- Type or paste your text, or switch to File and choose one.
- All five hashes appear straight away and update as you type.
- Pick hex or Base64 output, and tick HMAC if you need a keyed hash.
- Click Copy beside the one you need, or paste an expected hash into the compare box to check it.
What Is a Hash?
A hash is a fixed-length fingerprint of some data. The same input always produces the same hash, a tiny change produces a completely different one, and there is no practical way to go backwards from the hash to the input. That makes hashes useful for checking that data has not changed. It is a one-way function, not encryption, so there is nothing to decrypt.
MD5, SHA-1, SHA-256, SHA-384 and SHA-512
| Algorithm | Output size | Hex length | Use it for |
|---|---|---|---|
| MD5 | 128 bits | 32 | Quick checksums only. Collisions can be forged, so avoid it for security. |
| SHA-1 | 160 bits | 40 | Legacy systems such as old Git object IDs. Practical collisions have been shown, so avoid it for security. |
| SHA-256 | 256 bits | 64 | The usual default for file checks, signatures and APIs. |
| SHA-384 | 384 bits | 96 | Higher security margin, common in TLS and certificates. |
| SHA-512 | 512 bits | 128 | Often faster than SHA-256 on 64-bit CPUs, and used in HMAC and key derivation. |
Verify a Downloaded File
Software sites often publish a SHA-256 value next to the download. Hash your copy and compare it with that value. You can do it here by choosing the file, or from a terminal:
# Windows (Command Prompt) certutil -hashfile setup.exe SHA256 # Windows (PowerShell) Get-FileHash setup.exe -Algorithm SHA256 # macOS shasum -a 256 setup.dmg # Linux sha256sum setup.iso
If the values differ, do not run the file. Download it again from the official site first.
Should You Hash Passwords With These?
No. MD5 and the SHA family are built to be fast, and speed is exactly what an attacker wants when guessing passwords. A modern graphics card can test billions of them per second, which is why leaked databases of plain SHA-256 passwords are cracked so quickly. Websites should store passwords with a slow, salted algorithm such as Argon2id, scrypt, bcrypt or PBKDF2. See the NIST password guidelines for current advice, and how long a password takes to crack to see what attackers can do. For your own accounts, the best protection is a long random password from the Strong Password Generator.
What Is HMAC?
HMAC (hash-based message authentication code) combines a hash with a secret key. Only someone who knows the key can create or check the result, so it proves a message came from a trusted sender and was not modified. Payment providers and webhook services use it to sign requests. Enter your key in the HMAC field and the five results above become keyed hashes. To make a random key, use the Developer Credential Generator.
Hash Text in Code
# Python
import hashlib
hashlib.sha256("hello".encode()).hexdigest()
// Node.js
require("crypto").createHash("sha256").update("hello").digest("hex");
// PHP
hash("sha256", "hello");
# Bash (use -n so no newline is added)
echo -n "hello" | sha256sum
Test Values
Use these to check that any tool, including this one, is working correctly.
| Input | Algorithm | Hash |
|---|---|---|
| (empty string) | MD5 | d41d8cd98f00b204e9800998ecf8427e |
| (empty string) | SHA-256 | e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 |
| abc | MD5 | 900150983cd24fb0d6963f7d28e17f72 |
| abc | SHA-1 | a9993e364706816aba3e25717850c26c9cd0d89d |
| abc | SHA-256 | ba7816bf8f01cfea414140de5dae2223b00361a396177a9cb410ff61f20015ad |
Related tools: Base64 Encoder / Decoder and the UUID Generator.