API Key Generator
Generate cryptographically secure API keys, tokens, and secrets — entirely in your browser.
Choose format, length, prefix, and grouping. Uses crypto.getRandomValues() — nothing is sent to any server.
Frequently Asked Questions
What key formats does this tool support?▼
Six formats: Hex (0-9, a-f), Base64 URL-safe (A-Z, a-z, 0-9, -, _), UUID v4 (standard 8-4-4-4-12 format), JWT-style (three dot-separated base64url segments), Alphanumeric (A-Z, a-z, 0-9), and Numeric (0-9 only). Each has different entropy per character — hex gives 4 bits/char, base64 gives 6 bits/char.
Is this tool cryptographically secure?▼
Yes. All keys are generated using crypto.getRandomValues() — the Web Crypto API backed by your OS's CSPRNG. This is the same source used by TLS, password managers, and secure token libraries. Nothing is sent to any server.
How long should my API key be?▼
For most use cases, 128-bit (32 hex chars or 22 base64url chars) is the minimum. 256-bit (64 hex chars) is recommended for long-lived keys or sensitive APIs. UUID v4 provides 122 bits of entropy. JWT-style tokens in this tool provide ~512 bits.
What is a good prefix format for API keys?▼
Prefixes help identify key type and owner at a glance. Common patterns: sk_ (secret key, e.g. Stripe), pk_ (public key), sk-live_ / sk-test_ (environment scoping), or a service abbreviation like myapp_. Prefixes don't add entropy but improve operability.
When should I use UUID vs hex vs base64?▼
UUID is best when you need a standard interoperable identifier (databases, REST resources, logs). Hex is readable, easy to debug, and works in any context. Base64 URL is compact — 32 chars gives 192 bits of entropy vs 128 bits for hex of the same length. Use base64url for tokens stored in headers or URLs.
How do I store API keys securely?▼
Never commit keys to source control. Store them in environment variables, a secrets manager (AWS Secrets Manager, HashiCorp Vault, Doppler), or your CI/CD platform's secret store. On the server side, store only a bcrypt/SHA-256 hash of the key and verify against it — never store plaintext.
Related Products
on GumroadDevToolkit Starter Kit
A ready-to-deploy developer tools website with 12 built-in tools. Astro + Preact + Tailwind. Deploy to Cloudflare Pages for free. Built-in SEO, dark mode, and ad-ready layout.
Buy on Gumroad →TypeScript Quick Reference Toolkit
5 practical reference files for TypeScript developers: cheatsheet, TS vs JS comparison, 20 utility types with real examples, tsconfig best practices template, and 15 common mistakes guide. Print it. Keep it on your desk.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
OpenAPI Validator
Paste your OpenAPI 3.x spec (YAML or JSON) to validate structure, find missing required fields, detect duplicate paths, check for missing operationIds, and get errors and warnings with path references.
Open free tool →
API Response Mock Generator
Generate realistic mock API responses with custom status codes, headers, and JSON body. Quick templates for 200, 401, 404, 429, 500 and more. Runs in your browser.
Open free tool →
API Response Time Tester
Test API endpoint response times directly from your browser. Run multiple requests, see average/min/max times, status codes, and response sizes. GET, POST, PUT, DELETE support. Free.
Open free tool →
More Free Tools
Related Articles
JWT Token Decoder: How to Debug Authentication Issues
Learn how to use a JWT token decoder to diagnose 401 errors, expired tokens, missing claims, and auth misconfiguration. Practical debugging guide with code examples.
JWT Tokens Explained: How to Decode and Debug Them
Understand JSON Web Tokens from header to signature. Learn how to decode JWTs, read their claims, debug authentication issues, and use free online JWT tools.
JWT Authentication Best Practices 2026: Secure Your API Tokens
Complete JWT security guide for 2026. Covers RS256 vs HS256 signing, token storage strategies, expiry and refresh token patterns, revocation, common vulnerabilities, and a production security checklist.
Base64 Encode/Decode Explained: When and How to Use It
Understand when to use Base64 encoding and when to avoid it. This guide explains the Base64 algorithm, practical use cases, code examples in JavaScript, Python, Go, and more.
Base64 Decode Online: Instantly Decode Any Base64 String for Free
Decode Base64 strings instantly online — JWT payloads, API image data, env vars, and SSH keys. No install needed, no account. URL-safe variant supported.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →