Token Generator

Generates cryptographically-random tokens.

Token Generator creates cryptographically-random tokens directly in your browser using the Web Crypto API. Choose hex, Base64URL, or alphanumeric output, set the number of random bytes, and generate one or many secrets at once. It is handy whenever you need a random secret, API key, or unguessable identifier without reaching for a command line.

Common uses

  • Generate an API key or client secret for a new service or environment
  • Create a session token, CSRF token, or one-time link identifier
  • Produce a random value for a .env file, such as a signing or encryption secret
  • Generate URL-safe Base64URL tokens for use in query strings and links
  • Batch-create multiple tokens at once for seeding test data or multiple environments
  • Get a quick hex string of a specific byte length for cryptographic seeds or nonces

FAQ

Is my data sent to a server?

No. All tokens are generated entirely in your browser using the built-in Web Crypto API, and nothing is uploaded or transmitted. The generated values never leave your device.

How random are the tokens?

Tokens are produced with crypto.getRandomValues, the browser's cryptographically secure random number generator. This is suitable for secrets such as API keys and session tokens.

What output formats are supported?

Three formats are available: Hex (lowercase 0-9a-f), Base64URL (URL-safe Base64 with + and / replaced by - and _ and no padding), and Alphanumeric (A-Z, a-z, 0-9).

How long is the resulting token?

Length depends on the byte count and format. Hex output is twice the byte count in characters, alphanumeric output equals the byte count, and Base64URL is roughly four characters per three bytes. The byte count can be set from 1 to 256.

Can I generate more than one token at a time?

Yes. Set the Count field to generate between 1 and 100 tokens at once; each token is placed on its own line in the output.

Related tools

  • Barcode Generator
  • Fake Data Generator
  • Lorem Ipsum
  • NanoID Generator
  • Password Generator
  • QR Code Generator
  • Random Generator
  • Test Data Generator