Skip to content
Devtoolry

Random String Generator

Generate random strings, tokens and API keys in hex, Base64URL or custom alphabets.

About the Random String Generator

The Random String Generator creates tokens, API keys, salts and IDs from the browser's cryptographically secure random source, in hex, Base64URL or any alphabet you define.

Everything is generated in your browser; nothing you enter is uploaded, and anything random comes from a cryptographically secure source.

How to use the Random String Generator

  1. Choose the length and the alphabet (hex, Base64URL, alphanumeric or custom).
  2. Set how many strings to generate.
  3. Copy the results.

Frequently asked questions

How long should an API key be?

At least 128 bits of randomness: 32 hex characters or 22 Base64URL characters.

Is Math.random() used?

No. Values come from crypto.getRandomValues, which is suitable for security purposes.