# Random Key Generator

> Random API keys, tokens and secrets in bulk. Runs entirely in your browser — nothing is uploaded.

Source: https://toffeekit.com/tools/api-key-generator

**Category:** [Security](https://toffeekit.com/category/security) · **Price:** Free · **Runs:** in your browser, nothing is uploaded

Open the tool: https://toffeekit.com/tools/api-key-generator

**Also useful for:** api key, secret key, token, random string, hex, base64url, generator

## How it works

1. Pick a preset: 256-bit hex secret, Live API key, Test API key or URL-safe token.
2. Set Length from 8 to 128, choose Characters (Hex, Base64url, Alphanumeric or Custom), and add a Prefix if you want one.
3. Set How many from 1 to 50 and choose Copy all as: Lines, .env or JSON.
4. Click Regenerate for a fresh set, then Copy all or copy a single key.

## FAQ

### How do I generate a secure random API key?

Pick a preset and click Regenerate. Each key is made with your browser's secure random generator, so it is suitable for secrets and tokens.

### How do I make a 256-bit secret key?

Use the 256-bit hex secret preset, which gives 64 hex characters. That is 256 bits of randomness, a common size for signing secrets.

### What is the difference between hex, Base64url and alphanumeric?

Hex uses 0 to 9 and a to f, Base64url uses letters, numbers, hyphen and underscore and packs more randomness per character, and alphanumeric uses letters and numbers only.

### How do I add a prefix like sk_live_?

Type it in the Prefix field. The Live API key and Test API key presets use sk_live_ and sk_test_, similar to the style many payment APIs use.

### How do I get keys for a .env file?

Set Copy all as to .env and click Copy all. You get one line per key in KEY=value format.

### Is Random Key Generator free and private?

Yes. It's free with no sign-up or limits, and it runs entirely in your browser, so what you type or paste never leaves your device. It works on phones and computers alike.

## Privacy

Random Key Generator runs entirely in your browser. Your files and text are processed on your device and are never uploaded.

## Related tools

- [Password Generator](https://toffeekit.com/tools/password-generator) — Strong random passwords from your browser's crypto.
- [Text Redactor](https://toffeekit.com/tools/text-redactor) — Hide emails, phones, cards and more in any text.
- [Passphrase Generator](https://toffeekit.com/tools/passphrase-generator) — Memorable random-word passphrases with entropy.
- [Password Strength Checker](https://toffeekit.com/tools/password-strength-checker) — Test a password's strength and crack time privately.
- [Text Encrypt / Decrypt](https://toffeekit.com/tools/text-encryption) — Encrypt messages with a password using AES-256.
- [File Encrypt / Decrypt](https://toffeekit.com/tools/file-encryption) — Password-protect any file with AES-256 encryption.

