About this tool
Creates high-entropy secrets for signing JWTs, encrypting sessions, webhooks and app configuration. Pick a key size and copy the value in the encoding your framework wants, or grab a complete .env line with your variable name. The key is generated with WebCrypto randomness in this tab only.
How to use Secret Key Generator
- Select the key size (256-bit fits most uses).
- Type the environment variable name your app reads.
- Copy the key or the full .env line into your configuration.
Frequently asked questions
What size key do I need for HS256 JWTs?
At least 256 bits, which matches the SHA-256 output size used by HS256.
Can I reuse one secret across apps?
Better not. Give each app and environment its own secret so one leak does not expose the others.
Where should I keep the secret?
In a secrets manager or environment variable, never in source control or front-end code.