Skip to main content
HandyWeb

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.

Type
Characters
192 bits of randomness each

Every value comes from crypto.getRandomValues of your browser.

How to Use It

  1. Choose Token or Random bytes.
  2. Choose the characters or the output format, the length, and how many.
  3. 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.

Source code of this toolReport a problem on GitHub