About Token & Secret Generator
Create the random values your code needs: JWT and session secrets, encryption keys, webhook signing secrets, API keys with your own prefix, and UUIDs. Pick the format and strength in bits, generate up to 50 at once, and copy them as plain text, ready-made .env lines or JSON.
Values come from your browser’s cryptographically secure random generator (Web Crypto) and never leave your device. Alphanumeric keys use rejection sampling, so every character is equally likely.
Which format for which job
| Use | Format | Strength |
|---|---|---|
| JWT secret (HS256) | Base64 URL | 256-bit |
| Session or cookie secret | Hex | 256-bit |
| AES-256 encryption key | Base64 | 256-bit (32 bytes) |
| Webhook signing secret | Hex | 256-bit |
| Public API key | Alphanumeric with a prefix | 192-bit or more |
| Record or file ID | UUID v4 | 122-bit |
Handling secrets safely
- Keep secrets in environment variables or a secret manager, never in source code or Git.
- Use a different secret for each environment, so staging values cannot unlock production.
- Rotate a secret straight away if it appears in a log, a screenshot or a chat.
- A short prefix such as gt_ makes leaked keys easy to search for and revoke.
How to use it
- 1Choose a preset or a format and strength
- 2Set how many, an optional prefix and the output style
- 3Copy or download the values
Questions
How many bits do I need?
128 bits cannot be guessed by any known method. 256 bits is the usual choice for signing secrets and encryption keys, and is what HS256 JWT secrets and AES-256 keys expect.
Hex, Base64 or alphanumeric?
All are equally random for the same number of bits. Hex is easiest to read and paste; Base64 is shorter; Base64 URL and alphanumeric are safe in URLs, headers and file names without escaping.
Are the values stored or sent anywhere?
No. They are generated in your browser and disappear when you leave the page.
Should I use this or the Password Generator?
Use this tool for values that machines read: keys, secrets and IDs. Use the Password Generator for passwords people type.