Secret & Token Generator

Generate API keys, hex/Base64/URL-safe secrets and JWT secrets.

The Secret Generator creates random secrets such as API keys, signing keys and tokens in hex, Base64, Base64URL, alphanumeric or UUID v4 form. You choose the size and how many to make, from 1 to 100. Values come from the browser cryptographic random source.

What is a secret and how are secrets generated?

A secret is a random value that only your systems know, such as an HMAC signing key, an encryption key, a session token or an API key. Its security depends on unpredictability, so it must come from a cryptographically secure random number generator, not from a timestamp or a typed word. Length is measured in bytes of randomness: 32 random bytes give 256 bits. The same bytes can be written in different encodings. Hex uses two characters per byte, Base64 about four characters for three bytes, and Base64URL is the same without padding and with URL-safe characters. A UUID v4 has 122 random bits, with fixed bits marking version 4 and the variant, which makes it fine as an identifier but less suitable as a long-term key than 32 random bytes.

How to use Secret & Token Generator

  1. Pick a format Choose Hex, Base64, Base64URL, Alphanumeric or UUID v4 in Format.
  2. Choose size and count Select Bytes / length (not shown for UUID v4) and set Count between 1 and 100.
  3. Generate Click Generate. The values appear one per line in Secrets.
  4. Copy or download Copy the text or download it as secrets.txt.

Frequently asked questions

How random are the values?

They come from crypto.getRandomValues, the secure random generator built into the browser.

How many bytes do I need?

32 bytes (256 bits) is a common choice for HMAC and symmetric keys. 16 bytes (128 bits) is the usual minimum for random tokens.

What is the difference between Base64 and Base64URL?

Base64URL replaces + and / with - and _ and omits the = padding, so it is safe in URLs and filenames.

Is UUID v4 suitable as a secret?

It has 122 random bits, but it is designed as an identifier and its format is well known. Use a longer random value for keys and tokens.

Are secrets stored or sent?

No. They are created in the page, nothing is stored or transmitted, and they disappear when you leave or regenerate.