Random String & API Key Generator

Create random API keys, secrets and tokens from the browser’s secure random generator, one at a time or in bulk.

Runs in your browser. Nothing is uploaded Free, no sign-up Works on mobile
Strong · 190 bits of entropy per key
5.95 bits per character · 22 characters give 128 bits
1 to 1,000

Keys are made on your device with crypto.getRandomValues. Random values that would make some characters more likely are discarded (rejection sampling), so every character is equally likely. Nothing is sent or stored. Store secrets in a secrets manager or environment variables, never in code.

How to generate an API key

  1. Pick a character set and length.
  2. Add a prefix such as sk_live_ and choose how many keys you need.
  3. Copy them or download them as a text file.

Features

  • Letters, digits, symbols, hex, base64url or your own characters
  • Optional prefix such as sk_live_ or pk_test_
  • Up to 1,000 keys at once
  • Rejection sampling, no modulo bias
  • Entropy in bits
  • Copy all or download as .txt or JSON

Frequently asked questions

How long should an API key be?

Aim for at least 128 bits of entropy, which is 32 hex characters or 22 base64url characters. 256 bits (64 hex or 43 base64url characters) is a comfortable choice for long-lived secrets.

What does “unbiased” mean here?

Simply taking a random byte modulo the alphabet size makes some characters slightly more likely. This tool throws away random values that would cause that skew (rejection sampling), so every character is exactly equally likely.

Does the prefix add security?

No. A prefix like sk_live_ only helps people and secret scanners recognise the key. The entropy shown counts only the random part.

Are the keys stored anywhere?

No. They are generated on your device with crypto.getRandomValues and are never sent or saved.