About this generator
This preset creates a URL-safe high-entropy value for HMAC JWT signing. It is a developer secret, not a user password, and it never leaves this browser.
This preset starts with url-safe mode and generates 10 independent results at a time. Every visible setting remains adjustable, and generated values are not sent to PwdGen.
When to use it
- Creating a new credential for this specific use case
- Replacing a reused or weak password
- Generating values locally before secure storage
Alphabet size, entropy, and brute-force assumptions
The theoretical entropy ceiling is calculated as H = L × log2(A), where L is the generated length and A is the number of currently permitted characters.
| Length | Alphabet | Search space | Entropy ceiling | Average at 10 billion guesses/s |
|---|---|---|---|---|
| 64 | 64 | 6464 | 384.0 bits | 6.24e97 years |
Important: these are mathematical estimates for uniformly random values. Required positions, restricted counts, repeated passwords, dictionary patterns, leaked credentials, and real password-hashing costs can change the result substantially. The figure is not a security guarantee.
JWT signing-secret deployment guidance
For HS256, use at least 256 bits of uniformly random key material. HS384 and HS512 use different SHA-2 output sizes, but choosing a longer algorithm does not repair weak verification, leaked keys, or algorithm-confusion bugs.
Equivalent terminal and Node.js generation
openssl rand -hex 32 import { randomBytes } from 'node:crypto';
const jwtSecret = randomBytes(32).toString('hex'); Storage and rotation
- Keep signing keys out of Git, frontend bundles, URLs, analytics, and application logs.
- Use a secret manager, Vault, KMS, or protected environment variable.
- Use a controlled kid strategy when rotating keys.
- Choose RS256 or ES256 when verifiers should hold only a public key.
Hex, Base64, and Base64URL are encodings—not encryption. The security comes from the random bytes and how the signing key is protected.
How to use the result safely
- Check the destination’s current password rules
- Use a unique result and enable MFA where available
- Store recovery codes separately from the password
Generation and privacy method
The preset uses the browser Web Crypto API for random selection. Regenerating, changing settings, selecting, and copying results do not send generated credentials to PwdGen. The password crack-time estimator also runs locally and is an estimate, not a guarantee.
Jwt Secret Generator FAQ
How long should an HS256 JWT secret be?
Use at least 256 bits of uniformly random key material for HS256. This page generates a 64-character Base64URL-alphabet value, which provides a larger theoretical search space when generated uniformly.
Should a JWT secret be stored in an environment variable?
An environment variable is safer than source code but can still leak through process inspection, logs, or deployment tooling. A managed secret store or KMS is preferable for production systems.
When should I use RS256 or ES256 instead of HMAC?
Use asymmetric signing when verifiers should not possess the private signing key or when multiple services need public-key verification. Protect the private key and rotate keys with a controlled key identifier strategy.