Random Token and API Key Generator
Create secure random tokens, API keys, or random bytes as hex, Base64, or Base64url. The randomness comes from crypto.getRandomValues of your browser.
Runs on your device.
192 bits of randomness each
Every value comes from crypto.getRandomValues of your browser.
How to Use It
- Choose Token or Random bytes.
- Choose the characters or the output format, the length, and how many.
- Copy the output, or select Generate again.
Questions and Answers
How long must a token be?
For an API key or a session token, at least 128 bits of randomness: 32 hex characters or 22 Base64url characters. The bit count shows under the output.
Are these values safe for cryptography?
Yes. They all come from crypto.getRandomValues, the source that the browser uses for keys. Each character is picked with rejection sampling, so no character is more likely than another.
Good to Know
Up to 1,024 characters per token, 1,024 bytes per value, and 100 values at a time.
Related Tools
- Password GeneratorCreate a strong random password or a passphrase of English words. The randomness comes from crypto.getRandomValues.
- HMAC Generator and VerifierCreate the HMAC-SHA256, HMAC-SHA384, or HMAC-SHA512 of a message with a secret key, or check a webhook signature.
- UUID and ULID GeneratorCreate UUID version 4 and 7 or ULID values, up to 1,000 at a time. Paste a UUID or a ULID to see its version and the time inside it.