FormatterHQ

PBKDF2 Hash Generator

Derive PBKDF2 keys and password hashes with a chosen HMAC function, salt and iteration count. Output comes as hex, Base64 and a Django-style encoded string.

Input TEXT
Output TEXT
Ready.

How to use the PBKDF2 Hash Generator

  1. Enter the password to derive a key from.
  2. Pick the PRF (HMAC-SHA256 by default) and set Iterations and Key length (bytes).
  3. Leave Salt blank for a random 16-byte salt, or enter your own and set Salt is to Text, Hex or Base64.
  4. Click Derive key and copy the hex, Base64 or Django-style output. The Django-style line verifies in Django only when the salt was entered as text.

PBKDF2 hash generator using WebCrypto

This PBKDF2 hash generator derives a key from a password with PBKDF2 (Password-Based Key Derivation Function 2, defined in RFC 8018). It uses your browser's native WebCrypto implementation, so even 600,000 iterations finish quickly, and it shows how long the derivation took.

What is PBKDF2?

PBKDF2 repeatedly applies an HMAC to the password and salt. Each iteration adds a fixed amount of CPU work, which slows down anyone trying to guess passwords from a stolen hash. It is widely supported (WebCrypto, OpenSSL, Java, .NET, Python's hashlib) and FIPS-approved, which is why regulated environments often require it. Its weakness is that it uses almost no memory, so GPUs can run it in parallel far more cheaply than memory-hard functions.

Example

Password correct horse battery staple, HMAC-SHA256, 600,000 iterations, text salt NaCl, 32-byte key:

Hex:     26ef4d96a6feff19774d092561962aa66640d5fb0bc89a3515b6c25f6e04e9dd
Base64:  Ju9Nlqb+/xl3TQklYZYqpmZA1fsLyJo1FbbCX24E6d0=
Salt:    4e61436c (hex)

# Django-style encoded hash
pbkdf2_sha256$600000$NaCl$Ju9Nlqb+/xl3TQklYZYqpmZA1fsLyJo1FbbCX24E6d0=

The last line follows Django's algorithm$iterations$salt$hash layout. Django's default hasher is pbkdf2_sha256 with a text salt and a 32-byte key, so use those settings when you want to compare against a Django database row. With a blank (random), hex or Base64 salt, the salt field of that line holds the Base64 form of the salt bytes; Django would treat that string as a text salt and derive a different key, so such a line does not verify in Django.

Options explained

  • PRF – the HMAC hash. HMAC-SHA256 is the common default; HMAC-SHA512 gives more work per iteration; HMAC-SHA1 is only for legacy compatibility (WPA2 and older systems).
  • Iterations – default 600,000, the current OWASP guidance for PBKDF2-HMAC-SHA256. OWASP suggests 210,000 for SHA-512. The browser limit is 10,000,000.
  • Key length – bytes of output. Asking for more than the hash size (32 bytes for SHA-256) makes PBKDF2 run the whole iteration count again for each extra block.
  • Salt is – tells the tool how to read your salt: as UTF-8 text, hex or Base64.

Common errors

  • "Salt is not valid hex" – hex salts need an even number of characters from 0-9 and a-f. Switch Salt is to Text if you meant a plain string.
  • Slow derivation – very high iteration counts combined with a long key length multiply the work. Reduce the key length to the hash size unless you really need more bytes.
  • Salt reuse – every stored password needs its own random salt. A fixed salt is only for reproducing test vectors.

Related tools

For new password storage without FIPS constraints, a memory-hard function such as the Argon2 hash generator is stronger. For a single HMAC without iterations, use the HMAC generator.

Privacy

All derivation happens locally through WebCrypto, and random salts come from crypto.getRandomValues. Nothing is uploaded.

Frequently asked questions

How many PBKDF2 iterations should I use?
OWASP currently recommends 600,000 iterations for PBKDF2-HMAC-SHA256, 210,000 for HMAC-SHA512 and 1,300,000 for HMAC-SHA1. Pick the highest count your login endpoint can afford under peak load.
Why does my result not match Python or Java?
Every input must be identical: password bytes, salt bytes, PRF, iteration count and key length. The most common mistake is treating a hex salt as text or vice versa, so check the Salt is setting.
Can I check a Django password hash with this tool?
Yes. Split the stored value at the $ signs, enter the salt as text, set the iterations from the second field, choose HMAC-SHA256 and a 32-byte key. If the Base64 output equals the last field, the password matches.
Is PBKDF2 still secure?
With a high iteration count and a unique salt it remains acceptable and is required by FIPS 140 validated systems. It offers less resistance to GPU cracking than Argon2id or scrypt, so prefer those when you have a free choice.

Last updated October 3, 2026

Related tools

RIPEMD-160 Hash Generator Generate the RIPEMD-160 hash of any text or file online. Instant 160-bit digest in hex, computed in your browser. RSA Key Pair Generator Generate RSA 2048, 3072 or 4096-bit public/private key pairs in PEM (PKCS#8, PKCS#1) or JWK format with WebCrypto, entirely offline. Scrypt Hash Generator Derive scrypt password hashes and keys with custom N, r, p and salt; output as hex, Base64 and common encoded formats. Self-Signed Certificate Generator Create a self-signed SSL/TLS certificate and RSA key for localhost, dev servers or internal tools. Generated locally with WebCrypto. SHA-1 Hash Generator Generate the SHA-1 hash of any text or file online. Instant 160-bit digest in hex, computed in your browser. SHA-2 Hash Generator Generate SHA-224, SHA-256, SHA-384, SHA-512, SHA-512/224 or SHA-512/256 hashes from text or files. SHA-224 Hash Generator Generate the SHA-224 hash of any text or file online. Instant 224-bit digest in hex, computed in your browser. SHA-256 Hash Generator Generate the SHA-256 hash of any text or file online. Instant 256-bit digest in hex, computed in your browser. SHA3-224 Hash Generator Generate the SHA3-224 hash of any text or file online. Instant 224-bit digest in hex, computed in your browser. SHA3-256 Hash Generator Generate the SHA3-256 hash of any text or file online. Instant 256-bit digest in hex, computed in your browser. SHA3-384 Hash Generator Generate the SHA3-384 hash of any text or file online. Instant 384-bit digest in hex, computed in your browser. SHA3-512 Hash Generator Generate the SHA3-512 hash of any text or file online. Instant 512-bit digest in hex, computed in your browser.