Skip to main content

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.

✓ 6 key formats ✓ Cryptographically secure ✓ Runs 100% in your browser

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.

Share this tool: X / Twitter LinkedIn
✓ 60,000+ developers use DevPlaybook ★★★★★ 4.8 / 5 on Gumroad ✓ MIT licensed · Instant download ✓ No login required

Related Products

on Gumroad

You Might Also Need

More Free Tools

OpenAPI Validator API Response Mock Generator API Response Time Tester OpenAPI Schema Validator OpenAPI Mock Generator API Test Case Generator API Request Builder HTTP Security Headers Generator API Mock Server Config Generator HTTP Security Headers Checker API Rate Limit Calculator API Response Formatter & Analyzer HTTP API Tester LLM Cost Calculator LLM Token Counter AI Prompt Cost Calculator REST API Request Builder Content Security Policy Builder LLM Prompt Cost Calculator API Response Mocker HTTP Header Inspector AI Rate Limit Calculator Prompt Injection Tester Token Context Calculator GCP Service Account Key Auditor Token Counter & Cost Estimator HTTP Headers Analyzer AI Doc Generator — Pro Tool AI System Guardian .htaccess Generator HTTP Methods Reference HTTP Code Snippet Generator HTTP Status Code Reference HTTP Status Code Reference JSON Diff Viewer JSON Diff nginx Config Generator Password Strength Checker Rate Limiter Tester API Changelog Generator HTTP Mock Response Builder HMAC Generator CSP Header Builder Rate Limit Calculator CORS Policy Builder AWS IAM Policy Validator HTTP Cookie Parser SBOM Generator HTTP Status Code Lookup HTTP Status Code Lookup Vue Component Generator HTTP Status Code Reference LLM Context Window Calculator HTTP Header Analyzer Dockerfile Linter mTLS Certificate Chain Builder Prompt Token Estimator Mock Service Worker (MSW) API Mocking Guide Pulumi Modern IaC Guide OpenAI Token Counter Casdoor Docker Layer Optimizer HTML5 Canvas API Playground GraphQL Client Configurator OpenAI Function Calling Generator AI Context Window Visualizer AI API Rate Limit Calculator Password Strength Analyzer

Enjoying this tool? Get more like it.

Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.

DevPlaybook Pro 7 days free

Unlock AI-Powered Dev Tools

  • ⚡ AI Code Review, Doc Generator & SQL Builder
  • ⚡ All premium templates & early access
  • ⚡ Member discounts on Gumroad products
Start Free Trial →

$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.

$79
$241 separately Save $162 (67% off)
Get DevPlaybook Pro — $79 →

MIT licensed · Instant download · No subscription

See what's included → Browse all deals →