Random Secret / Token Generator
Create random tokens in hex, base64, base64url, UUID v4, alphanumeric or numeric form. They come from the browser cryptographic random generator and can be made in bulk.
Use the tool
Why this tool exists
Applications need random values for session secrets, API keys, webhook signing keys, CSRF tokens and test fixtures. Typing something that looks random or using a timestamp is a classic mistake. A proper secret has to come from a cryptographic random source and be long enough.
This generator uses crypto.getRandomValues and lets you choose the encoding and length, so you can match what your framework expects: 32 bytes as hex for a signing key, URL-safe base64 for a token in a link, or a numeric code for testing. It can print the entropy of each value, which helps you judge whether the length is enough. The values exist only in your browser, but treat anything you intend to use in production as sensitive.
How to use it
- Choose the format: hex, base64, base64url, uuid, alphanumeric or numeric.
- Set the length and how many values you need.
- Tick the information option to see the entropy in bits.
- Run the tool and copy the values.
Frequently asked questions
What does length mean for each format?
For hex, base64 and base64url it is the number of random bytes before encoding. For alphanumeric and numeric it is the number of characters. For uuid the length is ignored.
How much entropy do I need?
For secrets used as keys or tokens, at least 128 bits is a common minimum, and 256 bits is typical for signing keys. Turn on the information option to see the bits for your setting.
Is UUID v4 suitable as a secret?
It has 122 random bits, which is fine as an unguessable identifier. But some libraries do not use a secure random source, so for secrets prefer a plain random token of 32 bytes.
Are the values stored or sent?
No. They are generated locally and are not uploaded. Limits are lengths up to 4,096 and up to 500 values per run.