All tools / Security & identifiers
Secret key and password generator
Generate a random secret key for JWT signing, API keys, app frameworks or a strong password, using your browser's cryptographically secure random source.
Runs entirely in your browser. Nothing you type or upload is sent to a server.
How to use Secret key and password generator
- Pick what you need: a password, a token, a JWT secret or a framework key.
- Set the length and which characters to use.
- Copy it, or press Regenerate for a new one.
Common questions
How long should a password be?
For accounts, 16 or more random characters is plenty when you use a password manager. For secrets that machines use, such as API keys or session signing keys, use at least 32 random bytes (256 bits).
How do I generate a JWT secret key?
For HS256, use at least 32 random bytes (256 bits), as the JWT standard requires a key at least as long as the hash. Click "JWT secret (HS256)" above. For HS384 and HS512, use 48 and 64 bytes. Keep it in an environment variable or a secrets manager, never in your code.
What should a Django, Flask or Rails secret key look like?
Django's SECRET_KEY is any long random string; Django itself makes 50 characters. Flask's SECRET_KEY is commonly 32 random bytes as hex. Rails' secret_key_base is 64 random bytes as 128 hex characters, the same as bin/rails secret. The presets above produce each of these.
How do I generate a secret key in the terminal?
Run openssl rand -hex 32 for a hex key or openssl rand -base64 32 for Base64. In Python, use python -c "import secrets; print(secrets.token_urlsafe(32))". The tool shows the matching command under every token.
What does entropy mean?
It measures how many guesses an attacker would need. Each extra bit doubles the work. Around 80 bits is out of reach for online and most offline attacks; 128 bits is out of reach for anyone.
Is this really random?
Yes. It uses crypto.getRandomValues, the browser's cryptographically secure generator, with rejection sampling so every character is equally likely.
Are the passwords stored or sent anywhere?
No. They are generated on your device and disappear when you close the tab.