Password Salt Generator
Generate cryptographically secure random salts for password hashing. Choose length, output format, and quantity — pure client-side using window.crypto.getRandomValues.
Use the Password Salt Generator
Salt Options
Entropy: 256 bits
Generated Salts
Click "Generate New Salt" to start
How to use this salt
Copy the hex value and pass it to your hashing function. Example with bcrypt (Node.js):
const salt = await bcrypt.genSalt(12); // Or with a manual salt prefix (legacy): const hash = await bcrypt.hash(password, salt);
Note: bcrypt generates its own salt internally. Use these salts for PBKDF2, Argon2, or custom HMAC constructions.
Summary
A password salt is a random value added to a password before hashing to ensure that identical passwords produce different hash outputs. This tool generates cryptographically secure salts using the Web Cryptography API (window.crypto.getRandomValues), which is backed by the OS entropy pool. Choose your salt length in bytes (8, 16, 32, or 64), output format (hex, base64, base64url, or decimal byte array), and generate up to 10 salts at once. Each salt's entropy in bits is displayed alongside the output.
How it works
- Pick a salt length in bytes (8, 16, 32, or 64) and how many salts to generate.
- Choose an output format: hex, base64, base64url, or a decimal byte array.
- window.crypto.getRandomValues fills a Uint8Array with random bytes from the OS entropy pool.
- Bytes are encoded to your format and entropy (bytes × 8 bits) is shown. Copy and store the salt with the hash.
Use cases
- Generating salts for bcrypt, Argon2, or PBKDF2 before storing a new user password.
- Creating unique per-row salts for a legacy MD5/SHA-1 password column migration.
- Producing random nonce values for HMAC-based token generation.
- Supplying test vectors of known entropy for security unit tests.
- Teaching developers why salts prevent rainbow table attacks.