Shiklo Tools
PDF40
Image20
Calculators & Converters25
Text & Writing13
Developer26
Video14
Audio14
Document14
Data & Spreadsheet12
Web & SEO9
OCR & Scanning5
Archive & File12
Security & Privacy23
Health & Medical29
QR & Barcode5

API Key Generator

Generate secure random API keys, tokens and secrets of 128–512 bits in Base62, hex, Base64, Base64URL or Base32, with an optional prefix.

Create strong API keys, access tokens, webhook secrets and session secrets in one click. The API Key Generator uses your browser's cryptographically secure random generator to produce keys with 128, 192, 256, 384 or 512 bits of randomness, encoded the way you need: Base62 (letters and digits only), hexadecimal, Base64, URL-safe Base64URL or Base32.

Add a prefix such as sk_live_ or myapp_ so keys are easy to recognise in logs and can be found by secret scanners, generate up to 50 keys at once, and show the SHA-256 hash of each key — the value to store in your database instead of the key itself. Keys are generated on your device and never sent anywhere.

How to use API Key Generator

  1. Choose the strength: 128 to 512 bits (256 is a good default).
  2. Choose the format: Base62, hex, Base64URL, Base64 or Base32.
  3. Optionally add a prefix and choose how many keys to make.
  4. Press Generate and copy the keys (and their SHA-256 hashes if you need them).

Features

  • 128, 192, 256, 384 or 512 bits of randomness.
  • Base62, hex, Base64, Base64URL and Base32 encodings.
  • Optional prefix such as sk_live_ or ghp_.
  • Up to 50 keys at once.
  • SHA-256 of each key for storing hashed keys.
  • Cryptographically secure; generated in your browser, never sent.

Formats and lengths

All formats carry the same randomness; they only differ in which characters are used and how long the key is. Base62 uses letters and digits only, so keys can be double-clicked and pasted anywhere without escaping. Base64URL is compact and safe in URLs; hex is the most widely accepted; Base32 avoids lower case for systems that ignore letter case.

FormatCharactersLength for 256 bits
Base62A–Z, a–z, 0–943 characters
Hex0–9, a–f64 characters
Base64URLA–Z, a–z, 0–9, - and _43 characters
Base64A–Z, a–z, 0–9, + and /, = padding44 characters
Base32A–Z, 2–752 characters

How many bits do I need?

128 bits of randomness is already impossible to guess by brute force; 256 bits is the common choice for API keys and signing secrets and matches the key size of HMAC-SHA-256 and AES-256. Longer keys don't make guessing any more realistic but can be required by specific systems. What matters more is that the randomness is real: keys here come from crypto.getRandomValues, and Base62 characters are drawn with rejection sampling so every character is equally likely.

Prefixes and hashed storage

Many services prefix their keys — sk_live_ for Stripe secret keys, ghp_ for GitHub tokens — so people and tools can tell what a key is and where it belongs, and so secret scanners can spot a leaked key in code. A prefix adds no security by itself; the random part does. On the server, store a hash of each key rather than the key: if the database leaks, the keys can't be used. Because API keys are long and random, a fast hash like SHA-256 is enough (unlike passwords, which need slow hashes such as bcrypt or Argon2).

Handling keys safely

Show a new key to its owner once, then only keep the hash. Never commit keys to source control; use environment variables or a secrets manager. Give each client its own key so you can revoke one without affecting others, rotate keys regularly, and scope them to the minimum permissions needed. This page doesn't keep the keys it shows, so copy them before leaving.

Frequently asked questions

Are these API keys secure?

Yes. They are made from your browser's cryptographically secure random generator, with 128 to 512 bits of randomness.

Which format should I use?

Base62 is the most convenient (letters and digits only). Use hex or Base64URL if your system expects them.

How long should an API key be?

256 bits is a common, strong choice. That is 43 Base62 characters or 64 hex characters.

Why store the SHA-256 hash?

If your database leaks, hashed keys can't be used. Compare the hash of the key a client sends with the stored hash.

Are the keys sent to a server?

No. Keys are generated in your browser and never leave your device.

Can I use these as passwords or encryption keys?

They make good random secrets. For encryption, use the raw bytes your crypto library expects; for human passwords, a passphrase is easier to remember.

What characters can a prefix contain?

Letters, digits, underscore, hyphen and dot, up to 32 characters.

Related tools