What is a hash?
A cryptographic hash function turns any text into a fixed-size fingerprint called a digest. SHA-256 always returns 256 bits (64 hexadecimal characters), whether you feed it one letter or a whole book. The same input always gives the same digest, a one-character change gives a completely different one, and there is no way to go back from the digest to the text. Those three properties make hashes useful to check that a download was not corrupted, to compare data without storing it, to build cache keys and ETags, to sign API requests and, with the right algorithm, to store passwords.
Not every hash is fit for every job. MD5 and SHA-1 are broken for security (collisions can be produced on purpose) but still common as checksums. SHA-256, SHA-512 and SHA-3 are the current standards. CRC32, Adler-32 and xxHash are fast checksums for detecting accidental errors, never for security. And passwords need slow functions such as Argon2 or PBKDF2, which make each guess expensive for an attacker.
This hash generator computes them all at once: MD5, SHA-1, SHA-224, SHA-256, SHA-384, SHA-512, SHA3-512, RIPEMD-160, BLAKE2b, BLAKE2s, BLAKE3, Keccak-256, SM3 and Whirlpool, plus seven checksums. A second card derives password hashes with Argon2id, Argon2i, Argon2d or PBKDF2, and a third checks a password against an existing Argon2 hash. Everything runs in your browser, in a background worker: the text you type is never sent anywhere, which matters when you hash secrets.
How to generate a hash online
- Type or paste your text in Text to hash. The page opens with
Hello, toolboxas an example; replace it. - Read the digests in the Cryptographic hashes list (MD5, SHA1, SHA256…) and, below, in Checksums and fast hashes. They update as you type.
- Choose the Digest encoding: hexadecimal is the usual form; binary, Base64 and Base64url are there for headers, JWTs and APIs that expect them.
- Click the copy button at the end of any row to copy that digest.
- To hash a password for storage, go to Password hashing: Argon2 and PBKDF2, pick the algorithm, type the password, press Random salt and keep the suggested cost settings (Argon2id with 19 456 KiB of memory and 2 iterations, or PBKDF2-HMAC-SHA256 with 600 000 iterations). Copy the Encoded hash to store in your database.
- To test a login, paste the password and the stored hash in Check a password against an Argon2 hash and read the Yes/No answer.
Examples
The three digests people look up most
Input hello, hexadecimal encoding:
MD5 5d41402abc4b2a76b9719d911017c592
SHA1 aaf4c61ddcc5e8a2dabede0f3b482cd9aea9434d
SHA256 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824One capital letter changes everything
Input Hello with a capital H:
SHA256 185f8db32271fe25f561a6fc938b2e264306ec304eda518007d1764826381969Nothing in common with the digest of hello. That is the avalanche effect.
The hidden line break
If you press Enter after hello, the input is hello plus a newline, and SHA-256 becomes:
5891b5b522d5df086d0ff0b110fbd9d21bb4fc7163af34d08286a2e846f6be03This is also what echo hello | sha256sum prints, because echo adds a newline. printf 'hello' | sha256sum matches the first example.
The hash of an empty string
Clear the box and the SHA256 row shows a famous value; if you see it in your logs, the code hashed nothing:
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855Same digest, other encodings
SHA-256 of hello with Digest encoding set to Base64, then Base64url:
LPJNul+wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQ=
LPJNul-wow4m6DsqxbninhsWHlwfp0JecwQzYpOLmCQCommon errors and how to fix them
- My hash differs from the one in my terminal or code: almost always invisible characters. Check for a trailing newline (the
echocase above), spaces, Windows line endings (\r\n) or a different text encoding. The tool hashes the UTF-8 bytes of exactly what is in the box. - The digests match in hex but not in my API: the API probably expects Base64 or Base64url. Change Digest encoding instead of converting by hand.
- "SHA3" does not match my library: the SHA3 row is NIST SHA3-512. Ethereum and some older libraries use the original Keccak, shown in the KECCAK row (Keccak-256), which gives different digests.
- "The salt needs at least 8 bytes. Type more characters or press Random salt.": Argon2 and PBKDF2 refuse short salts. Press Random salt.
- "Argon2 needs a password to hash. Type one in the password field.": the password field is empty.
- I want to decrypt a hash: impossible by design. Services that "decrypt" MD5 only look the digest up in tables of common passwords.
Frequently asked questions
Can a SHA-256 hash be reversed?
No. A hash discards information, so there is no reverse operation. The only attack is to guess inputs and compare, which works against short or common passwords; that is why passwords need a slow algorithm and a unique salt.
Is MD5 still safe to use?
Not for security: since 2004 anyone can build two different inputs with the same MD5. It is still acceptable as a checksum against accidental corruption or as a cache key. For anything an attacker could tamper with, use SHA-256. There is a dedicated MD5 hash page and a SHA-256 hash page.
Which algorithm should I use to store passwords?
Argon2id, the default in the password card, or bcrypt, available in the bcrypt tool. Never store a plain SHA-256 of a password: modern GPUs test billions of SHA-256 guesses per second.
What is the difference between a hash and an HMAC?
A hash uses only the message, so anyone can recompute it. An HMAC mixes in a secret key, so only who knows the key can produce or verify it; that is how webhooks and API requests are signed. Use the HMAC generator for that.
Is my text sent to a server?
No. The digests are computed by a Web Worker inside your browser; nothing you type leaves your device.
Can I hash a file here?
This tool hashes text. To check a file, use sha256sum or shasum -a 256 in a terminal, as in the Bash example below.
How to generate a hash in code
JavaScript
Node.js has crypto.createHash; in the browser, use Web Crypto, which supports SHA-1 and SHA-2 but not MD5.
import { createHash } from 'node:crypto';
console.log(createHash('sha256').update('hello', 'utf8').digest('hex'));
// 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
// Browser
async function sha256(text) {
const digest = await crypto.subtle.digest('SHA-256', new TextEncoder().encode(text));
return [...new Uint8Array(digest)].map(b => b.toString(16).padStart(2, '0')).join('');
}Python
hashlib works on bytes, so encode the text first.
import hashlib
print(hashlib.sha256("hello".encode("utf-8")).hexdigest())
print(hashlib.md5("hello".encode("utf-8")).hexdigest())Go
package main
import (
"crypto/md5"
"crypto/sha256"
"fmt"
)
func main() {
fmt.Printf("%x\n", sha256.Sum256([]byte("hello")))
fmt.Printf("%x\n", md5.Sum([]byte("hello")))
}Bash
Use printf '%s' rather than echo to avoid hashing a newline. On macOS, shasum -a 256 and md5 replace sha256sum and md5sum.
printf '%s' 'hello' | sha256sum
printf '%s' 'hello' | md5sum
sha256sum file.iso # checksum of a file