Handitab

API Key / Token Generator

Generate random strings for API keys, tokens, and secrets, 1 to 512 characters long, in alphanumeric, hex, or URL-safe Base64 characters.

About API Key / Token Generator

An API key or token is a long random string used to identify or authorize a client. This generator picks each character independently from the chosen alphabet using the browser's cryptographic random source (crypto.getRandomValues) with rejection sampling, so every character is equally likely. A 32-character alphanumeric string carries about 190 bits of entropy. The Base64 URL-safe option draws from that 64-character alphabet directly and does not encode bytes.

Also known as: Random String Generator.

How to use API Key / Token Generator

  1. Fill in "Length", "Characters", "Prefix" and "Count".
  2. The result appears below. Press "Generate again" for a new one.
  3. Copy the result with the copy button, or download it as a file where that is offered.

Questions about API Key / Token Generator

How long should an API key be?

Aim for at least 128 bits of randomness. That is 32 hexadecimal characters or 22 alphanumeric ones. The default of 32 alphanumeric characters gives about 190 bits, which is more than enough against guessing.

Runs in your browser. Page last updated .

More security tools

All 10 security tools