General dev

API Key & Token Generator

Runs locally

Use API Key & Token Generator

What it does

Generate random API keys, tokens and secrets of a chosen length and alphabet with crypto.getRandomValues, optionally starting with a prefix such as sk_ or pk_.

It runs entirely in your browser: nothing you enter is uploaded.

Example

Tokens with a prefix

Input
test_
What the output looks like
test_ + 32 random characters, five times, for example  test_95Pz…  (the rest hidden).
Tokens are generated in your browser with crypto.getRandomValues; a token printed on a public page could not be used as a secret, so none is shown here.

Gives five tokens made of test_ and 32 random letters and digits, about 190 bits each; the prefix is fixed text and adds no randomness.

FAQ

How much entropy does a token have?

Roughly the length times log2 of the alphabet size: 32 alphanumeric characters give about 190 bits and 32 hex characters 128 bits. Bytes are mapped to characters with a modulo, which makes some characters slightly more likely for alphabets other than hex and costs less than 0.02 bits per character.

Why add a prefix like sk_ or pk_?

A fixed prefix tells people and secret scanners what the token is, so leaked keys are easier to spot and revoke; GitHub's ghp_ tokens work this way. Pick your own prefix, because copying another service's format can trigger false alerts in secret scanners.

Are the tokens sent or stored anywhere?

No. They are generated in your browser and never uploaded or saved. Keep them in a secrets manager, not in client-side code.