Secret Key Generator

About Secret Key Generator

Make a random key for a signing secret, an API token or a session ID. Choose the number of random bytes and the encoding: hex, Base64 or Base64URL. It uses your browser's secure random source.

How to use Secret Key Generator

  1. Set the number of random bytes. 32 bytes gives 256 bits.
  2. Choose hex, Base64 or Base64URL.
  3. Copy the generated key.
  4. Store it in a secrets manager or environment variable.

Questions and answers

How many bytes do I need?

32 bytes (256 bits) is a common choice for signing secrets.

Is the key sent anywhere?

No. It is generated on your device.

Which format is best?

Hex is simple, Base64URL is shorter and URL-safe.

Related tools