jsonecho

Random Key Generator

Create strong random keys and secrets with a size, format and optional prefix of your choice.

Loading the tool...

How to use Random Key Generator

  1. Choose the length and format.
  2. Set how many keys you need and an optional prefix.
  3. Copy the keys.

About Random Key Generator

API keys, signing secrets and session tokens must be unpredictable. This tool uses the secure random generator built into your browser, the same one used for cryptography, so the results are suitable for real secrets.

The length is the number of random bytes for Hex, Base64 and Base64URL, and the number of characters for the letters and digits format. A 32 byte key gives 256 bits of randomness. Add a prefix if you want keys that are easy to recognise, like sk_live_.

Frequently asked questions

Are the keys really random?

Yes. They come from the cryptographically secure generator of your browser, not from a simple random function.

Are the keys stored or sent anywhere?

No. They are created on your device and exist only on this page until you copy them.

How long should a secret be?

For HMAC and JWT secrets, 32 bytes or more. For API keys, 24 to 32 bytes is common.

What is the difference between Base64 and Base64URL?

Base64URL replaces + and / with - and _ and has no padding, so it is safe to use in URLs and file names.

More in URL and Base64

All tools →