Skip to content
Sealpaste

Delete all recent work?

This removes the 0 items saved in this browser. Your settings stay.

Stop saving recent work?

New work won't be saved in this browser. The 0 items already saved can stay or go.

API Key Generator

API keys
Ready
Runs in your browser. Nothing you paste is uploaded unless you share it.

Create random API keys with a prefix, as Base62, Base64, hex, digits or a UUID, or key and secret pairs, up to 1,000 at once

Create API keys with a prefix such as myapp_live_, or hex and Base64url tokens for signing secrets, sessions and webhooks.

How to use it

  1. Pick API key, Hex or Base64url.
  2. For an API key, type a prefix, pick the characters (Base62, Base64, hex, capitals, digits or a UUID) and the length, up to 256; turn on Key + secret for an id:secret pair. For a token, set the number of random bytes.
  3. Copy the key into your secret store or .env file, or download a batch for seeding test data.

Examples

A key with a prefix

Input
API key · prefix myapp_ · length 32
Result
myapp_KTUC0DxEN08RBgkzr3WSR9qNuGR8K4qg

190 bits: 32 letters and digits after the prefix; the prefix adds none.

A 32-byte hex secret

Input
Hex · 32 bytes
Result
182313a7fc75c5ff3e5321cafae40939f324615016bf580e7526615a849392d8

256 bits, the size of an HMAC-SHA256 key.

A key id and secret pair

Input
API key · prefix ak_ · Base62 · length 40 · Key + secret
Result
ak_Q7M2ZK4XH1P9TB0C6RWD:x3Lr9TQe0uVb2HkWm7NzPa5sYc8JdF1gRo4iKtEw

The id before the colon is public, like an AWS access key id, and the 238 bits are in the secret after it. Send it as Basic auth, or split it at the colon.

Why keys have a prefix

A short fixed start such as myapp_live_ or myapp_test_ tells people and logs which service and environment a key belongs to, and lets secret scanners find leaked keys by pattern. It is not secret and adds no strength: only the random part counts.

The random part is Base62 (A–Z, a–z, 0–9) unless you pick another set, so the key survives URLs, headers, JSON and a double click to select it. Standard Base64’s + and / need escaping in a URL; digits only or capitals and digits suit systems that take nothing else.

Which format

FormatPer characterUse it for
Base62 key5.95 bitsAPI keys people copy and paste
Base64 key (+ /)6 bitsSystems that expect standard Base64 characters; escape + and / in URLs
Capitals and digits5.17 bitsKeys read aloud or typed, license-style codes
Digits only3.32 bitsNumeric-only fields; make it long (39 digits for 128 bits)
UUID v4 key122 bits in allSystems that store keys in a UUID column
Hex4 bitsSigning secrets, HMAC keys, config that expects hex
Base64url6 bitsShort tokens in URLs and cookies (RFC 4648 §5, no padding)

Sources: RFC 4648 §5

How much randomness

NIST counts 112 bits as the least security strength for protecting data today, and 128 bits is the usual choice. A 22-character Base62 key, 16 bytes of hex or a 22-character Base64url token reaches 128; the defaults here give 190 and 256.

Store only a hash of each key on your server, as you would a password, and compare in constant time.

Sources: NIST SP 800-57 Part 1 Rev. 5

Questions

Can I use these keys in production?
Yes: they come from your browser’s cryptographic generator (crypto.getRandomValues), with no bias between characters. They are made on your device and this page does not send or store them. Many teams still generate production keys on the server that checks them, so the key is never on a laptop.
Hex or Base64url for a secret?
Both carry the same random bytes. Hex is longer but easier to read and is what many config files expect; Base64url is a third shorter and fits in URLs and headers without escaping.
What is Key + secret?
Each line is a pair: a public id of 20 capitals and digits after your prefix, a colon, then the secret. The id can be stored and logged in plain text to find the key; only the secret is hashed and checked. AWS access keys and many APIs work this way.
Are an API key and an encryption key the same?
No. An API key identifies and authorizes a caller and is compared, not used to encrypt. An encryption key is raw bytes for a cipher: generate those with your crypto library, or take hex bytes from here and decode them.

Related tools