ShotMark
Skip to Content

API Key Generator

Generate cryptographically random API keys.

Options

What is API Key Generator?

An API key generator is a tool that produces random, opaque strings suitable for use as authentication credentials between two services. API keys identify the caller, scope access per tenant, and let an API enforce rate limits per consumer without a full OAuth handshake on every request.

This API key generator produces values in three formats (hex, base62, UUID) with configurable length and bulk output. Backend developers issuing partner credentials, DevOps engineers rotating secrets, and security teams provisioning service accounts use it when an integration needs a fresh key without spinning up a key-management service.

Why use an API Key Generator?

  • Produce high-entropy secrets in one click. A 32-character hex key has 128 bits of entropy, outside the reach of any practical brute-force attack.
  • Match your API’s expected format. Hex, base62, and UUID cover almost every key shape in the wild, from Stripe-style sk_live_xxx to Slack-style xoxb-xxx.
  • Rotate keys in bulk. Generate 50 keys per batch when rotating a fleet of service accounts.
  • Avoid weak homegrown generators. Code that loops over Math.random produces predictable output and has caused real-world leaks.
  • Stay private. Each key is produced in your browser and never sent over the network.

How to use the API Key Generator

  1. Pick a Format: hex for 0-9a-f keys, base62 for URL-safe alphanumeric, or uuid for RFC 4122 v4 UUIDs.
  2. Set the Length field for hex or base62 (16 to 128 characters). UUID format ignores length.
  3. Set Count to the number of keys you need in one batch, up to 50.
  4. Click Generate to produce the batch.
  5. Copy a single key with its row icon, or copy the entire batch with the top Copy button.

A typical hex key at 32 characters looks like:

a7f3e9c2d8b1f6e4a0c5d2b7f9e8c1a3

A base62 key at 32 characters looks like:

k7QmL2pX9vNtRz4BW2cE5gKmH8sLdQ1n

Format comparison

The three formats trade alphabet size for entropy density and visual style. Pick the one that matches the conventions of the system that will consume the key.

FormatAlphabetBits per charExample lengthBest for
hex0-9, a-f (16 chars)4.032 chars = 128 bitsSalts, signing keys, system tokens
base62A-Z, a-z, 0-9 (62 chars)~5.9532 chars = 190 bitsURL-safe API keys, public-facing IDs
uuid (v4)hex with hyphens, fixed 36 chars122 bits totalAlways 36 charsCross-system identifiers, RFC 4122 conformance

Security considerations

Generating a strong key is the easy part. Storing it safely matters more. Drop the value into a secrets manager (AWS Secrets Manager, Vault, 1Password) immediately and never paste it into source control or a CI log. Rotate every 90 days for partner keys, 30 days for high-value service accounts, and immediately after any departure.

Pair every key with a prefix that identifies its environment (sk_live_, pk_test_, svc_prod_). A leaked key with a clear prefix is easier to detect with secret-scanning tools like GitHub’s push protection or Gitleaks.

Common use cases

  • Backend developers issuing partner credentials. Mint a 32-char base62 key per integration partner so each can be revoked without affecting others.
  • DevOps engineers rotating CI/CD secrets. Generate fresh keys before each quarterly rotation, store in the secrets manager, redeploy.
  • Security engineers provisioning service accounts. Issue a 64-char hex key per internal service so traffic can be audited per caller.
  • QA engineers seeding test environments. Produce batches of test keys with a recognizable prefix (test_) to filter staging traffic from production logs.

Frequently asked questions

Is this API key generator secure?

The output is generated in your browser using a uniform random selection over the chosen alphabet, suitable for opaque API keys. For cryptographic signing keys (HMAC secrets, JWT private keys), use a tool that calls crypto.getRandomValues explicitly. For everyday API authentication, this tool is appropriate.

Are keys sent to a server?

No. The page does all generation client-side. No HTTP request is made when you click Generate, no key is logged remotely, and closing the tab discards every value. You can verify this in the DevTools Network panel.

What length should I use?

For most public-facing APIs, 32 characters in base62 (about 190 bits) is more than sufficient. For internal HMAC signing keys, 32 characters in hex (128 bits) is the standard. Increase length if the key will be exposed in client-side code.

How is an API key different from a password?

A password authenticates a human and is typically paired with a second factor. An API key authenticates a machine or integration and is the sole credential on each request. Keys must therefore have higher entropy than typical user passwords and must be stored in a secrets manager.

Should I hash API keys before storing them?

Yes. Store only a hash of the key (using bcrypt, argon2, or HMAC-SHA-256 with a server-side salt) so a database leak does not expose the keys themselves. Show the plaintext key to the user exactly once at creation time.

What is the difference between an API key and a JWT?

An API key is an opaque random string the server looks up to find the caller’s identity. A JWT is a signed, self-describing token that carries claims in its payload. Use keys for long-lived service-to-service auth; use JWTs for short-lived user sessions.

Can the same key be generated twice?

A 32-character base62 key has 62^32 (about 2.3 x 10^57) possibilities. The chance of collision is negligible for any practical workload.

Like this tool?

ShotMark captures what you do here, in one click.

The traces, payloads, and tests you run by hand? ShotMark grabs the whole bug and hands it to your AI agent.

Private beta accessFounding pricing lockNo spam ever